抱歉,我不知道我是否应该在这里提问。我使用了echo
示例项目和
将其部署到google cloud endpoints
,我想使用firebase auth
而不是api key
对其进行配置。以下是openapi.yaml
paths:
"/echo":
post:
description: "Echo back a given message."
operationId: "echo"
produces:
- "application/json"
responses:
200:
description: "Echo"
schema:
$ref: "#/definitions/echoMessage"
parameters:
- description: "Message to echo"
in: body
name: message
required: true
schema:
$ref: "#/definitions/echoMessage"
security:
- firebase: []
当我部署它并使用
访问时curl -d '{"message":"hello world"}' -H "content-
type:application/json""http://[IPADDRESS]:80/echo"
我收到错误消息。
"message": "Method doesn't allow unregistered callers (callers without
established identity). Please use API Key or other form of API consumer
identity to call this API.",
如果我添加api密钥。
curl -d '{"message":"hello world"}' -H "content-type:application/json""http://35.194.225.89:80/echo?api_key=[API_KEY]"
我可以得到正确的结果。
我不确定如何配置openapi.yaml
,请帮忙。非常感谢你。