feat(build): extract authmgr-oauth2-agent module with no Iceberg dependency - #241
feat(build): extract authmgr-oauth2-agent module with no Iceberg dependency#241adutra wants to merge 2 commits into
Conversation
| @@ -161,6 +161,6 @@ void testReadPemWithInvalidBase64() throws IOException { | |||
| .isInstanceOf(IllegalArgumentException.class) | |||
| .hasMessageContaining("Failed to read PEM file") | |||
| .rootCause() | |||
| .hasMessageContaining("not enough content"); | |||
| .hasMessageContaining("Illegal base64 character"); | |||
There was a problem hiding this comment.
We are now using the JDK decoder, not Apache Commons brought transitively by Iceberg.
| @SuppressWarnings("resource") | ||
| public PolarisContainer() { | ||
| super("apache/polaris:1.3.0-incubating"); | ||
| super("apache/polaris:1.5.0"); |
There was a problem hiding this comment.
Unrelated, but quite consensual I hope :-)
| * limitations under the License. | ||
| */ | ||
| package com.dremio.iceberg.authmgr.oauth2.config.validator; | ||
| package com.dremio.iceberg.authmgr.oauth2.agent.config.validator; |
There was a problem hiding this comment.
If this module is not supposed to have Iceberg deps, having iceberg in the package name looks odd 🤔
There was a problem hiding this comment.
I completely agree, but changing the root package name also feels odd, in a project where all modules share the com.dremio.iceberg.authmgr root package.
A possible solution would be to repurpose this repository into something like "Dremio OAuth2 Tools", containing 2 main components: the (iceberg-agnostic) agent and the Iceberg-specific AuthManager.
WDYT? Should I move forward with the idea of rebranding this repo?
There was a problem hiding this comment.
There is also a problem with Maven GAV coordinates: the group ID for all modules is com.dremio.iceberg.authmgr. Changing the group ID would require publishing relocation poms for existing modules.
There was a problem hiding this comment.
I investigated this matter a bit more today and came to the conclusion that this change needs more thinking. A few things that we also need to consider:
- What Maven GAV coordinates should we use for the new module?
- What root package?
- What Gradle module name (knowning that the Gradle module name by default becomes the Maven artifact ID)?
- Should we repurpose
authmgr-oauth2-immutablesas well (since it's used by the Agent)? - Should we keep the BOM global, or make it an Iceberg-specific BOM?
- How to re-organize the repository's folder structure?
- How to re-organize the docs folder?
- And maybe the most tricky item:
com.dremio.oauth2.agent.OAuth2AgentConfig#PREFIXreferences the Iceberg's AuthManager config prefix statically, and is not configurable atm. We would need to make this prefix configurable at runtime.
Given all the above questions, let's put this PR into draft state for now and solve them little by little.
…ndency Fixes dremio#239. Introduces a new `:authmgr-oauth2-agent` Gradle module containing the entire OAuth2 token engine (`OAuth2Agent`, all `Flow` implementations, `OAuth2Config`, and every supporting subpackage) with zero Iceberg compile-time dependencies, making it usable by non-Iceberg callers (custom REST clients, Kafka connectors, ad-hoc tooling). `:authmgr-oauth2-core` is now a thin two-class Iceberg SPI adapter (`OAuth2Manager` + `OAuth2Session`). Bundle modules (`runtime`, `standalone`) continue to shadow `:authmgr-oauth2-core` and pick up the agent transitively; their sources/javadoc JARs now merge both modules. Test fixtures are split accordingly: agent `testFixtures` contain the Iceberg-free `TestEnvironment` and all expectation helpers; core `testFixtures` add `IcebergTestEnvironment extends TestEnvironment` and `IcebergRestExpectation` for the two Iceberg-specific catalog mocks. The new `:authmgr-oauth2-agent` module now has a new root package: `com.dremio.iceberg.authmgr.oauth2.agent`. The existing `:authmgr-oauth2-core` keeps its current package: `com.dremio.iceberg.authmgr.oauth2`, in order to avoid user-facing regressions since this module contains the Auth Manager implementation.
Fixes #239.
Introduces a new
:authmgr-oauth2-agentGradle module containing the entire OAuth2 token engine (OAuth2Agent, allFlowimplementations,OAuth2Config, and every supporting subpackage) with zero Iceberg compile-time dependencies, making it usable by non-Iceberg callers (custom REST clients, Kafka connectors, ad-hoc tooling).:authmgr-oauth2-coreis now a thin two-class Iceberg SPI adapter (OAuth2Manager+OAuth2Session). Bundle modules (runtime,standalone) continue to shadow:authmgr-oauth2-coreand pick up the agent transitively; their sources/javadoc JARs now merge both modules.Test fixtures are split accordingly: agent
testFixturescontain the Iceberg-freeTestEnvironmentand all expectation helpers; coretestFixturesaddIcebergTestEnvironment extends TestEnvironmentandIcebergRestExpectationfor the two Iceberg-specific catalog mocks.The new
:authmgr-oauth2-agentmodule now has a new root package:com.dremio.iceberg.authmgr.oauth2.agent. The existing:authmgr-oauth2-corekeeps its current package:com.dremio.iceberg.authmgr.oauth2, in order to avoid user-facing regressions since this module contains the Auth Manager implementation.