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

feat: oss Provider #193

Merged
merged 34 commits into from
Dec 16, 2024
Merged

feat: oss Provider #193

merged 34 commits into from
Dec 16, 2024

Conversation

ayushi0014
Copy link

No description provided.

AccountTypeRAMUser = "ram_user"
AccountTypeRAMRole = "ram_role"
resourceTypeBucket = "bucket"
parameterRAMRoleKey = "ram_role"
Copy link

Choose a reason for hiding this comment

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

since the value is similar, can't we just use AccountTypeRAMRole ?

Copy link
Author

Choose a reason for hiding this comment

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

this field is not being used, I've removed it for now. thanks for pointing out!

func findStatementsWithMatchingActions(bucketPolicy Policy, resourceAccountID string, g domain.Grant) ([]PolicyStatement, []PolicyStatement) {
var statements []PolicyStatement
var matchingStatements []PolicyStatement
for _, statement := range bucketPolicy.Statement {
Copy link
Member

Choose a reason for hiding this comment

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

Let's try to merge this loop with the one here to reduce the number of iterations. I think we can do the same for revoke flow.

if err != nil {
var ossErr oss.ServiceError
if errors.As(err, &ossErr) && ossErr.StatusCode == http.StatusNotFound {
return fmt.Errorf("access not found for role: %s", g.Role)
Copy link
Member

Choose a reason for hiding this comment

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

this is the case where bucket policy is not found right? let's update the error message accordingly.

@ayushi0014 ayushi0014 changed the base branch from main to maxcompute-provider December 10, 2024 13:48
Base automatically changed from maxcompute-provider to main December 16, 2024 03:44
@rahmatrhd rahmatrhd merged commit df093f6 into main Dec 16, 2024
6 checks passed
@rahmatrhd rahmatrhd deleted the oss-provider branch December 16, 2024 04:21
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