resolve rebase type/compilation errors
Signed-off-by: Ruben Vallejo <rvallejo@vmware.com>
This commit is contained in:
@@ -20,11 +20,10 @@ import {
|
||||
encodeState,
|
||||
readState,
|
||||
} from '../../lib/oauth';
|
||||
import { PinnipedAuthProvider, PinnipedOptions } from './provider';
|
||||
import { PinnipedAuthProvider, PinnipedProviderOptions } from './provider';
|
||||
import { setupServer } from 'msw/node';
|
||||
import { rest } from 'msw';
|
||||
import express from 'express';
|
||||
import { UnsecuredJWT } from 'jose';
|
||||
import { OAuthState } from '../../lib/oauth';
|
||||
import { Server } from 'http';
|
||||
import cookieParser from 'cookie-parser';
|
||||
@@ -37,7 +36,13 @@ import { AuthProviderRouteHandlers } from '../types';
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { AddressInfo } from 'net';
|
||||
import request from 'supertest';
|
||||
import { SignJWT, exportJWK, generateKeyPair, importJWK } from 'jose';
|
||||
import {
|
||||
SignJWT,
|
||||
exportJWK,
|
||||
generateKeyPair,
|
||||
importJWK,
|
||||
UnsecuredJWT,
|
||||
} from 'jose';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
describe('PinnipedAuthProvider', () => {
|
||||
@@ -74,7 +79,7 @@ describe('PinnipedAuthProvider', () => {
|
||||
request_object_signing_alg_values_supported: ['RS256', 'RS512', 'HS256'],
|
||||
};
|
||||
|
||||
const clientMetadata: PinnipedOptions = {
|
||||
const clientMetadata: PinnipedProviderOptions = {
|
||||
federationDomain: 'https://federationDomain.test',
|
||||
clientId: 'clientId',
|
||||
clientSecret: 'secret',
|
||||
@@ -462,6 +467,9 @@ describe('PinnipedAuthProvider', () => {
|
||||
}),
|
||||
signInWithCatalogUser: async _ => ({ token: '' }),
|
||||
},
|
||||
baseUrl: `${appUrl}/api/auth`,
|
||||
appUrl,
|
||||
isOriginAllowed: _ => true,
|
||||
});
|
||||
const router = Router();
|
||||
router
|
||||
|
||||
@@ -43,7 +43,7 @@ type PrivateInfo = {
|
||||
refreshToken?: string;
|
||||
};
|
||||
|
||||
export type PinnipedOptions = OAuthProviderOptions & {
|
||||
export type PinnipedProviderOptions = OAuthProviderOptions & {
|
||||
federationDomain: string;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
@@ -55,7 +55,7 @@ export type PinnipedOptions = OAuthProviderOptions & {
|
||||
export class PinnipedAuthProvider implements OAuthHandlers {
|
||||
private readonly implementation: Promise<OidcImpl>;
|
||||
|
||||
constructor(options: PinnipedOptions) {
|
||||
constructor(options: PinnipedProviderOptions) {
|
||||
this.implementation = this.setupStrategy(options);
|
||||
}
|
||||
|
||||
@@ -157,7 +157,9 @@ export class PinnipedAuthProvider implements OAuthHandlers {
|
||||
});
|
||||
}
|
||||
|
||||
private async setupStrategy(options: PinnipedOptions): Promise<OidcImpl> {
|
||||
private async setupStrategy(
|
||||
options: PinnipedProviderOptions,
|
||||
): Promise<OidcImpl> {
|
||||
const issuer = await Issuer.discover(
|
||||
`${options.federationDomain}/.well-known/openid-configuration`,
|
||||
);
|
||||
|
||||
@@ -29,6 +29,7 @@ export type OAuthState = {
|
||||
scope?: string;
|
||||
redirectUrl?: string;
|
||||
flow?: string;
|
||||
audience?: string;
|
||||
};
|
||||
|
||||
/** @public */
|
||||
|
||||
Reference in New Issue
Block a user