Skip to content

resolveOAuth2Requirement

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/packages/ui-core/src/components/api-explorer/oauth2.ts

Which OAuth2 scheme — and which scopes — this operation demands.

security is an OR of alternatives, each an AND of schemes. We take the first alternative naming a scheme we can run, which is the one a reader would be steered towards anyway. An operation declaring no security of its own inherits the document default; security: [] is explicitly public and inherits nothing.

Signature

ts
function resolveOAuth2Requirement(endpointSecurity: Array<Record<string, string[]>> | undefined, documentSecurity: Array<Record<string, string[]>> | undefined, schemes: OAuth2Scheme[]): OAuth2Requirement | null

Parameters

NameType
endpointSecurity`Array<Record<string, string[]>>
documentSecurity`Array<Record<string, string[]>>
schemesOAuth2Scheme[]

Returns: OAuth2Requirement | null

Was this page helpful?

Download as PDF