/** * Extracts security scheme information from OpenAPI 2.0/3.x documents. * Converts security definitions to a normalized internal format. */ import { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from 'openapi-types'; /** * Security scheme configuration options. * * Provides a normalized representation of security schemes from OpenAPI documents, * supporting both OpenAPI 3.x securitySchemes and Swagger 2.0 securityDefinitions. * This interface is used by generators to configure authentication in generated code. */ export interface SecuritySchemeOptions { /** The name/key of the security scheme as defined in the spec */ name: string; /** Security scheme type */ type: 'apiKey' | 'http' | 'oauth2' | 'openIdConnect'; /** For apiKey type: the name of the key parameter */ apiKeyName?: string; /** For apiKey type: where to place the key */ apiKeyIn?: 'header' | 'query' | 'cookie'; /** For http type: the authentication scheme (bearer, basic, etc.) */ httpScheme?: 'bearer' | 'basic' | string; /** For http bearer: the format of the bearer token */ bearerFormat?: string; /** For oauth2 type: the available flows */ oauth2Flows?: { implicit?: { authorizationUrl: string; scopes: Record; }; password?: { tokenUrl: string; scopes: Record; }; clientCredentials?: { tokenUrl: string; scopes: Record; }; authorizationCode?: { authorizationUrl: string; tokenUrl: string; scopes: Record; }; }; /** For openIdConnect type: the OpenID Connect discovery URL */ openIdConnectUrl?: string; } type OpenAPIDocument = OpenAPIV3.Document | OpenAPIV2.Document | OpenAPIV3_1.Document; /** * Extracts security schemes from an OpenAPI document. * Handles both OpenAPI 3.x (components.securitySchemes) and * Swagger 2.0 (securityDefinitions) formats. */ export declare function extractSecuritySchemes(document: OpenAPIDocument): SecuritySchemeOptions[]; export {};