-
Notifications
You must be signed in to change notification settings - Fork 9
feat: partition assets into multiple tenants #217
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
Conversation
483acbb to
2725726
Compare
b8ad837 to
d09d193
Compare
Pull Request Test Coverage Report for Build 4533387823Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
bbc2403 to
f7eed68
Compare
| } | ||
| } | ||
| if len(namespace.State) > 0 { | ||
| existingNamespace.State = namespace.State |
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.
We should not allow changing state till automation is not available for migrating one state to another.
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.
Agree so I have not added namespace update call in cli but I feel that instead of leaving this behind in the API, we can still have it to make it complete. What do you think?
1be5c19 to
d29887d
Compare
b413726 to
df13bbb
Compare
d71169f to
951cd53
Compare
Signed-off-by: Kush Sharma <[email protected]>
RLS requires user used for application database connection should not be table owner and a superuser else all RLS are bypassed by default. That means a user that is migrating the application and a user that is used for serving the app should both be different. Signed-off-by: Kush Sharma <[email protected]>
951cd53 to
c7e0b27
Compare
Signed-off-by: Kush Sharma <[email protected]>
5100a2b to
5e8cf80
Compare
This is a breaking change, all existing applications using compass will have to modify their contract to include a namespace. The elasticsearch index strategy has been changed, all the data will need to be re-indexed again. The user flow would be as follows:
postgresand depending on if this tenant issharedordedicatedanindexand analiaswill be created inelasticsearch.assetwill need to pass the namespace id.Get/Listall registered namespaces. One thing to note is, as part of the migration step, compass creates adefaultnamespace to avoid the hassle of bootstrapping compass use-case.Changes are made based on design discussion at #208. API changes are available in raystack/proton#246
To enforce multi-tenant restrictions at the database level, I have used Row Level Security. RLS requires Postgres users used for application database connection not to be a
table owneror asuperuserelse all RLS are bypassed by default. That means a Postgresuserthat is migrating the application and a user that is used to serve the app should both be different.To create a postgres user
A middware for grpc looks for
x-namespace-idheader to extract tenant id if not found falls back todefaultnamespace. Same could be passed in a jwt token of Auth bearer.