mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-09 04:52:35 +02:00
api: add DEBUG_DISABLE_AUTH for debugging
This commit is contained in:
parent
9cb7cc84ee
commit
78a3c8a8e4
2 changed files with 2 additions and 1 deletions
|
@ -31,7 +31,7 @@ func GetDefaultAuth() Provider {
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsEnabled() bool {
|
func IsEnabled() bool {
|
||||||
return common.APIJWTSecret != nil || IsOIDCEnabled()
|
return !common.DebugDisableAuth && (common.APIJWTSecret != nil || IsOIDCEnabled())
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsOIDCEnabled() bool {
|
func IsOIDCEnabled() bool {
|
||||||
|
|
|
@ -44,6 +44,7 @@ var (
|
||||||
APIJWTTokenTTL = GetDurationEnv("API_JWT_TOKEN_TTL", time.Hour)
|
APIJWTTokenTTL = GetDurationEnv("API_JWT_TOKEN_TTL", time.Hour)
|
||||||
APIUser = GetEnvString("API_USER", "admin")
|
APIUser = GetEnvString("API_USER", "admin")
|
||||||
APIPassword = GetEnvString("API_PASSWORD", "password")
|
APIPassword = GetEnvString("API_PASSWORD", "password")
|
||||||
|
DebugDisableAuth = GetEnvBool("DEBUG_DISABLE_AUTH", false)
|
||||||
|
|
||||||
// OIDC Configuration.
|
// OIDC Configuration.
|
||||||
OIDCIssuerURL = GetEnvString("OIDC_ISSUER_URL", "")
|
OIDCIssuerURL = GetEnvString("OIDC_ISSUER_URL", "")
|
||||||
|
|
Loading…
Add table
Reference in a new issue