Skip to content

Commit

Permalink
implement MultipleAuthentication.getCookie
Browse files Browse the repository at this point in the history
Signed-off-by: merlinz01 <na@notaccessible.xyz>
  • Loading branch information
merlinz01 committed Sep 2, 2024
1 parent d22df75 commit 6f2a181
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/auth/types/multiple/multi_auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,22 @@ export class MultipleAuthentication extends AuthenticationType {
return await this.authHandlers.get(reqAuthType)!.getAdditionalAuthHeader(request);
} else {
const authHeaders: any = {};
for (const key of this.authHandlers.keys()) {
for (const handler of this.authHandlers.values()) {
Object.assign(
authHeaders,
await this.authHandlers.get(key)!.getAdditionalAuthHeader(request)
await handler.getAdditionalAuthHeader(request)
);
}
return authHeaders;
}
}

getCookie(request: OpenSearchDashboardsRequest, authInfo: any): SecuritySessionCookie {
for (const handler of this.authHandlers.values()) {
if (handler.requestIncludesAuthInfo(request)) {
return handler.getCookie(request, authInfo);
}
}
return {};
}

Expand Down

0 comments on commit 6f2a181

Please sign in to comment.