UNPKG

@autorest/modelerfour

Version:
47 lines 1.51 kB
import { Security } from "@autorest/codemodel"; import { Session } from "@autorest/extension-base"; import * as oai3 from "@azure-tools/openapi"; import { Interpretations } from "./interpretations"; export declare enum KnownSecurityScheme { AADToken = "AADToken", AzureKey = "AzureKey", Anonymous = "Anonymous" } export interface SecurityConfiguration { azureArm: boolean; security: KnownSecurityScheme[]; scopes: string[]; headerName: string; } /** * Body processing functions */ export declare class SecurityProcessor { private session; private interpret; private securityConfig; constructor(session: Session<oai3.Model>, interpret: Interpretations); init(): Promise<this>; /** * Process the security definition defined in OpenAPI */ process(openApiModel: oai3.Model): Security; private getSecurityForAzureArm; /** * Build the security object from the autorest configuration */ private getSecurityFromConfig; /** * @param name Name of the security scheme * @returns CodeModel security scheme with given name, undefined if this is anonymous security and throw an error if unknown. */ private getSecuritySchemeFromConfig; /** * Build the security object from the OpenAPI spec. */ private getSecurityFromOpenAPISpec; private resolveOpenAPI3SecuritySchemes; private processSecurityScheme; private getSecurityConfig; } //# sourceMappingURL=security-processor.d.ts.map