fix: review comments and naming
Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
@@ -21,10 +21,21 @@ import { Strategy } from 'passport';
|
||||
import { ZodSchema } from 'zod';
|
||||
import { ZodTypeDef } from 'zod';
|
||||
|
||||
// @public (undocumented)
|
||||
export interface AuthOwnershipResolutionExtensionPoint {
|
||||
// (undocumented)
|
||||
setAuthOwnershipResolver(ownershipResolver: AuthOwnershipResolver): void;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export const authOwnershipResolutionExtensionPoint: ExtensionPoint<AuthOwnershipResolutionExtensionPoint>;
|
||||
|
||||
// @public
|
||||
export interface AuthOwnershipResolver {
|
||||
// (undocumented)
|
||||
getOwnershipEntityRefs(entity: Entity): Promise<string[]>;
|
||||
resolveOwnershipEntityRefs(entity: Entity): Promise<{
|
||||
ownershipEntityRefs: string[];
|
||||
}>;
|
||||
}
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
@@ -68,8 +79,6 @@ export interface AuthProviderRouteHandlers {
|
||||
export interface AuthProvidersExtensionPoint {
|
||||
// (undocumented)
|
||||
registerProvider(options: AuthProviderRegistrationOptions): void;
|
||||
// (undocumented)
|
||||
setAuthOwnershipResolver(ownershipResolver: AuthOwnershipResolver): void;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2023 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { AuthOwnershipResolver } from '../types';
|
||||
import { createExtensionPoint } from '@backstage/backend-plugin-api';
|
||||
|
||||
/** @public */
|
||||
export interface AuthOwnershipResolutionExtensionPoint {
|
||||
setAuthOwnershipResolver(ownershipResolver: AuthOwnershipResolver): void;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export const authOwnershipResolutionExtensionPoint =
|
||||
createExtensionPoint<AuthOwnershipResolutionExtensionPoint>({
|
||||
id: 'auth.ownershipResolution',
|
||||
});
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { createExtensionPoint } from '@backstage/backend-plugin-api';
|
||||
import { AuthOwnershipResolver, AuthProviderFactory } from '../types';
|
||||
import { AuthProviderFactory } from '../types';
|
||||
|
||||
/** @public */
|
||||
export interface AuthProviderRegistrationOptions {
|
||||
@@ -26,7 +26,6 @@ export interface AuthProviderRegistrationOptions {
|
||||
/** @public */
|
||||
export interface AuthProvidersExtensionPoint {
|
||||
registerProvider(options: AuthProviderRegistrationOptions): void;
|
||||
setAuthOwnershipResolver(ownershipResolver: AuthOwnershipResolver): void;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
|
||||
@@ -19,3 +19,8 @@ export {
|
||||
type AuthProviderRegistrationOptions,
|
||||
type AuthProvidersExtensionPoint,
|
||||
} from './AuthProvidersExtensionPoint';
|
||||
|
||||
export {
|
||||
authOwnershipResolutionExtensionPoint,
|
||||
type AuthOwnershipResolutionExtensionPoint,
|
||||
} from './AuthOwnershipResolutionExtensionPoint';
|
||||
|
||||
@@ -169,7 +169,9 @@ export type AuthResolverContext = {
|
||||
* @public
|
||||
*/
|
||||
export interface AuthOwnershipResolver {
|
||||
getOwnershipEntityRefs(entity: Entity): Promise<string[]>;
|
||||
resolveOwnershipEntityRefs(
|
||||
entity: Entity,
|
||||
): Promise<{ ownershipEntityRefs: string[] }>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user