Skip to content

Commit

Permalink
Adds types for securityDefinitions, securitySchemes, and scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
xsalazar committed Jul 23, 2021
1 parent 749dc64 commit 6ae7fa0
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions index.d.ts
Expand Up @@ -61,6 +61,57 @@ declare namespace hapiswagger {

type UiCompleteScriptType = string | UiCompleteScriptObjectType

type ScopesType = {
[scope: string]: string | any;
}

type SecuritySchemeType = {
/**
* The authorization URL to be used for this flow. This SHOULD be in the form of a URL. REQUIRED for `type` "oauth2", and `flow` "implicit" or "accessCode"
*/
authorizationUrl?: string;

/**
* A short description for security scheme.
*/
description?: string;

/**
* The flow used by the OAuth2 security scheme. Valid values are "implicit", "password", "application" or "accessCode". REQUIRED for `type` "oauth2"
*/
flow?: string;

/**
* The location of the API key. Valid values are "query" or "header". REQUIRED for `type` "apiKey"
*/
in?: string;

/**
* The name of the header or query parameter to be used. REQUIRED for `type` "apiKey"
*/
name?: string;

/**
* The available scopes for the OAuth2 security scheme. REQUIRED for `type` "oauth2"
*/
scopes?: ScopesType;

/**
* The token URL to be used for this flow. This SHOULD be in the form of a URL. REQUIRED for `type` "oauth2", and `flow` "password", "application", or "accessCode"
*/
tokenUrl?: string;

/**
* The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
*/
type: string;

/**
* Any property or object with a key starting with `x-*` is included in the Swagger definition (similar to `x-*` options in the `info` object).
*/
[key: string]: any;
}

interface LicenseOptions {
/**
* The name of the license used for the API
Expand Down Expand Up @@ -383,6 +434,11 @@ declare namespace hapiswagger {
* @default false
*/
tryItOutEnabled?: boolean;

/**
* A declaration of the security schemes available to be used in the specification. This does not enforce the security schemes on the operations and only serves to provide the relevant details for each scheme.
*/
securityDefinitions?: {[name: string]: SecuritySchemeType}
}
}

Expand Down

0 comments on commit 6ae7fa0

Please sign in to comment.