MCPcopy Create free account
hub / github.com/Effect-TS/effect / processHttpApiSecurity

Function processHttpApiSecurity

packages/effect/src/unstable/httpapi/OpenApi.ts:539–556  ·  view source on GitHub ↗
(
        name: string,
        security: HttpApiSecurity
      )

Source from the content-addressed store, hash-verified

537 })
538
539 function processHttpApiSecurity(
540 name: string,
541 security: HttpApiSecurity
542 ) {
543 const scheme = makeSecurityScheme(security)
544 if (!Object.hasOwn(spec.components.securitySchemes, name)) {
545 InternalRecord.assignProperty(spec.components.securitySchemes, name, scheme)
546 return
547 }
548 if (
549 !Equal.equals(
550 securitySchemeForComparison(spec.components.securitySchemes[name]),
551 securitySchemeForComparison(scheme)
552 )
553 ) {
554 throw new globalThis.Error(`Conflicting OpenAPI security scheme: ${name}`)
555 }
556 }
557
558 const hasBody = HttpMethod.hasBody(endpoint.method)
559 if (hasBody) {

Callers 1

onEndpointFunction · 0.85

Calls 3

makeSecuritySchemeFunction · 0.85
equalsMethod · 0.80

Tested by

no test coverage detected