Skip to content

feat: z/OSMF JWT Preflight Check#4531

Draft
hrishikesh-nalawade wants to merge 30 commits into
v3.x.xfrom
hrishikesh-nalawade/GH4526/jwt-pre-flight-check
Draft

feat: z/OSMF JWT Preflight Check#4531
hrishikesh-nalawade wants to merge 30 commits into
v3.x.xfrom
hrishikesh-nalawade/GH4526/jwt-pre-flight-check

Conversation

@hrishikesh-nalawade
Copy link
Copy Markdown
Member

@hrishikesh-nalawade hrishikesh-nalawade commented Mar 27, 2026

Description

A Java utility that verifies connectivity to the z/OSMF JWK endpoint before/after starting the Zowe API Mediation Layer. This tool helps diagnose configuration issues early such as incorrect hostnames, unreachable ports, missing certificates, or misconfigured z/OSMF by performing a lightweight HTTP(S) call to the z/OSMF JWK endpoint at /jwt/ibm/api/zOSMFBuilder/jwk

Linked to #4526

Type of change

  • feat: New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • PR title conforms to commit message guideline ## Commit Message Structure Guideline
  • I have commented my code, particularly in hard-to-understand areas. In JS I did provide JSDoc
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The java tests in the area I was working on leverage @nested annotations
  • Any dependent changes have been merged and published in downstream modules

Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
Comment thread gradle/publish.gradle Outdated
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
@hrishikesh-nalawade hrishikesh-nalawade changed the title feat: JWT Preflight Check feat: z/OSMF JWT Preflight Check Apr 1, 2026
@EvaJavornicka EvaJavornicka moved this from New to In Progress in API Mediation Layer Backlog Management Apr 1, 2026
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
hrishikesh-nalawade and others added 3 commits April 1, 2026 19:57
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
hrishikesh-nalawade and others added 3 commits April 20, 2026 23:13
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
* or z/OS SAF keyrings. Supports PKCS12, JKS, and {@code safkeyring://} URIs.
*/
@SuppressWarnings("squid:S106")
public class Stores {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this class more or less the same as for the certificate analyzer?

Would it be possible to extract it to some of the libraries?

* Thrown when keystore or truststore initialization fails
* (e.g. missing file, wrong password, invalid keyring format).
*/
public class StoresNotInitializeException extends RuntimeException {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also lives in certificate-analyzer, if it is used in both it probably should go to some common module.

* </ul>
*/
@SuppressWarnings("squid:S106")
public class SSLContextFactory {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as Stores and StoresNotInitializeException, does it make sense to duplicate the code instead of having it in a shared library?

hrishikesh-nalawade and others added 2 commits May 13, 2026 17:08
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
@balhar-jakub balhar-jakub marked this pull request as draft May 13, 2026 12:39
@balhar-jakub
Copy link
Copy Markdown
Member

Will be replaced by another PR

Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
…re-flight-check' into hrishikesh-nalawade/GH4526/jwt-pre-flight-check
hrishikesh-nalawade and others added 12 commits May 14, 2026 02:23
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
This reverts commit 2b566bd.
This reverts commit fc8c14f.
This reverts commit 2088e48.
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
@hrishikesh-nalawade hrishikesh-nalawade self-assigned this May 28, 2026
Signed-off-by: hrishikesh-nalawade <hrishikesh.nalawade.17@gmail.com>
return new X509Certificate[0];
}

public void checkClientTrusted(X509Certificate[] certs, String authType) {
// trust all
}

public void checkServerTrusted(X509Certificate[] certs, String authType) {

if (VERIFY_DISABLED.equals(verifyMode)) {
SSLContextFactory sslContextFactory = SSLContextFactory.initTrustAllSSLContext();
HostnameVerifier noopVerifier = (hostname, session) -> true;

HostnameVerifier hostnameVerifier;
if (VERIFY_NONSTRICT.equals(verifyMode)) {
hostnameVerifier = (hostname, session) -> true;
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2.3% Coverage on New Code (required ≥ 80%)
5.5% Duplication on New Code (required ≤ 3%)
D Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

5 participants