Skip to content

Commit 1165c91

Browse files
fix: abstain when OAuth whitelist is empty (#1010)
Co-authored-by: wwhsaber <wwhsaber@foxmail.com>
1 parent 84117ce commit 1165c91

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎internal/service/access_controls_rules.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ func (rule *UserAllowedRule) Evaluate(ctx *ACLContext) Effect {
4343
rule.Log.App.Debug().Msg("User is an OAuth user, checking OAuth whitelist")
4444
match, err := utils.CheckFilter(ctx.ACLs.OAuth.Whitelist, ctx.UserContext.OAuth.Email)
4545
if err != nil {
46+
// Empty whitelist means "not configured" — let OAuth group rules decide.
47+
if err == utils.ErrFilterEmpty {
48+
rule.Log.App.Debug().Msg("OAuth whitelist is empty, abstaining")
49+
return EffectAbstain
50+
}
4651
rule.Log.App.Warn().Err(err).Str("item", ctx.UserContext.OAuth.Email).Msg("Invalid entry in OAuth whitelist")
4752
return EffectDeny
4853
}

0 commit comments

Comments
 (0)