Skip to content

Commit d293c04

Browse files
nit
1 parent 38a49bc commit d293c04

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

docs/api-reference/sourcebot-public.openapi.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
],
3030
"security": [
3131
{
32-
"bearerAuth": []
32+
"bearerToken": []
3333
},
3434
{
35-
"sourcebotApiKey": []
35+
"apiKeyHeader": []
3636
},
3737
{}
3838
],
@@ -759,16 +759,16 @@
759759
},
760760
"parameters": {},
761761
"securitySchemes": {
762-
"bearerAuth": {
762+
"bearerToken": {
763763
"type": "http",
764764
"scheme": "bearer",
765-
"description": "Send either a Sourcebot API key (`sbk_...` or legacy `sourcebot-...`) or, on EE instances with OAuth enabled, an OAuth access token (`sboa_...`) in the Authorization header."
765+
"description": "Send either a Sourcebot API key (`sbk_...`) or, on EE instances with OAuth enabled, an OAuth access token (`sboa_...`) in the Authorization header."
766766
},
767-
"sourcebotApiKey": {
767+
"apiKeyHeader": {
768768
"type": "apiKey",
769769
"in": "header",
770770
"name": "X-Sourcebot-Api-Key",
771-
"description": "Send a Sourcebot API key (`sbk_...` or legacy `sourcebot-...`) in the X-Sourcebot-Api-Key header."
771+
"description": "Send a Sourcebot API key (`sbk_...`) in the X-Sourcebot-Api-Key header."
772772
}
773773
}
774774
},

packages/web/src/openapi/publicApiDocument.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,22 @@ const publicGetTreeResponseSchema: SchemaObject = {
4848
additionalProperties: false,
4949
};
5050

51-
const securitySchemes: Record<string, SecuritySchemeObject> = {
52-
bearerAuth: {
51+
const securitySchemeNames = {
52+
bearerToken: 'bearerToken',
53+
apiKeyHeader: 'apiKeyHeader',
54+
} as const;
55+
56+
const securitySchemes: Record<keyof typeof securitySchemeNames, SecuritySchemeObject> = {
57+
[securitySchemeNames.bearerToken]: {
5358
type: 'http',
5459
scheme: 'bearer',
55-
description: 'Send either a Sourcebot API key (`sbk_...` or legacy `sourcebot-...`) or, on EE instances with OAuth enabled, an OAuth access token (`sboa_...`) in the Authorization header.',
60+
description: 'Send either a Sourcebot API key (`sbk_...`) or, on EE instances with OAuth enabled, an OAuth access token (`sboa_...`) in the Authorization header.',
5661
},
57-
sourcebotApiKey: {
62+
[securitySchemeNames.apiKeyHeader]: {
5863
type: 'apiKey',
5964
in: 'header',
6065
name: 'X-Sourcebot-Api-Key',
61-
description: 'Send a Sourcebot API key (`sbk_...` or legacy `sourcebot-...`) in the X-Sourcebot-Api-Key header.',
66+
description: 'Send a Sourcebot API key (`sbk_...`) in the X-Sourcebot-Api-Key header.',
6267
},
6368
};
6469

@@ -275,8 +280,8 @@ export function createPublicOpenApiDocument(version: string) {
275280
},
276281
tags: [searchTag, reposTag, filesTag, gitTag, miscTag],
277282
security: [
278-
{ bearerAuth: [] },
279-
{ sourcebotApiKey: [] },
283+
{ [securitySchemeNames.bearerToken]: [] },
284+
{ [securitySchemeNames.apiKeyHeader]: [] },
280285
{},
281286
],
282287
});

0 commit comments

Comments
 (0)