/**
 * @public
 */
export type BackstageUserPrincipal = {
    type: 'user';
    userEntityRef: string;
};
/**
 * @public
 */
export type BackstageNonePrincipal = {
    type: 'none';
};
/**
 * @public
 */
export type BackstageServicePrincipal = {
    type: 'service';
    subject: string;
};
/**
 * @public
 */
export type BackstageCredentials<TPrincipal = unknown> = {
    $$type: '@backstage/BackstageCredentials';
    expiresAt?: Date;
    principal: TPrincipal;
};
/**
 * @public
 */
export type BackstagePrincipalTypes = {
    user: BackstageUserPrincipal;
    service: BackstageServicePrincipal;
    none: BackstageNonePrincipal;
    unknown: unknown;
};
/**
 * @public
 */
export interface AuthService {
    authenticate(token: string, options?: {
        allowLimitedAccess?: boolean;
    }): Promise<BackstageCredentials>;
    isPrincipal<TType extends keyof BackstagePrincipalTypes>(credentials: BackstageCredentials, type: TType): credentials is BackstageCredentials<BackstagePrincipalTypes[TType]>;
    getNoneCredentials(): Promise<BackstageCredentials<BackstageNonePrincipal>>;
    getOwnServiceCredentials(): Promise<BackstageCredentials<BackstageServicePrincipal>>;
    getPluginRequestToken(options: {
        onBehalfOf: BackstageCredentials;
        targetPluginId: string;
    }): Promise<{
        token: string;
    }>;
    getLimitedUserToken(credentials: BackstageCredentials<BackstageUserPrincipal>): Promise<{
        token: string;
        expiresAt: Date;
    }>;
}
