@scalar/api-client
Version:
the open source API testing client
25 lines • 1.47 kB
TypeScript
import { type XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
import type { SecurityRequirementObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
import type { MergedSecuritySchemes } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/merge-security.js';
import type { SecuritySchemeObjectSecret } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
/**
* Get the selected security schemes from security requirements.
* Takes security requirement objects and resolves them to actual security scheme objects.
*/
export declare const getSecuritySchemes: (securitySchemes: MergedSecuritySchemes, selectedSecurity: SecurityRequirementObject[]) => SecuritySchemeObjectSecret[];
/**
* Generates the headers, cookies and query params for selected security schemes
* In the future we can add customization for where the security is applied
*/
export declare const buildRequestSecurity: (
/** Currently selected security for the current operation */
selectedSecuritySchemes: SecuritySchemeObjectSecret[],
/** Environment variables flattened into a key-value object */
env?: Record<string, string>,
/** Include this parameter to set the placeholder for empty tokens */
emptyTokenPlaceholder?: string) => {
headers: Record<string, string>;
cookies: XScalarCookie[];
urlParams: URLSearchParams;
};
//# sourceMappingURL=build-request-security.d.ts.map