Skip to content

add sso state ttl#935

Open
vaimdevs wants to merge 1 commit intomasterfrom
fix/add-sso-state-ttl
Open

add sso state ttl#935
vaimdevs wants to merge 1 commit intomasterfrom
fix/add-sso-state-ttl

Conversation

@vaimdevs
Copy link
Contributor

@vaimdevs vaimdevs commented Mar 9, 2026

self.idp_name: Optional[str] = None
self.sso_state: Optional[str] = None
self.sso_state_created_at: Optional[float] = None
self.sso_state_ttl_s: int = get_from_env("GRAPHISTRY_SSO_STATE_TTL_S", int, 300)
Copy link
Contributor

Choose a reason for hiding this comment

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


created_at = self.session.sso_state_created_at
ttl = self.session.sso_state_ttl_s
if created_at is not None and (time.time() - created_at) > ttl:
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. especially as we're not confident of SSO expiry, instead of being preemptive and risk being wrong, probably better to instead limit this to a nicer error message in the case of a failure

Ex:

  • try to do the action against the server
  • server raises an exn
  • we catch the exn, and if flagged as a potential sso expiry, stack the exns so they get both messages (important to get both, not just potentially incorrectly cloud with this)
  1. i'm unsure if this is the right place to detect such an expiry; it'd be good to test that the correct library point is being tested (live test, vs synthetic)

Copy link
Contributor

@lmeyerov lmeyerov left a comment

Choose a reason for hiding this comment

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

See comments -

  1. the time mechanism looks unreliable, so rather make it a cleaner exn re-raise vs proactive due to danger of FPs

  2. should check whether 300 is the sane default

  3. would like confirmation test was on a live sso timeout, vs just synthetic testing, so we know we're catching at the right callsite

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