Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor PolarisMetaStoreManager interface into multiple interfaces #417

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

collado-mike
Copy link
Contributor

Description

PolarisMetaStoreManager is a monolithic interface that captures persistence, storage credential vending, remote cache, and grant management. This makes it easy to tie together many things that shouldn't be tied together - for example, the authorizer has dependencies on the cache types, so that it's impossible to make authorization pluggable using different grant rules.

This change strictly splits up the interface into multiple interfaces, but the single PolarisMetaStoreManager is still an extension of the others. Where it is possible to refer to specific interfaces, (e.g., the Resolver and the EntityCache), the references are changed, but we don't have factory types to generate realm-specific implementations of all interfaces and the PR was growing far too large when I started on that path.

Future PRs would update components to refer to specific interfaces and to break the tie between the PolarisMetaStoreManager interface and the others. The PolarisMetaStoreManagerImpl may continue to implement all interfaces.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Interface only change - all existing tests continue to pass.

Test Configuration:

  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

Please delete options that are not relevant.

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • If adding new functionality, I have discussed my implementation with the community using the linked GitHub issue

Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

LGTM overall 👍

Copy link
Contributor

@dennishuo dennishuo left a comment

Choose a reason for hiding this comment

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

LGTM, +1 to splitting. If the secrets manager will be specific to handling first-party auth, consider renaming it to PolarisPrincipalSecretsManager for clarity, or if it'll likely have some kinds of generic secret-management stuff for things like creating wrapped keys, encrypting/decrypting on the backend impl, then maybe better to leave it as you have it.

import org.jetbrains.annotations.Nullable;

/** Manages secrets for Polaris principals. */
public interface PolarisSecretsManager {
Copy link
Contributor

Choose a reason for hiding this comment

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

Once we have other types of stored secrets for outbound integrations/connections, we might have a different interface like "PolarisIntegrationSecretsManager" -- are you envisioning combining all different types of secrets into this interface, or would we split first-party principal auth-related management here (e.g. we might call this one PolarisPrincipalSecretsManager and keep it under this auth directory) from outbound integration secret management, possibly keeping PolarisIntegrationSecretsManager under the persistence directory?

@jbonofre
Copy link
Member

jbonofre commented Nov 1, 2024

If it's generally a good idea, do you mind to hold this for a few days ? The reason that it would break the current Quarkus branch. I'm proposing:

  1. To open Quarkus draft PR to drive discussion/consensus
  2. Review this PR after 1.
    Thoughts ?

@collado-mike
Copy link
Contributor Author

If it's generally a good idea, do you mind to hold this for a few days ? The reason that it would break the current Quarkus branch. I'm proposing:

  1. To open Quarkus draft PR to drive discussion/consensus
  2. Review this PR after 1.
    Thoughts ?

Hey @jbonofre - I have a branch at https://github.com/jbonofre/polaris/compare/QUARKUS...collado-mike:polaris:patch-1?expand=1 that has this change merged into your Quarkus branch. The code compiles, though when I run the tests locally, it fails due to missing AWS_REGION branch.

Can we merge that change into your branch and move forward with this refactoring in main?

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.

4 participants