auth-node: move identity related modules to identity dir
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ import { setupServer } from 'msw/node';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
import { DefaultIdentityClient } from './DefaultIdentityClient';
|
||||
import { IdentityApiGetIdentityRequest } from './types';
|
||||
import { IdentityApiGetIdentityRequest } from './IdentityApi';
|
||||
|
||||
interface AnyJWK extends Record<string, string> {
|
||||
use: 'sig';
|
||||
+2
-5
@@ -25,12 +25,9 @@ import {
|
||||
jwtVerify,
|
||||
} from 'jose';
|
||||
import { GetKeyFunction } from 'jose/dist/types/types';
|
||||
import {
|
||||
BackstageIdentityResponse,
|
||||
IdentityApiGetIdentityRequest,
|
||||
} from './types';
|
||||
import { getBearerTokenFromAuthorizationHeader } from './getBearerTokenFromAuthorizationHeader';
|
||||
import { IdentityApi } from './IdentityApi';
|
||||
import { IdentityApi, IdentityApiGetIdentityRequest } from './IdentityApi';
|
||||
import { BackstageIdentityResponse } from '../types';
|
||||
|
||||
const CLOCK_MARGIN_S = 10;
|
||||
|
||||
+12
-4
@@ -13,10 +13,18 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {
|
||||
BackstageIdentityResponse,
|
||||
IdentityApiGetIdentityRequest,
|
||||
} from './types';
|
||||
|
||||
import { Request } from 'express';
|
||||
import { BackstageIdentityResponse } from '../types';
|
||||
|
||||
/**
|
||||
* Options to request the identity from a Backstage backend request
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type IdentityApiGetIdentityRequest = {
|
||||
request: Request<unknown>;
|
||||
};
|
||||
|
||||
/**
|
||||
* An identity client api to authenticate Backstage
|
||||
+1
-1
@@ -18,7 +18,7 @@ import {
|
||||
DefaultIdentityClient,
|
||||
IdentityClientOptions,
|
||||
} from './DefaultIdentityClient';
|
||||
import { BackstageIdentityResponse } from './types';
|
||||
import { BackstageIdentityResponse } from '../types';
|
||||
|
||||
/**
|
||||
* An identity client to interact with auth-backend and authenticate Backstage
|
||||
@@ -15,3 +15,10 @@
|
||||
*/
|
||||
|
||||
export { prepareBackstageIdentityResponse } from './prepareBackstageIdentityResponse';
|
||||
export { getBearerTokenFromAuthorizationHeader } from './getBearerTokenFromAuthorizationHeader';
|
||||
export {
|
||||
DefaultIdentityClient,
|
||||
type IdentityClientOptions,
|
||||
} from './DefaultIdentityClient';
|
||||
export { IdentityClient } from './IdentityClient';
|
||||
export type { IdentityApi } from './IdentityApi';
|
||||
|
||||
@@ -23,11 +23,6 @@
|
||||
export * from './flow';
|
||||
export * from './identity';
|
||||
export * from './passport';
|
||||
export { getBearerTokenFromAuthorizationHeader } from './getBearerTokenFromAuthorizationHeader';
|
||||
export { DefaultIdentityClient } from './DefaultIdentityClient';
|
||||
export { IdentityClient } from './IdentityClient';
|
||||
export type { IdentityApi } from './IdentityApi';
|
||||
export type { IdentityClientOptions } from './DefaultIdentityClient';
|
||||
export type {
|
||||
AuthProviderConfig,
|
||||
AuthProviderRouteHandlers,
|
||||
@@ -39,7 +34,6 @@ export type {
|
||||
BackstageUserIdentity,
|
||||
ClientAuthResponse,
|
||||
CookieConfigurer,
|
||||
IdentityApiGetIdentityRequest,
|
||||
ProfileInfo,
|
||||
SignInInfo,
|
||||
SignInResolver,
|
||||
|
||||
@@ -36,15 +36,6 @@ export interface BackstageSignInResult {
|
||||
token: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options to request the identity from a Backstage backend request
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type IdentityApiGetIdentityRequest = {
|
||||
request: Request<unknown>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Response object containing the {@link BackstageUserIdentity} and the token
|
||||
* from the authentication provider.
|
||||
|
||||
Reference in New Issue
Block a user