backend-app-api: reorder auth service methods in implementation

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-04-05 16:17:49 +02:00
parent 007e7eaefa
commit a5f71d00ff
@@ -115,11 +115,6 @@ class DefaultAuthService implements AuthService {
private readonly pluginTokenHandler: PluginTokenHandler,
) {}
async listPublicServiceKeys(): Promise<{ keys: JsonObject[] }> {
const { keys } = await this.publicKeyStore.listKeys();
return { keys: keys.map(({ key }) => key) };
}
// allowLimitedAccess is currently ignored, since we currently always use the full user tokens
async authenticate(token: string): Promise<BackstageCredentials> {
const pluginResult = await this.pluginTokenHandler.verifyToken(token);
@@ -235,6 +230,11 @@ class DefaultAuthService implements AuthService {
return this.userTokenHandler.createLimitedUserToken(backstageToken);
}
async listPublicServiceKeys(): Promise<{ keys: JsonObject[] }> {
const { keys } = await this.publicKeyStore.listKeys();
return { keys: keys.map(({ key }) => key) };
}
#getJwtExpiration(token: string) {
const { exp } = decodeJwt(token);
if (!exp) {