Skip to content

Harden OpenID retry initialization - #1870

Merged
MikeNeilson merged 2 commits into
bugfix/1858-auth-openapi-refreshfrom
fix/1859-oidc-retry-review
Aug 7, 2026
Merged

Harden OpenID retry initialization#1870
MikeNeilson merged 2 commits into
bugfix/1858-auth-openapi-refreshfrom
fix/1859-oidc-retry-review

Conversation

@krowvin

@krowvin krowvin commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up hardening for #1859's OpenID discovery retry and local Compose setup.

Changes and rationale

  • Treat OpenID as unable to authenticate until its configuration is ready, preventing bearer requests from dereferencing a missing parser during the retry window.
  • Skip retry scheduling when no well-known URL is configured and stop scheduling after successful initialization, avoiding rejected executor work and unnecessary polling.
  • Pass APP_PORT into the data-api container, keeping its local authentication proxy aligned with the discovery URL and Keycloak when a nondefault port is used.
  • Add regression coverage for the intentionally disabled no-URL configuration.

Per review feedback, this follow-up no longer changes Authenticator.java.

Validation

  • ./gradlew :cwms-data-api:test --tests '*OpenIDConfigTest' :cwms-data-api:checkstyleMain :cwms-data-api:checkstyleTest
  • docker compose config with APP_PORT=9090
  • git diff --check

The focused test and Checkstyle tasks pass. Checkstyle reports the repository's existing warning-level violations.

Signed-off-by: Charles Graham, SWT <charles.r.graham@usace.army.mil>
@krowvin
krowvin marked this pull request as ready for review August 7, 2026 15:21
@krowvin
krowvin requested a review from MikeNeilson August 7, 2026 15:21

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is overkill, the rest do seem reasoanble.

Signed-off-by: Charles Graham, SWT <charles.r.graham@usace.army.mil>
@krowvin krowvin changed the title Fix delayed OpenID provider activation Harden OpenID retry initialization Aug 7, 2026
@krowvin
krowvin requested a review from MikeNeilson August 7, 2026 15:29
@MikeNeilson
MikeNeilson merged commit 305c4cb into bugfix/1858-auth-openapi-refresh Aug 7, 2026
1 check passed
@MikeNeilson
MikeNeilson deleted the fix/1859-oidc-retry-review branch August 7, 2026 15:30
MikeNeilson pushed a commit that referenced this pull request Aug 7, 2026
## Summary

Follow-up hardening for #1859's OpenID discovery retry and local Compose
setup.

## Changes and rationale

- Treat OpenID as unable to authenticate until its configuration is
ready, preventing bearer requests from dereferencing a missing parser
during the retry window.
- Skip retry scheduling when no well-known URL is configured and stop
scheduling after successful initialization, avoiding rejected executor
work and unnecessary polling.
- Pass `APP_PORT` into the data-api container, keeping its local
authentication proxy aligned with the discovery URL and Keycloak when a
nondefault port is used.
- Add regression coverage for the intentionally disabled no-URL
configuration.

Per review feedback, this follow-up no longer changes
`Authenticator.java`.

## Validation

- `./gradlew :cwms-data-api:test --tests '*OpenIDConfigTest'
:cwms-data-api:checkstyleMain :cwms-data-api:checkstyleTest`
- `docker compose config` with `APP_PORT=9090`
- `git diff --check`

The focused test and Checkstyle tasks pass. Checkstyle reports the
repository's existing warning-level violations.

---------

Signed-off-by: Charles Graham, SWT <charles.r.graham@usace.army.mil>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants