import { Initializer, DeepPartial } from "@azure-tools/codegen"; import { Extensions } from "../common/extensions"; import { uri } from "../common/uri"; import { ParameterLocation } from "./parameter-location"; export declare enum Scheme { Bearer = "bearer" } export declare enum SecurityType { ApiKey = "apiKey", Http = "http", OAuth2 = "oauth2", OpenIDConnect = "openIdConnect" } export interface AuthorizationCodeOAuthFlow extends Extensions { authorizationUrl: uri; tokenUrl: uri; refreshUrl?: uri; scopes: Record; } export interface BearerHTTPSecurityScheme extends Extensions { scheme: Scheme.Bearer; bearerFormat?: string; type: SecurityType.Http; description?: string; } export interface ClientCredentialsFlow extends Extensions { tokenUrl: uri; refreshUrl?: uri; scopes: Record; } export interface ImplicitOAuthFlow extends Extensions { authorizationUrl: uri; refreshUrl?: uri; scopes: Record; } export interface NonBearerHTTPSecurityScheme extends Extensions { scheme: string; description?: string; type: SecurityType.Http; } export interface OAuth2SecurityScheme extends Extensions { type: SecurityType.OAuth2; flows: OAuthFlows; description?: string; } export interface OAuthFlows extends Extensions { implicit?: ImplicitOAuthFlow; password?: PasswordOAuthFlow; clientCredentials?: ClientCredentialsFlow; authorizationCode?: AuthorizationCodeOAuthFlow; } export type HTTPSecurityScheme = NonBearerHTTPSecurityScheme | BearerHTTPSecurityScheme; export type SecurityScheme = APIKeySecurityScheme | HTTPSecurityScheme | OAuth2SecurityScheme | OpenIdConnectSecurityScheme; export interface APIKeySecurityScheme extends Extensions { type: SecurityType.ApiKey; name: string; in: ParameterLocation; description?: string; } export declare class APIKeySecurityScheme extends Initializer implements APIKeySecurityScheme { name: string; constructor(name: string, inWhere: ParameterLocation, initializer?: DeepPartial); } export declare class BearerHTTPSecurityScheme extends Initializer implements BearerHTTPSecurityScheme { scheme: Scheme; constructor(initializer?: DeepPartial); } export declare class ImplicitOAuthFlow extends Initializer implements ImplicitOAuthFlow { authorizationUrl: string; scopes: Record; constructor(authorizationUrl: string, initializer?: DeepPartial); } export declare class NonBearerHTTPSecurityScheme extends Initializer implements NonBearerHTTPSecurityScheme { scheme: string; constructor(scheme: string, initializer?: DeepPartial); } export declare class OAuth2SecurityScheme extends Initializer implements OAuth2SecurityScheme { flows: OAuthFlows; constructor(flows: OAuthFlows, initializer?: DeepPartial); } export declare class OAuthFlows extends Initializer implements OAuthFlows { constructor(initializer?: DeepPartial); } export interface OpenIdConnectSecurityScheme extends Extensions { type: SecurityType.OpenIDConnect; openIdConnectUrl: uri; description?: string; } export declare class OpenIdConnectSecurityScheme extends Initializer implements OpenIdConnectSecurityScheme { openIdConnectUrl: string; constructor(openIdConnectUrl: string, initializer?: DeepPartial); } export interface PasswordOAuthFlow extends Extensions { tokenUrl: uri; refreshUrl?: uri; scopes: Record; } export declare class PasswordOAuthFlow extends Initializer implements PasswordOAuthFlow { tokenUrl: string; scopes: Record; constructor(tokenUrl: string, initializer?: DeepPartial); } export declare class AuthorizationCodeOAuthFlow extends Initializer implements AuthorizationCodeOAuthFlow { authorizationUrl: string; scopes: Record; constructor(authorizationUrl: string, tokenUrl: string, initializer?: DeepPartial); } export declare class ClientCredentialsFlow extends Initializer implements ClientCredentialsFlow { tokenUrl: string; scopes: Record; constructor(tokenUrl: string, initializer?: DeepPartial); } /** * @description common ways of serializing simple parameters * @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#style-values */ export interface SecurityRequirement extends Record { } //# sourceMappingURL=security.d.ts.map