Skip to content

Commit

Permalink
fixup! chore(binding-http): enable eslint/strict-boolean-expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Oct 3, 2023
1 parent 8437745 commit 7a0bd02
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/binding-http/src/http-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@ export default class HttpServer implements ProtocolServer {
}

private fillSecurityScheme(thing: ExposedThing) {
const security = thing.security;
if (typeof security === "string") {
thing.security = [security];
}

// User selected one security scheme
if (thing.security.length > 0) {
// multiple security schemes are deprecated we are not supporting them
Expand Down Expand Up @@ -561,7 +566,8 @@ export default class HttpServer implements ProtocolServer {
return;
}

// The user let the servient choose the security scheme
// The security array is empty – the user lets the servient choose the
// security scheme.
if (Object.keys(thing.securityDefinitions ?? {}).length === 0) {
// We are using the first supported security scheme as default
thing.securityDefinitions = {
Expand Down

0 comments on commit 7a0bd02

Please sign in to comment.