backend-common: rename config block from authorization to auth

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
Mike Lewis
2021-11-23 14:41:33 +00:00
parent 42b01ee725
commit 8cb1c4d17c
5 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -23,9 +23,9 @@ app:
title: '#backstage'
backend:
# Used for enabling authorization, secret is shared by all backend plugins
# Used for enabling authentication, secret is shared by all backend plugins
# See authenticate-api-requests.md in the contrib docs for information on the format
# authorization:
# auth:
# secret: ${BACKEND_SECRET}
baseUrl: http://localhost:7007
listen:
+1 -1
View File
@@ -21,7 +21,7 @@ export interface Config {
backend: {
/** Backend configuration for when request authentication is enabled */
authorization?: {
auth?: {
/**
* Secret shared by all backends for generating tokens
* Format is base64 24-bit key
@@ -18,7 +18,7 @@ import { ServerTokenManager } from './ServerTokenManager';
const emptyConfig = new ConfigReader({});
const configWithSecret = new ConfigReader({
backend: { authorization: { secret: 'a-secret-key' } },
backend: { auth: { secret: 'a-secret-key' } },
});
describe('ServerTokenManager', () => {
@@ -26,7 +26,7 @@ export class ServerTokenManager implements TokenManager {
}
static fromConfig(config: Config) {
const secret = config.getString('backend.authorization.secret');
const secret = config.getString('backend.auth.secret');
return new ServerTokenManager(secret);
}
@@ -6,9 +6,9 @@ organization:
name: My Company
backend:
# Used for enabling authorization, secret is shared by all backend plugins
# Used for enabling authentication, secret is shared by all backend plugins
# See authenticate-api-requests.md in the contrib docs for information on the format
# authorization:
# auth:
# secret: ${BACKEND_SECRET}
baseUrl: http://localhost:7007
listen: