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

Class RestApiKeyAuthentication

auth/auth.ts:50–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 * Applies http authentication to the request context.
49 */
50export class RestApiKeyAuthentication implements SecurityAuthentication {
51 /**
52 * Configures the http authentication with the required details.
53 *
54 * @param tokenProvider service that can provide the up-to-date token when needed
55 */
56 public constructor(private tokenProvider: TokenProvider) {}
57
58 public getName(): string {
59 return "rest_api_key";
60 }
61
62 public async applySecurityAuthentication(context: RequestContext) {
63 context.setHeaderParam("Authorization", "Key " + await this.tokenProvider.getToken());
64 }
65}
66
67
68export type AuthMethods = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected