mirror of
https://github.com/LukeHagar/OpenAPI.gg.git
synced 2025-12-07 12:37:46 +00:00
add authentication tab
This commit is contained in:
71
src/lib/authTemplates.ts
Normal file
71
src/lib/authTemplates.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import type {
|
||||
ApiKeyAuth,
|
||||
BasicAuth,
|
||||
BearerAuth,
|
||||
CookieAuth,
|
||||
OAuth2Auth,
|
||||
OpenIdConnectAuth
|
||||
} from './types/auth';
|
||||
|
||||
export const basicAuthTemplate: BasicAuth = {
|
||||
identifier: '',
|
||||
type: 'http',
|
||||
scheme: 'basic'
|
||||
};
|
||||
|
||||
export const bearerAuthTemplate: BearerAuth = {
|
||||
identifier: '',
|
||||
type: 'http',
|
||||
scheme: 'bearer',
|
||||
bearerFormat: ''
|
||||
};
|
||||
|
||||
export const apiKeyAuthTemplate: ApiKeyAuth = {
|
||||
identifier: '',
|
||||
type: 'apiKey',
|
||||
in: 'header',
|
||||
name: ''
|
||||
};
|
||||
|
||||
export const openIdAuthTemplate: OpenIdConnectAuth = {
|
||||
identifier: '',
|
||||
type: 'openIdConnect',
|
||||
openIdConnectUrl: ''
|
||||
};
|
||||
|
||||
export const oauth2AuthTemplate: OAuth2Auth = {
|
||||
identifier: '',
|
||||
type: 'oauth2',
|
||||
description: '',
|
||||
flows: []
|
||||
};
|
||||
|
||||
export const cookieAuthTemplate: CookieAuth = {
|
||||
identifier: '',
|
||||
type: 'apiKey',
|
||||
in: 'cookie',
|
||||
name: ''
|
||||
};
|
||||
|
||||
export const oauth2FlowTemplates = {
|
||||
authorizationCode: {
|
||||
name: 'authorizationCode',
|
||||
authorizationUrl: '',
|
||||
tokenUrl: '',
|
||||
scopes: []
|
||||
},
|
||||
implicit: {
|
||||
name: 'implicit',
|
||||
authorizationUrl: '',
|
||||
scopes: []
|
||||
},
|
||||
password: {
|
||||
name: 'password',
|
||||
tokenUrl: '',
|
||||
scopes: []
|
||||
},
|
||||
clientCredentials: {
|
||||
name: 'clientCredentials',
|
||||
tokenUrl: ''
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user