evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a TypeScript utility that analyzes security scheme definitions from OpenAPI 2.0 (Swagger) specification documents.
Create a module that exports functions to:
All function parameters should be properly typed using OpenAPI 2.0 type definitions to ensure type safety.
/**
* Checks if a security scheme is basic authentication type
*/
export function isBasicAuth(scheme: unknown): boolean;
/**
* Gets the location (in) of an API key security scheme
* Returns undefined if not an API key scheme
*/
export function getApiKeyLocation(scheme: unknown): string | undefined;
/**
* Gets the OAuth2 flow type
* Returns undefined if not an OAuth2 scheme
*/
export function getOAuth2Flow(scheme: unknown): string | undefined;
/**
* Extracts all security scheme names from a security requirement object
*/
export function getSchemeNames(requirement: unknown): string[];Provides TypeScript type definitions for OpenAPI 2.0 security schemes.