API: Document x-api-key header auth
This commit is contained in:
parent
6e4c9b2405
commit
3432829c91
|
@ -36,12 +36,20 @@ tags:
|
||||||
- name: user
|
- name: user
|
||||||
description: User information
|
description: User information
|
||||||
|
|
||||||
|
security:
|
||||||
|
- bearer-auth: [ ]
|
||||||
|
- api-key-header: [ ]
|
||||||
|
|
||||||
components:
|
components:
|
||||||
securitySchemes:
|
securitySchemes:
|
||||||
bearerAuth:
|
bearer-auth:
|
||||||
type: http
|
type: http
|
||||||
scheme: bearer
|
scheme: bearer
|
||||||
bearerFormat: API key from settings
|
bearerFormat: API key from settings
|
||||||
|
api-key-header:
|
||||||
|
type: apiKey
|
||||||
|
name: x-api-key
|
||||||
|
in: header
|
||||||
|
|
||||||
responses:
|
responses:
|
||||||
UnauthorizedError: # 401
|
UnauthorizedError: # 401
|
||||||
|
@ -421,9 +429,6 @@ components:
|
||||||
- event
|
- event
|
||||||
- teardown
|
- teardown
|
||||||
|
|
||||||
security:
|
|
||||||
- bearerAuth: [ ]
|
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
/angeltypes:
|
/angeltypes:
|
||||||
get:
|
get:
|
||||||
|
|
|
@ -87,7 +87,7 @@ class IndexController extends ApiController
|
||||||
return $this->response
|
return $this->response
|
||||||
->setStatusCode(200)
|
->setStatusCode(200)
|
||||||
->withHeader('allow', 'OPTIONS, HEAD, GET')
|
->withHeader('allow', 'OPTIONS, HEAD, GET')
|
||||||
->withHeader('access-control-allow-headers', 'Authorization');
|
->withHeader('access-control-allow-headers', 'Authorization, x-api-key');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function notFound(): Response
|
public function notFound(): Response
|
||||||
|
|
Loading…
Reference in New Issue