auth-backend: move CookieConfigurer to auth-node
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -24,6 +24,7 @@ import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
AuthResolverCatalogUserQuery as _AuthResolverCatalogUserQuery,
|
||||
AuthResolverContext as _AuthResolverContext,
|
||||
CookieConfigurer as _CookieConfigurer,
|
||||
ProfileInfo as _ProfileInfo,
|
||||
} from '@backstage/plugin-auth-node';
|
||||
import { OAuthStartRequest } from '../lib/oauth/types';
|
||||
@@ -41,24 +42,10 @@ export type AuthResolverCatalogUserQuery = _AuthResolverCatalogUserQuery;
|
||||
export type AuthResolverContext = _AuthResolverContext;
|
||||
|
||||
/**
|
||||
* The callback used to resolve the cookie configuration for auth providers that use cookies.
|
||||
* @public
|
||||
* @deprecated import from `@backstage/plugin-auth-node` instead
|
||||
*/
|
||||
export type CookieConfigurer = (ctx: {
|
||||
/** ID of the auth provider that this configuration applies to */
|
||||
providerId: string;
|
||||
/** The externally reachable base URL of the auth-backend plugin */
|
||||
baseUrl: string;
|
||||
/** The configured callback URL of the auth provider */
|
||||
callbackUrl: string;
|
||||
/** The origin URL of the app */
|
||||
appOrigin: string;
|
||||
}) => {
|
||||
domain: string;
|
||||
path: string;
|
||||
secure: boolean;
|
||||
sameSite?: 'none' | 'lax' | 'strict';
|
||||
};
|
||||
export type CookieConfigurer = _CookieConfigurer;
|
||||
|
||||
/** @public */
|
||||
export type AuthProviderConfig = {
|
||||
|
||||
@@ -31,6 +31,7 @@ export type {
|
||||
BackstageIdentityResponse,
|
||||
BackstageSignInResult,
|
||||
BackstageUserIdentity,
|
||||
CookieConfigurer,
|
||||
IdentityApiGetIdentityRequest,
|
||||
ProfileInfo,
|
||||
TokenParams,
|
||||
|
||||
@@ -189,3 +189,23 @@ export type ProfileInfo = {
|
||||
*/
|
||||
picture?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* The callback used to resolve the cookie configuration for auth providers that use cookies.
|
||||
* @public
|
||||
*/
|
||||
export type CookieConfigurer = (ctx: {
|
||||
/** ID of the auth provider that this configuration applies to */
|
||||
providerId: string;
|
||||
/** The externally reachable base URL of the auth-backend plugin */
|
||||
baseUrl: string;
|
||||
/** The configured callback URL of the auth provider */
|
||||
callbackUrl: string;
|
||||
/** The origin URL of the app */
|
||||
appOrigin: string;
|
||||
}) => {
|
||||
domain: string;
|
||||
path: string;
|
||||
secure: boolean;
|
||||
sameSite?: 'none' | 'lax' | 'strict';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user