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

Move out AuthCtx type parameter from service layers, and have only Namespace #1023

Closed
afsalthaj opened this issue Oct 22, 2024 · 1 comment
Closed

Comments

@afsalthaj
Copy link
Contributor

afsalthaj commented Oct 22, 2024

AuthCtx is the context required to create a Namespace (project-id, account-id). In other words, authorise if the context can access Namespace.

In many places the service traits takes this type parameter of AuthCtx which doesn't make much sense.

Service layer is simply concerned with working with the entities in the namespace, and not exactly the access to the namespace.

I think happens either due to the suboptimal usage or abuse of the idea of AuthCtx type parameterization in favor of some simplicity, or not understanding the whole idea. Or, may be it was a mistake from the beginning.

This ticket can also be used to review the code, and fix things across. If the idea of AuthCtx is suboptimal, may be we revisit.

I can also see Namespace being String in certain places with an argument that it largely simplifies the code. If this was done, then the decision of making it String should be applied to the whole in favor of consistency. In either ways, consistency should be maintained. In my strong opinion, this String approach is deceivingly simple, and practically complex!

@vigoo
Copy link
Contributor

vigoo commented Dec 6, 2024

We have a recommended way to deal with these abstractions documented that we can use to shape our codebase as we move forward, but won't perform a "big refactoring" just for this, so closing this.

@vigoo vigoo closed this as completed Dec 6, 2024
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

No branches or pull requests

2 participants