私は API Gateway を初めて使用します。strapi CMS をクラウド RUN のコンテナーとしてデプロイし、API Gateway の swagger を介して strapi API にアクセスしています。クラウド実行サービスには、すべてのユーザーに対して未認証を許可する権限があります。しかし、APIゲートウェイのURLにアクセスしようとすると、
{"statusCode":401,"error":"Unauthorized","message":"Invalid token."}
以下は、API ゲートウェイで公開した私の自慢です。どうぞよろしくお願いいたします。
swagger: '2.0'
info:
version: '1.0'
title: CMS Service
description: CMS API Service
contact: {}
host: www.example.com
basePath: /
securityDefinitions: {}
schemes:
- https
consumes:
- application/json
produces:
- application/json
x-google-backend:
address: https://CLOUD_RUN_URL
paths:
"/weblogin":
get:
description: Find all the weblogin's records
summary: Weblogin_GET
tags:
- Weblogin
operationId: Weblogin_GET
deprecated: false
produces:
- application/json
parameters:
- name: _limit
in: query
required: false
type: integer
format: int32
description: Maximum number of results possible
- name: _sort
in: query
required: false
type: string
description: Sort according to a specific field.
- name: _start
in: query
required: false
type: integer
format: int32
description: Skip a specific number of entries (especially useful for pagination)
- name: '='
in: query
required: false
type: string
description: Get entries that matches exactly your input
- name: _ne
in: query
required: false
type: string
description: Get records that are not equals to something
- name: _lt
in: query
required: false
type: string
description: Get record that are lower than a value
- name: _lte
in: query
required: false
type: string
description: Get records that are lower than or equal to a value
- name: _gt
in: query
required: false
type: string
description: Get records that are greater than a value
- name: _gte
in: query
required: false
type: string
description: Get records that are greater than or equal a value
- name: _contains
in: query
required: false
type: string
description: Get records that contains a value
- name: _containss
in: query
required: false
type: string
description: Get records that contains (case sensitive) a value
- name: _in
in: query
required: false
type: array
items:
type: string
description: Get records that matches any value in the array of values
- name: _nin
in: query
required: false
type: array
items:
type: string
description: Get records that doesn't match any value in the array of values
responses:
'200':
description: Retrieve weblogin document(s)
schema:
type: array
items:
$ref: '#/definitions/Weblogin'
headers: {}
'403':
description: Forbidden
schema:
$ref: '#/definitions/Error'
headers: {}
'404':
description: Not found
schema:
$ref: '#/definitions/Error'
headers: {}
default:
description: unexpected error
schema:
$ref: '#/definitions/Error'
headers: {}
put:
description: Update a single weblogin record
summary: Weblogin_PUT
tags:
- Weblogin
operationId: Weblogin_PUT
deprecated: false
produces:
- application/json
consumes:
- application/json
parameters:
- name: body
in: body
required: true
description: ''
schema:
$ref: '#/definitions/NewWeblogin'
responses:
'200':
description: Retrieve weblogin document(s)
schema:
$ref: '#/definitions/Weblogin'
headers: {}
'403':
description: Forbidden
schema:
$ref: '#/definitions/Error'
headers: {}
'404':
description: Not found
schema:
$ref: '#/definitions/Error'
headers: {}
default:
description: unexpected error
schema:
$ref: '#/definitions/Error'
headers: {}
delete:
description: Delete a single weblogin record
summary: Weblogin_DELETE
tags:
- Weblogin
operationId: Weblogin_DELETE
deprecated: false
produces:
- application/json
parameters: []
responses:
'200':
description: deletes a single weblogin based on the ID supplied
schema:
type: integer
format: int64
headers: {}
'403':
description: Forbidden
schema:
$ref: '#/definitions/Error'
headers: {}
'404':
description: Not found
schema:
$ref: '#/definitions/Error'
headers: {}
default:
description: unexpected error
schema:
$ref: '#/definitions/Error'
headers: {}
definitions:
Weblogin:
title: Weblogin
type: object
properties:
id:
type: string
emaillabel:
type: string
passwordlabel:
type: string
remembermelabel:
type: string
forgotpasswordlabel:
type: string
noaccountlabel:
type: string
localizations:
type: array
items:
$ref: '#/definitions/Localization4'
locale:
type: string
published_at:
type: string
format: date-time
required:
- id
NewWeblogin:
title: NewWeblogin
type: object
properties:
emaillabel:
type: string
passwordlabel:
type: string
remembermelabel:
type: string
forgotpasswordlabel:
type: string
noaccountlabel:
type: string
localizations:
type: array
items:
type: string
locale:
type: string
published_at:
type: string
format: date-time
created_by:
type: string
updated_by:
type: string
Error:
title: Error
type: object
properties:
code:
type: integer
format: int32
message:
type: string
required:
- code
- message
Localization4:
title: Localization4
type: object
properties:
id:
type: string
emaillabel:
type: string
passwordlabel:
type: string
remembermelabel:
type: string
forgotpasswordlabel:
type: string
noaccountlabel:
type: string
localizations:
type: array
items:
type: string
locale:
type: string
published_at:
type: string
created_by:
type: string
updated_by:
type: string
required:
- id
tags:
- name: Consumerregister
- name: Mmlanding
- name: Mmlogin
- name: Serviceproviderregister
- name: Weblogin
- name: Email - Email
- name: Upload - File
- name: UsersPermissions - Role
- name: UsersPermissions - User
externalDocs:
url: 'https://strapi.io/documentation/developer-docs/latest/getting-started/introduction.html'
description: Find out more