feat: allow overriding default ownership resolving
This allows to modify the ownership resolving in the auth resolve context. For example if user wants to include parent groups also to the ownershipEntityRefs, it's not possible unless the built-in auth providers are forked and rewritten. Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
@@ -21,6 +21,12 @@ import { Strategy } from 'passport';
|
||||
import { ZodSchema } from 'zod';
|
||||
import { ZodTypeDef } from 'zod';
|
||||
|
||||
// @public
|
||||
export interface AuthOwnershipResolver {
|
||||
// (undocumented)
|
||||
getOwnershipEntityRefs(entity: Entity): Promise<string[]>;
|
||||
}
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type AuthProviderConfig = {
|
||||
baseUrl: string;
|
||||
|
||||
@@ -43,5 +43,6 @@ export type {
|
||||
SignInInfo,
|
||||
SignInResolver,
|
||||
TokenParams,
|
||||
AuthOwnershipResolver,
|
||||
} from './types';
|
||||
export { tokenTypes } from './types';
|
||||
|
||||
@@ -163,6 +163,15 @@ export type AuthResolverContext = {
|
||||
): Promise<BackstageSignInResult>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Resolver interface for resolving the ownership entity references for entity
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface AuthOwnershipResolver {
|
||||
getOwnershipEntityRefs(entity: Entity): Promise<string[]>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Any Auth provider needs to implement this interface which handles the routes in the
|
||||
* auth backend. Any auth API requests from the frontend reaches these methods.
|
||||
|
||||
Reference in New Issue
Block a user