INNER CODE UNIT · TypeScript
setAuth
keptn/keptn · bridge/server/app.ts:159
async function setAuth(
app: Express,
configuration: BridgeConfiguration
): Promise<{ authType: AuthType; session?: SessionService }> {
let authType: AuthType;
let session: SessionService | undefined;
if (configuration.oauth.enabled) {
session = await setupOAuth(app, configuration);
authType = AuthType.OAUTH;
} else if (configuration.auth.basicUsername && configuration.auth.basicPassword) {
authType = AuthType.BASIC;
await setBasicAUTH(app, configuration.auth);
} else {
authType = AuthType.NONE;
log.warning('No authentication middleware is installed');
}
return { authType, session };