Make OPA file-based bearer token timing configurable#4972
Merged
dimas-b merged 2 commits intoJul 9, 2026
Conversation
205409b to
084ee4b
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request makes the timing behavior of OPA file-based bearer token handling configurable, replacing previously hard-coded waits/retry intervals while keeping existing defaults.
Changes:
- Add
initial-token-waitandrefresh-retry-intervalto the OPA file-based bearer token configuration (with unchanged defaults). - Wire the new configuration through
OpaPolarisAuthorizerFactoryintoFileBearerTokenProvider. - Extend/update unit tests to cover the new retry-interval behavior and updated constructor signature.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| runtime/defaults/src/main/resources/application.properties | Adds commented example properties for the two new timing knobs. |
| extensions/auth/opa/impl/src/main/java/org/apache/polaris/extension/auth/opa/OpaAuthorizationConfig.java | Introduces optional config fields and validation for initial wait and retry interval. |
| extensions/auth/opa/impl/src/main/java/org/apache/polaris/extension/auth/opa/OpaPolarisAuthorizerFactory.java | Reads new config values (with defaults) and passes them into the token provider. |
| extensions/auth/opa/impl/src/main/java/org/apache/polaris/extension/auth/opa/token/FileBearerTokenProvider.java | Stores and uses the configured refresh retry interval instead of a hard-coded value. |
| extensions/auth/opa/impl/src/test/java/org/apache/polaris/extension/auth/opa/OpaPolarisAuthorizerFactoryTest.java | Updates test instantiation for the new provider constructor parameter. |
| extensions/auth/opa/impl/src/test/java/org/apache/polaris/extension/auth/opa/token/FileBearerTokenProviderTest.java | Updates constructor calls and adds coverage for configurable refresh-retry-interval scheduling. |
dimas-b
approved these changes
Jul 6, 2026
dimas-b
left a comment
Contributor
There was a problem hiding this comment.
LGTM 👍 Thanks, @iting0321 !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This resolves the TODO around hard-coded token timing by adding optional file-based bearer token settings for:
initial-token-waitrefresh-retry-intervalDefaults remain unchanged:
PT5SPT1STesting
extensions/auth/opa/impl/src/test/java/org/apache/polaris/extension/auth/ opa/token/FileBearerTokenProviderTest.javaextensions/auth/opa/impl/src/test/java/org/apache/polaris/extension/auth/ opa/OpaPolarisAuthorizerFactoryTest.javaChecklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)