authorize: performance improvements (#3723)

This commit is contained in:
Caleb Doxsey 2022-11-04 17:09:52 -06:00 committed by GitHub
parent a3cfe8fa42
commit 02df20f10a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 20 deletions

View file

@ -66,8 +66,8 @@ func (a *Authorize) Check(ctx context.Context, in *envoy_service_auth_v3.CheckRe
sessionState = nil
}
}
if s != nil {
u, _ = a.getDataBrokerUser(ctx, s.GetUserId()) // ignore any missing user error
if sessionState != nil && s != nil {
u, _ = a.getDataBrokerUser(ctx, s.GetUserId(), sessionState.DatabrokerRecordVersion) // ignore any missing user error
}
req, err := a.getEvaluatorRequestFromCheckRequest(in, sessionState)