Skip to content

Unify out-of-band session access#7295

Merged
zachmargolis merged 6 commits intomainfrom
margolis-unify-session-accessors
Nov 4, 2022
Merged

Unify out-of-band session access#7295
zachmargolis merged 6 commits intomainfrom
margolis-unify-session-accessors

Conversation

@zachmargolis
Copy link
Contributor

I noticed that Pii::SessionStore had been refactored into OutOfBandSessionAccessor but X509::SessionStore (its clone) was lagging in #7290 (comment)

Before: three classes that did almost the same things:

  • Pii::SessionStore
  • X509::SessionStore
  • OutOfBandSessionAccessor

After: just one class, OutOfBandSessionAccessor

Before: three classes that did almost the same things:
 - Pii::SessionStore
 - X509::SessionStore
 - OutOfBandSessionAccessor

After: just one class, OutOfBandSessionAccessor

[skip changelog]
private
# @return [Hash]
def load
session_store.send(:load_session_from_redis, session_uuid) || {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to memoize this? The one section that could benefit is here where it potentially loads the session from Redis twice to fetch PII and X509 attributes separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea! added in fef200b

I was worried that this might mess up some of our specs that rely on "fresh" data but a quick spot-check showed that they still passed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found another allocation/instantiation we could save in 0c5a415, I think this will save creating a new redis connection

Copy link
Contributor

@mitchellhenke mitchellhenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@zachmargolis zachmargolis merged commit 19ca1ca into main Nov 4, 2022
@zachmargolis zachmargolis deleted the margolis-unify-session-accessors branch November 4, 2022 20:21
@zachmargolis
Copy link
Contributor Author

👀 excited to see what userinfo, token endpoint performance looks like after this shops! 🚀

zachmargolis added a commit that referenced this pull request Nov 29, 2022
**Why**: They were refactored away in #7295
into OutOfBandSessionAccessor#{load_pii,load_x509}

[skip changelog]
zachmargolis added a commit that referenced this pull request Nov 30, 2022
**Why**: They were refactored away in #7295
into OutOfBandSessionAccessor#{load_pii,load_x509}

[skip changelog]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants