Selaa lähdekoodia

feat(access-token-parser): declare accessTokenHeaderAuth OpenAPI security scheme

Add the accessTokenHeaderAuth (apiKey/header/x-growi-access-token) security scheme to
the apiv1 and apiv3 OpenAPI definitions and to their top-level security arrays, while
retaining the existing bearer and accessTokenInQuery schemes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Yuki Takei 1 viikko sitten
vanhempi
sitoutus
dcd4e00b6d

+ 1 - 1
.kiro/specs/access-token-parser/tasks.md

@@ -29,7 +29,7 @@
   - _Depends: 1.1_
 
 - [ ] 3. Integration: OpenAPI advertisement of the header method
-- [ ] 3.1 (P) Declare the `accessTokenHeaderAuth` security scheme in the apiv1 and apiv3 definitions
+- [x] 3.1 (P) Declare the `accessTokenHeaderAuth` security scheme in the apiv1 and apiv3 definitions
   - Add an `apiKey` / `in: header` / `name: x-growi-access-token` scheme to the security schemes and to the top-level security array in both definition files
   - Independent of tasks 2.1/2.2 (separate boundary, no shared files), so it may run concurrently with the parser work
   - Observable: both definition files contain the new scheme while retaining the existing `bearer` and `accessTokenInQuery` schemes

+ 7 - 0
apps/app/bin/openapi/definition-apiv1.js

@@ -24,6 +24,7 @@ module.exports = {
   security: [
     {
       bearer: [],
+      accessTokenHeaderAuth: [],
       accessTokenInQuery: [],
     },
   ],
@@ -34,6 +35,12 @@ module.exports = {
         scheme: 'bearer',
         description: 'Access token generated by each GROWI users',
       },
+      accessTokenHeaderAuth: {
+        type: 'apiKey',
+        in: 'header',
+        name: 'x-growi-access-token',
+        description: 'Access token generated by each GROWI users',
+      },
       accessTokenInQuery: {
         type: 'apiKey',
         name: 'access_token',

+ 7 - 0
apps/app/bin/openapi/definition-apiv3.js

@@ -24,6 +24,7 @@ module.exports = {
   security: [
     {
       bearer: [],
+      accessTokenHeaderAuth: [],
       accessTokenInQuery: [],
     },
   ],
@@ -34,6 +35,12 @@ module.exports = {
         scheme: 'bearer',
         description: 'Access token generated by each GROWI users',
       },
+      accessTokenHeaderAuth: {
+        type: 'apiKey',
+        in: 'header',
+        name: 'x-growi-access-token',
+        description: 'Access token generated by each GROWI users',
+      },
       accessTokenInQuery: {
         type: 'apiKey',
         name: 'access_token',