Migrate TokenManager types

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2023-01-04 11:47:35 +01:00
parent d2a1fcdf09
commit 38dda2beab
5 changed files with 40 additions and 36 deletions
+5 -7
View File
@@ -51,7 +51,11 @@ import { SearchOptions } from '@backstage/backend-plugin-api';
import { SearchResponse } from '@backstage/backend-plugin-api';
import { SearchResponseFile } from '@backstage/backend-plugin-api';
import { Server } from 'http';
<<<<<<< HEAD
import { TransportStreamOptions } from 'winston-transport';
=======
import { TokenManagerService as TokenManager } from '@backstage/backend-plugin-api';
>>>>>>> 24636656b5 (Migrate TokenManager types)
import { UrlReaderService as UrlReader } from '@backstage/backend-plugin-api';
import { V1PodTemplateSpec } from '@kubernetes/client-node';
import * as winston from 'winston';
@@ -698,13 +702,7 @@ export interface StatusCheckHandlerOptions {
statusCheck?: StatusCheck;
}
// @public
export interface TokenManager {
authenticate(token: string): Promise<void>;
getToken(): Promise<{
token: string;
}>;
}
export { TokenManager };
export { UrlReader };
+1 -23
View File
@@ -14,26 +14,4 @@
* limitations under the License.
*/
/**
* Interface for creating and validating tokens.
*
* @public
*/
export interface TokenManager {
/**
* Fetches a valid token.
*
* @remarks
*
* Tokens are valid for roughly one hour; the actual deadline is set in the
* payload `exp` claim. Never hold on to tokens for reuse; always ask for a
* new one for each outgoing request. This ensures that you always get a
* valid, fresh one.
*/
getToken(): Promise<{ token: string }>;
/**
* Validates a given token.
*/
authenticate(token: string): Promise<void>;
}
export type { TokenManagerService as TokenManager } from '@backstage/backend-plugin-api';