Skip to content

Commit

Permalink
Added hydra_consent_skyp config var.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinolas authored and jvinolas committed Mar 5, 2021
1 parent 05648f6 commit f672463
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions mokey.yaml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ develop: false
# Hydra config
#------------------------------------------------------------------------------
# hydra_admin_url: "https://localhost:4445"
# hydra_consent_skip: false
# hydra_consent_timeout: 86400
# hydra_login_timeout: 86400
# hydra_fake_tls_termination: true
Expand Down
2 changes: 1 addition & 1 deletion server/hydra.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (h *Handler) ConsentGet(c echo.Context) error {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to validate consent")
}

if consent.Skip {
if viper.GetBool("hydra_consent_skip") || consent.Skip {
log.WithFields(log.Fields{
"user": consent.Subject,
}).Info("Hydra requested we skip consent")
Expand Down
1 change: 1 addition & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func init() {
viper.SetDefault("redis", ":6379")
viper.SetDefault("max_requests", 15)
viper.SetDefault("rate_limit_expire", 3600)
viper.SetDefault("hydra_consent_skip", false)
viper.SetDefault("hydra_login_timeout", 86400)
viper.SetDefault("hydra_consent_timeout", 86400)
}
Expand Down

0 comments on commit f672463

Please sign in to comment.