Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Jul 6, 2023
1 parent b75313e commit 33ac6ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions session/manager_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ func (s *ManagerHTTP) FetchFromRequest(ctx context.Context, r *http.Request) (_
}

expand := identity.ExpandDefault
if s.r.Config().SessionWhoAmIAAL(r.Context()) == config.HighestAvailableAAL {
// When the session endpoint requires the highest AAL, we fetch all credentials immediately to save a
// query later in "DoesSessionSatisfy". This is a SQL optimization, because the identity manager fetches
// the data in parallel, which is a bit faster than fetching it in sequence.
expand = identity.ExpandEverything
}

se, err := s.r.SessionPersister().GetSessionByToken(ctx, token, ExpandEverything, expand)
if err != nil {
if errors.Is(err, herodot.ErrNotFound) || errors.Is(err, sqlcon.ErrNoRows) {
Expand Down

0 comments on commit 33ac6ae

Please sign in to comment.