-
Notifications
You must be signed in to change notification settings - Fork 288
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
To enable spaces in policy names #3482
Conversation
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.
@cniackz PTAL at the validSave
cause the validation you changed checks while typing but during save we run a different logic and the same validation is there.
const validSave =
policyName.trim() !== "" &&
policyName.indexOf(" ") === -1 &&
policyDefinition.trim() !== "";
Shouldn't we change MinIO/STS instead, because policy names have the following limitation in AWS IAM (source):
|
c47cd53
to
cacf53c
Compare
@cesnietor, you were right—additional changes were needed for this to work completely. I have made all the necessary adjustments and tested them. |
@ramondeklein, that’s a good question. Since this is already supported by mc, I’m unsure how to proceed. I’ve added @ramondeklein and @harshavardhana to help determine the best course of action. |
cacf53c
to
56e5d1b
Compare
It's hard to change now, because people may already use these names, so disallowing now is hard. We are S3 compatible, not IAM compatible, so deviating from AWS IAM isn't a real issue. Let's be practical and make sure we're compatible with our implementation. |
Understood, @ramondeklein. I’ll leave this change up to you. Please approve and merge if you think it’s fine to proceed, or add any additional comments if you believe we shouldn’t or have a different perspective. Thanks! |
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.
I think it's bad to perform validations in the AIStor back-end. These checks should be done by MinIO itself.
@cniackz I can't create a new policy the Save button never gets enabled |
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.
Why it does not work for you?... I need time to figure this out as it worked for me, we can synch on this later 👍 |
@cesnietor, I’m still unsure why it’s not working for you. I retested everything from scratch and was able to create the policy with spaces in the name. Here’s the screenshot: Would you mind pairing up this afternoon to look into this together? The steps I used for testing are documented in this wiki: How to test console UI. |
56e5d1b
to
7a4b6db
Compare
Okay, I’ve made all the requested changes, and everything works as expected. Later today, I’ll pair with Nieto to review this and determine if anything else is missing. |
tested works as expected. |
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
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.
Can you please help us to review
policy_test.go:237:
Error Trace: /home/runner/work/console/console/integration/policy_test.go:237
Error: Not equal:
expected: 400
actual : 201
Test: Test_AddPolicyAPI
Messages: Create Policy - Space in Name Failed
Seems like this test should be reworked, beside of that LGTM. Thank you very much
Sure Benjamin, let look into that test deeper |
The issue at I will re-run this test to ensure the failure is replicable. Simultaneously, I will create an empty PR to verify if the failure was introduced in this PR. |
Haha, well, it’s obvious just by looking at the log:
|
7a4b6db
to
3cf20fd
Compare
Now waiting for the tests to complete. If everything passes, I’ll request another round of reviews to finalize this. |
Ok, @cesnietor and I have reviewed this test, and the failure is unrelated. Therefore, this PR is now ready for review: |
fix-1 fix-2 fix-3 fix-4 fix-5 fix-6 fix-7 fix-8 fix-9 fix-10 Lint fix.10 fix-11 removed more stuff Fixed errors fixes-12 display objects info added types and initial top bar Update Bar Updated mds version Update latest More integration fixes Update mds more fixes migrated to redux types Added missing components more migrations updates tabs information adjusts arrow-positioning fix select check asdf Updated delete modal fix inspect modal Update Retention modal asdf Update Legal Hold modal screen Share mdoal fix update preview adjustments more fixes Delete Tag fix
fix-1 fix-2 fix-3 fix-4 fix-5 fix-6 fix-7 fix-8 fix-9 fix-10 Lint fix.10 fix-11 removed more stuff Fixed errors fixes-12 display objects info added types and initial top bar Update Bar Updated mds version Update latest More integration fixes Update mds more fixes migrated to redux types Added missing components more migrations updates tabs information adjusts arrow-positioning fix select check asdf Updated delete modal fix inspect modal Update Retention modal asdf Update Legal Hold modal screen Share mdoal fix update preview adjustments more fixes Delete Tag fix
Since
mc
allows them:mc admin policy create play "1Password IT" mypolicy.json