-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Make nauth support multiple systems
#116
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
base: main
Are you sure you want to change the base?
feat: Make nauth support multiple systems
#116
Conversation
nauth support multiple systems
nauth support multiple systemsnauth support multiple systems
|
Hi! Thanks for the PR! Sorry for slow feedback, we'll have a look at the issue and PR to get an understanding since it's a quite big update. |
thobiaskarlsson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I really like this addition. Some concerns found though, please have a look (and check PR workflow issues).
Regarding the PR description, in "Future Extensibility" your example says apiVersion: synadia.nauth.io/v1alpha1, don't you mean apiGroup: ...? I have posted an issue related to this as well in internal/system/resolver.go, please have a look.
|
@aleksanderaleksic , please rebase (and resolve conflicts), fix the commit sign-offs and comment on the conversations when you have resolved them so that we can perform a new renew and get this merged. |
|
nit: Otherwise great addition! I personally prefer explicit refs like that over labels. |
f920998 to
7ce7d05
Compare
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
…nfig Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Use events.EventRecorder from k8s.io/client-go/tools/events instead of record.EventRecorder to match the statusReporter interface requirements. Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no> Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
7ce7d05 to
ccb0645
Compare
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
Signed-off-by: Aleksander Aleksic <aleksander.aleksic@nordicsemi.no>
@wingsofovnia |
It all looks good! Regarding the name, I truly believe |
Okay, I will update the PR and resolve the conflicts :) |
Summary
Introduces the
SystemCRD to provide a more declarative and extensible approach to configuring NATS authentication backends, replacing the implicit label-based secret discovery mechanism.Key changes:
SystemCRD (nauth.io/v1alpha1) for explicit operator credentials configurationSystemviaspec.systemReffor credential resolutionsystemRefcontinue to workMotivation
The current nauth implementation requires secrets to be labeled with
nauth.io/secret-type: operator-signandnauth.io/secret-type: system-account-user-credsfor the controller to discover operator credentials. This approach has limitations:The new
SystemCRD addresses these issues by:secretReffieldsNew CRD Schema
Accounts reference a System via
systemRef:Architecture
flowchart TD AR[AccountReconciler] -->|resolves| R[Resolver] AR -->|delegates| P[Provider\ninterface] R -->|creates| F[Factory] F -->|creates| P P -.->|implements| NP[nauth.Provider] NP -->|wraps| AM[account.Manager] NP -->|wraps| UM[user.Manager]Account.Spec.SystemRefCreateAccount,CreateUser, etc.)Backward Compatibility
systemRefcontinue to use the legacy label-based secret discoveryFuture Extensibility
This architecture enables adding new system backends. For example, Synadia Cloud support could be added as:
Each backend would implement the
system.Providerinterface with its specific logic.Test Plan
make test)make test-e2e)system-ref-test) validates the System approach: