-
Notifications
You must be signed in to change notification settings - Fork 328
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
[SSP]Bucket access by users of tenants #1304
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1304 +/- ##
=======================================
Coverage 48.12% 48.12%
=======================================
Files 10 10
Lines 1571 1571
=======================================
Hits 756 756
Misses 756 756
Partials 59 59 |
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.
LGTM
api/pkg/backend/service.go
Outdated
for _, tier := range tiersList.Tiers { | ||
res := utils.ResourcesAlreadyExists(tier.Backends, id_array) | ||
if len(res) != 0 { | ||
errMsg := fmt.Sprintf("failed to delete backend because it is associated with some SSP") |
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.
associated with some SSP => associated with another SSP.
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.
addressed
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.
LGTM
LGTM |
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.
LGTM
What type of PR is this?
/kind bug fix
What this PR does / why we need it:
This PR solves the problem that when an user is getting switched from a tenant to other tenant which it is a part of ,the S3 API is using inappropriate tenantID(ProjectID).Because of this ,bucket operations like create bucket ,list buckets are using inappropriate tenantID and access of buckets is handled in a wrong way(example: as in issue disscused in issue [SSP]When an User is assigned to two tenants, buckets created in one tenant are accessible in other tenant by same user #1303 )
Also validation is taken care when a backend is requested to delete it checks whether the backend is associated with any SSP and warning is given
Validation that when an update tier is requested need to check whether the delete backends has any buckets in them
Which issue(s) this PR fixes:
Fixes #1303
Fixes #1297 (partially)
Test Report Added?:
/kind TESTED
Test Report:
tenant1 users:
tenant2 users:
User3 as tenant1 is listing buckets created in tenant1 only:
User3 as tenant2 is listing buckets created in tenant2 only but not tenant1 buckets:
When trying to delete backend which is associated with an SSP(tier)
**When trying to delete a backend(with buckets) from tier backends **
Special notes for your reviewer:
In a scenario where an user is a part of multiple tenants, AK/SK is common but the authtoken varies
So we need to extract userId and tenantID using authtoken
In the existing S3API, x-auth-token value in the request is not validated.
And tenantID and userID are extracted and set as context using AK/SK in the signature filter
so we need to add auth filter where the validation of authtoken is done and tenantID and userId are extracted and set in the context using authtoken.