cloudfoundry / cloudfoundry/stratos

Clean up session expiry time

Open
#4,447 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
267
Forks
137
Avg merge
5h 14m
Merged PRs (30d)
77

Description

  • there's a mismatch in where the session expiration time is stored
    • the initial value is automatically generated and stored via
      expiresOn := time.Now().Add(time.Second * time.Duration(session.Options.MaxAge))
      session.Values["expires_on"] = expiresOn
      
    • auth providers (uaa, local, non) will provide a value in sessionValues["exp"],
    • when returned to user exp is ignored in favour of expires_on (see handleSessionExpiryHeader)
  • there should be a way for the authentication mode to set the session expiry time
    • not sure it's as simple as making sure exp and expires_on are the same
  • TODO allow session.Options.MaxAge to be set via env var

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the session expiry initialization, the auth providers' sessionValues["exp"], and handleSessionExpiryHeader. Determine how authentication modes should control expiry and how session.Options.MaxAge should be configured from an environment variable. Done means the storage and returned expiry behavior are consistent for each authentication mode, with coverage for the relevant cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.