小编lim*_*jix的帖子

Cloud Run 是否需要 NGINX?

我正在为我的博客和工作网站使用 cloud run,我真的很喜欢它。我已经根据 google 教程通过容器化部署了 python API 和 Vue/Nuxt 应用程序。我不明白的一件事是为什么前面不需要 NGINX。

# Use the official lightweight Node.js 12 image.
# https://hub.docker.com/_/node
FROM node:12-slim

# Create and change to the app directory.
WORKDIR /usr/src/app

# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this separately prevents re-running npm install on every code change.
COPY package*.json ./

# Install production dependencies.
RUN npm install --only=production

# Copy …
Run Code Online (Sandbox Code Playgroud)

google-cloud-platform google-cloud-run

9
推荐指数
1
解决办法
5144
查看次数

Firebase 云消息传递:请求缺少所需的身份验证凭据

我正在努力让 Firebase Cloud Messaging sdk 与 Nuxt JS 一起使用

我不断收到“检索令牌时发生错误。FirebaseError:消息传递:用户订阅 FCM 时发生问题:请求缺少所需的身份验证凭据。需要 OAuth 2 访问令牌、登录 cookie 或其他有效的身份验证凭据。”

这是我在 fcm.js 中的代码,我在 nuxt.config.js 中作为插件运行

import firebase from "../firebase/init";

firebase
  .messaging()
  .usePublicVapidKey(
    "BDYE2EYHdIp8qHjTKcJYPvO4PgaAH2pSruP55FOtNs5jWsgdeg7YK6OgJ0daSu21kN7aSzU19NRXRqC4bfITZYQ "
  );

firebase
  .messaging()
  .getToken()
  .then((currentToken) => {
    console.log(currentToken);
    if (currentToken) {
      sendTokenToServer(currentToken);
      updateUIForPushEnabled(currentToken);
    } else {
      // Show permission request.
      console.log(
        "No Instance ID token available. Request permission to generate one."
      );
      // Show permission UI.
      updateUIForPushPermissionRequired();
      setTokenSentToServer(false);
    }
  })
  .catch((err) => {
    console.log("An error occurred while retrieving token. …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js firebase-cloud-messaging nuxt.js

5
推荐指数
1
解决办法
1万
查看次数

Google Cloud“Cloud Identity”、“Firebase Auth”、“Identity Platform”之间的区别

我试图了解以下之间的区别:Cloud Identity、Firebase Auth、Identity Platform

我已阅读以下文件:https : //cloud.google.com/identity-platform/docs/product-comparison https://cloud.google.com/blog/products/identity-security/identity-and-authentication -the-google-cloud-way

我的问题是:

  1. 为什么身份平台是市场的一部分而不是普遍可用的服务?
  2. 识别平台似乎是 Cloud Identity 的一个子集,为什么?
  3. 在什么情况下我应该选择哪种服务?
  4. 如果我决定使用 Identity Platform 而不是 Firebase Auth,这会影响 Firestore 规则的执行方式吗?因为 Firestore 规则依赖于 Firebase Auth
  5. 这些身份验证系统中的任何一个都可以跨项目共享吗?例如,我正在将各种业务目标构建到根据项目分组的功能中。我希望 1 个身份验证机制可以在所有这些项目中工作,以使用 JWT 令牌保护 API 请求,确保如果每个项目都有自己的 Firestore 数据库,Firestore 规则仍然可以有效使用,客户端 SDK 的安全访问以访问 Bigtable 或 Bigquery 等数据库产品,以及提供对前端应用程序的访问。

如果您需要了解我的用例,我基本上是在构建一个模块化企业应用程序,供我公司用于我们的建筑项目。

谢谢大家!

firebase google-cloud-platform firebase-authentication google-cloud-identity

5
推荐指数
1
解决办法
509
查看次数