Endpoint `/zaas/api/v1/auth/keys/public` does not support PAT
Nobody has claimed this yet.
- 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.
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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