MCPcopy Create free account
hub / github.com/OneSignal/onesignal-node-api / OrganizationApiKeyAuthentication

Class OrganizationApiKeyAuthentication

auth/auth.ts:30–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 * Applies http authentication to the request context.
29 */
30export class OrganizationApiKeyAuthentication implements SecurityAuthentication {
31 /**
32 * Configures the http authentication with the required details.
33 *
34 * @param tokenProvider service that can provide the up-to-date token when needed
35 */
36 public constructor(private tokenProvider: TokenProvider) {}
37
38 public getName(): string {
39 return "organization_api_key";
40 }
41
42 public async applySecurityAuthentication(context: RequestContext) {
43 context.setHeaderParam("Authorization", "Key " + await this.tokenProvider.getToken());
44 }
45}
46
47/**
48 * Applies http authentication to the request context.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected