| 28 | * Applies http authentication to the request context. |
| 29 | */ |
| 30 | export 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. |
nothing calls this directly
no outgoing calls
no test coverage detected