@backstage/backend-defaults
Version:
Backend defaults used by Backstage backend apps
41 lines (37 loc) • 1.4 kB
TypeScript
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
/**
* @public
* Issues and verifies {@link https://backstage.iceio/docs/auth/service-to-service-auth | service-to-service tokens}.
*/
interface PluginTokenHandler {
verifyToken(token: string): Promise<{
subject: string;
limitedUserToken?: string;
} | undefined>;
issueToken(options: {
pluginId: string;
targetPluginId: string;
onBehalfOf?: {
limitedUserToken: string;
expiresAt: Date;
};
}): Promise<{
token: string;
}>;
}
/**
* @public
* This service is used to decorate the default plugin token handler with custom logic.
*/
declare const pluginTokenHandlerDecoratorServiceRef: _backstage_backend_plugin_api.ServiceRef<(defaultImplementation: PluginTokenHandler) => PluginTokenHandler, "plugin", "singleton">;
/**
* Handles token authentication and credentials management.
*
* See {@link @backstage/code-plugin-api#AuthService}
* and {@link https://backstage.io/docs/backend-system/core-services/auth | the service docs}
* for more information.
*
* @public
*/
declare const authServiceFactory: _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.AuthService, "plugin", "singleton">;
export { type PluginTokenHandler, authServiceFactory, pluginTokenHandlerDecoratorServiceRef };