feat: add sessionSecretFile and oauthClientSecretFile for JSON config
This commit is contained in:
committed by
Linus Rath
parent
7ee329e046
commit
b508551d02
@@ -23,7 +23,12 @@ export function getSessionSecret(): string {
|
|||||||
if (fromFile) return fromFile;
|
if (fromFile) return fromFile;
|
||||||
|
|
||||||
const fromAdmin = configManager.get<string>('sessionSecret', '');
|
const fromAdmin = configManager.get<string>('sessionSecret', '');
|
||||||
return fromAdmin || '';
|
if (fromAdmin) return fromAdmin;
|
||||||
|
|
||||||
|
const fromAdminFile = readFileEnv(
|
||||||
|
configManager.get<string>('sessionSecretFile', ''),
|
||||||
|
);
|
||||||
|
return fromAdminFile || "";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hasSessionSecret(): boolean {
|
export function hasSessionSecret(): boolean {
|
||||||
|
|||||||
@@ -19,6 +19,12 @@ export function getDiscoveryValidator(): EndpointValidator | undefined {
|
|||||||
function getGlobalClientSecret(): string {
|
function getGlobalClientSecret(): string {
|
||||||
const adminSecret = configManager.get<string>('oauthClientSecret', '');
|
const adminSecret = configManager.get<string>('oauthClientSecret', '');
|
||||||
if (adminSecret) return adminSecret;
|
if (adminSecret) return adminSecret;
|
||||||
|
|
||||||
|
const adminFileSecret = readFileEnv(
|
||||||
|
configManager.get<string>('oauthClientSecretFile', ''),
|
||||||
|
);
|
||||||
|
if (adminFileSecret) return adminFileSecret;
|
||||||
|
|
||||||
return process.env.OAUTH_CLIENT_SECRET || readFileEnv(process.env.OAUTH_CLIENT_SECRET_FILE) || '';
|
return process.env.OAUTH_CLIENT_SECRET || readFileEnv(process.env.OAUTH_CLIENT_SECRET_FILE) || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user