zowe / zowe/api-layer

Expiration of passtickets

Open
#3,041 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

technical excellence
Dominant language
Java
Stars
92
Forks
81
Avg merge
1d 9h
Merged PRs (30d)
46

Description

Passticket has a new value each second. It means it is unreasonable to generate it more often than in one second. The source code contains this expiration data that basically remove caching.

https://github.com/zowe/api-layer/blob/52ec39bd5476c73a66fc72203be110b479f1594f/gateway-service/src/main/java/org/zowe/apiml/gateway/security/service/schema/HttpBasicPassTicketScheme.java#L115-L116

It is necessary to mention that pass tickets could be valid for up to 10mins.

The correct implementation should be something like:

long expiration = (System.currentTimeMillis() + 1000) % 1000;
//If the custom config value is there, then add the configured time
// generate passticket
return new PassTicketCommand(value, cookieName, patCookieName, expiration, customUserHeader, customPassTicketHeader, userId, passTicket);

It at least reduces the amount of parallel action to generate the same value, but the configurable value could significantly improve the treatment of a huge amount of requests.

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 in gateway-service/src/main/java/org/zowe/apiml/gateway/security/service/schema/HttpBasicPassTicketScheme.java at the expiration data around lines 115-116, and trace how the PassTicketCommand is generated. Check the existing pass-ticket generation and configuration paths before implementing expiration that avoids regenerating the same value more than once per second while supporting a configurable validity period up to 10 minutes; verify the behavior with relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.