Fix authenticate() ctx properties being missing
This was broken because the return value of `initialize()` was a `Promise<...>` but its caller wasn't `await`-ing the value. This was causing the `gcpIap` provider to fail on the `/request` endpoint because `jwtHeader` was undefined. The OAuth equivalent keeps `initialize()` synchronous, and all implementations don't _need_ to be `async`, so make them synchronous instead. I've chosen the changelog to be a `major` bump since this changes the API of a public type. Signed-off-by: Mitchell Hentges <mhentges@spotify.com>
This commit is contained in:
@@ -550,7 +550,7 @@ export interface ProxyAuthenticator<TContext, TResult> {
|
||||
// (undocumented)
|
||||
defaultProfileTransform: ProfileTransform<TResult>;
|
||||
// (undocumented)
|
||||
initialize(ctx: { config: Config }): Promise<TContext>;
|
||||
initialize(ctx: { config: Config }): TContext;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
|
||||
@@ -21,7 +21,7 @@ import { ProfileTransform } from '../types';
|
||||
/** @public */
|
||||
export interface ProxyAuthenticator<TContext, TResult> {
|
||||
defaultProfileTransform: ProfileTransform<TResult>;
|
||||
initialize(ctx: { config: Config }): Promise<TContext>;
|
||||
initialize(ctx: { config: Config }): TContext;
|
||||
authenticate(
|
||||
options: { req: Request },
|
||||
ctx: TContext,
|
||||
|
||||
Reference in New Issue
Block a user