zowe / zowe/api-layer

Distributing invalidated tokens between instances is not working in all cases

Open
#4,193 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug High Availability Priority: High
Dominant language
Java
Stars
92
Forks
81
Avg merge
1d 9h
Merged PRs (30d)
46

Description

The APIML collects revoked tokens (if a user calls the logout endpoint) and should distribute them between all instances. It is working well if all services are in good shape, but there are a couple of situations when to distribution is broken.

  1. Start 2 instances of GW / ZAAS
  2. Log out X on instance A (it is distributed to instance B - correct)
  3. Stop instance B
  4. Log out Y on instance A (it distribution is not done)
  5. Start instance B
  6. Instance B should ask instance A for the redistribution of tokens - it is not implemented
  7. Stop instance A
  8. Token X is invalid, but token Y is valid

There is also a question about the requirement for a certificate for calling the endpoints. It should be allowed only to the APIML certificate, but it looks like the client ones are accepted as well.

Solution A:

  • After startup and loading Eureka instances, the GW / ZAAS should ask all other instances for the distribution of all tokens
  • The certificate for endpoints (/gateway/api/v1/auth/distribute/** and /gateway/api/v1/auth/invalidate/**) should be restricted only to the APIML cert

Solution B:

  • Replace ehCache with Infinispan and remove the code simulating a distributed cache
  • It is related to the #4172

This issue was created based on the code review of #4191

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 with the gateway authentication endpoints named in the issue: /gateway/api/v1/auth/distribute/** and /gateway/api/v1/auth/invalidate/**, then review the related code-review issue #4191 and issue #4172. Determine whether the project will pursue startup redistribution and certificate restriction or replace the cache approach; done should cover stopped-instance recovery and the stated certificate boundary.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, security
Issue type
Bug
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.