zowe / zowe/api-layer

Endpoint `/zaas/api/v1/auth/keys/public` does not support PAT

Open
#4,175 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Priority: Low size/M
Dominant language
Java
Stars
92
Forks
81
Avg merge
1d 9h
Merged PRs (30d)
46

Description

There is an endpoint to obtain public keys used for signing JWT, but it doesn't support all cases. Basically it returns APIML or z/OSMF one. There is even a check that only one key is available at one moment. It should support also the situation when z/OSMF is used and PAT are enabled. It this scenario both keys should be returned. I theory we can take care about OIDC provider too.

The implementation that is trying to identify what type of token is used is not bad in general, but it is not helping at all. We should return Zowe certificate if PAT is enabled, SAF provider or z/OSMF provides just LPTA2 token and z/OSMF if the provider is set to zosmf. I guess the simplifacation to return always Zowe certificate and z/OSMF one in case it is set as provider is good enough.

https://github.com/zowe/api-layer/blob/1bd74f933b46c7fc79cbf0c2465800592cb563e9/zaas-service/src/main/java/org/zowe/apiml/zaas/controllers/AuthController.java#L400-L452

The same code was used also during Modulith implementation, so you can find the same code in there (see methods getCurrentKey and public Mono<ResponseEntity<Object>> getPublicKeyUsedForSigning()). The code part of PR #4108: https://github.com/zowe/api-layer/pull/4108/files/410ac68fd0290887542c8704eb2a7041d6bc1b0e#diff-49b0848928548b8f36fe20747dcd2935c7d17114a60c64c6beee2ba0ba4f9f21


This issue is based on the conversation https://github.com/zowe/api-layer/pull/4108/files/410ac68fd0290887542c8704eb2a7041d6bc1b0e#r2142632267.

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 AuthController.java at the referenced lines and inspect getCurrentKey and getPublicKeyUsedForSigning(), then compare the corresponding Modulith implementation. Review the token-provider cases described in the issue and the discussion in PR #4108. Done means the endpoint returns both applicable public keys when z/OSMF and PAT are enabled, while preserving the stated SAF, LPTA2, and z/OSMF behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, authentication, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.