diff --git a/.gitignore b/.gitignore index 6635cf5..6fa1a25 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ node_modules !.env.example vite.config.js.timestamp-* vite.config.ts.timestamp-* + +.vercel diff --git a/src/lib/authTemplates.ts b/src/lib/authTemplates.ts new file mode 100644 index 0000000..e839010 --- /dev/null +++ b/src/lib/authTemplates.ts @@ -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: '' + } +}; diff --git a/src/lib/components/atoms/AuthenticationItem.svelte b/src/lib/components/atoms/AuthenticationItem.svelte new file mode 100644 index 0000000..bd1d717 --- /dev/null +++ b/src/lib/components/atoms/AuthenticationItem.svelte @@ -0,0 +1,154 @@ + + +
+
+ {#if data.type == 'http' && data.scheme == 'basic'} +

Basic Auth

+

Basic authentication is a simple authentication scheme built into the HTTP protocol.

+ + {:else if data.type == 'http' && data.scheme == 'bearer'} +

Bearer Auth

+

Basic authentication is a simple authentication scheme built into the HTTP protocol.

+ + + {:else if data.type == 'apiKey' && data.in == 'header'} + +

API Key

+ + + + {:else if data.type == 'openIdConnect'} +

OpenID

+ + + {:else if data.type == 'oauth2'} +

OAuth2

+ +