mirror of
https://github.com/plankanban/planka.git
synced 2026-07-15 21:48:11 +03:00
fix(oidc): Add configurable HTTP timeout for OIDC client (#1575)
This commit is contained in:
@@ -78,6 +78,7 @@ services:
|
||||
# - OIDC_IGNORE_USERNAME=true
|
||||
# - OIDC_IGNORE_ROLES=true
|
||||
# - OIDC_ENFORCED=true
|
||||
# - OIDC_TIMEOUT=3500
|
||||
# - OIDC_DEBUG=true
|
||||
|
||||
# Email Notifications (https://nodemailer.com/smtp/)
|
||||
|
||||
@@ -96,6 +96,7 @@ services:
|
||||
# - OIDC_IGNORE_USERNAME=true
|
||||
# - OIDC_IGNORE_ROLES=true
|
||||
# - OIDC_ENFORCED=true
|
||||
# - OIDC_TIMEOUT=3500
|
||||
# - OIDC_DEBUG=true
|
||||
|
||||
# Email Notifications (https://nodemailer.com/smtp/)
|
||||
|
||||
@@ -69,6 +69,7 @@ SECRET_KEY=notsecretkey
|
||||
# OIDC_IGNORE_USERNAME=true
|
||||
# OIDC_IGNORE_ROLES=true
|
||||
# OIDC_ENFORCED=true
|
||||
# OIDC_TIMEOUT=3500
|
||||
# OIDC_DEBUG=true
|
||||
|
||||
# Email Notifications (https://nodemailer.com/smtp/)
|
||||
|
||||
@@ -45,6 +45,12 @@ module.exports = function defineOidcHook(sails) {
|
||||
clientInitPromise = (async () => {
|
||||
sails.log.info('Initializing OIDC client');
|
||||
|
||||
if (sails.config.custom.oidcTimeout !== null) {
|
||||
openidClient.custom.setHttpOptionsDefaults({
|
||||
timeout: sails.config.custom.oidcTimeout,
|
||||
});
|
||||
}
|
||||
|
||||
let issuer;
|
||||
try {
|
||||
issuer = await openidClient.Issuer.discover(sails.config.custom.oidcIssuer);
|
||||
|
||||
@@ -92,6 +92,7 @@ module.exports.custom = {
|
||||
oidcIgnoreUsername: process.env.OIDC_IGNORE_USERNAME === 'true',
|
||||
oidcIgnoreRoles: process.env.OIDC_IGNORE_ROLES === 'true',
|
||||
oidcEnforced: process.env.OIDC_ENFORCED === 'true',
|
||||
oidcTimeout: envToNumber(process.env.OIDC_TIMEOUT),
|
||||
oidcDebug: process.env.OIDC_DEBUG === 'true',
|
||||
|
||||
// TODO: move client base url to environment variable?
|
||||
|
||||
Reference in New Issue
Block a user