mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 16:59:22 +02:00
authorize: log JWT groups filtering (#5432)
Add a new Authorize Log Fields option for logging the number of groups removed during JWT groups filtering. This will be enabled by default. Additionally, when the log level is Debug (or more verbose), store and log the IDs of any groups removed during JWT groups filtering.
This commit is contained in:
parent
97ba21b95a
commit
b0f89fc688
7 changed files with 85 additions and 28 deletions
|
@ -84,10 +84,11 @@ type RequestSession struct {
|
|||
|
||||
// Result is the result of evaluation.
|
||||
type Result struct {
|
||||
Allow RuleResult
|
||||
Deny RuleResult
|
||||
Headers http.Header
|
||||
Traces []contextutil.PolicyEvaluationTrace
|
||||
Allow RuleResult
|
||||
Deny RuleResult
|
||||
Headers http.Header
|
||||
Traces []contextutil.PolicyEvaluationTrace
|
||||
AdditionalLogFields map[log.AuthorizeLogField]any
|
||||
}
|
||||
|
||||
// An Evaluator evaluates policies.
|
||||
|
@ -228,10 +229,11 @@ func (e *Evaluator) Evaluate(ctx context.Context, req *Request) (*Result, error)
|
|||
}
|
||||
|
||||
res := &Result{
|
||||
Allow: policyOutput.Allow,
|
||||
Deny: policyOutput.Deny,
|
||||
Headers: headersOutput.Headers,
|
||||
Traces: policyOutput.Traces,
|
||||
Allow: policyOutput.Allow,
|
||||
Deny: policyOutput.Deny,
|
||||
Headers: headersOutput.Headers,
|
||||
Traces: policyOutput.Traces,
|
||||
AdditionalLogFields: headersOutput.AdditionalLogFields,
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue