-
Notifications
You must be signed in to change notification settings - Fork 553
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
Add policy links command #1943
Add policy links command #1943
Conversation
Current coverage is 8.53% (diff: 0.00%)@@ master #1943 diff @@
========================================
Files 82 82
Lines 6508 6559 +51
Methods 0 0
Messages 0 0
Branches 0 0
========================================
Hits 560 560
- Misses 5814 5865 +51
Partials 134 134
|
3ee7f0d
to
c7a0376
Compare
This PR is ready for review, the only existing problem is that it accepts --recursive and --json flag when they are before 'links' command and not after, let's discuss other issues if found first. |
6. List policies set to a specified bucket. | ||
$ mc {{.Name}} list s3/shared | ||
|
||
7. List public objects recursively. |
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.
"List public object URLs recursively."
// policyLinksMessage is container for policy links command | ||
type policyLinksMessage struct { | ||
Status string `json:"status"` | ||
FullURL string `json:"fullURL"` |
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.
Just URL is fine.
msg := policyLinksMessage{} | ||
msg.Status = "success" | ||
// Convert any os specific delimiters to "/". | ||
msg.FullURL = filepath.ToSlash(content.URL.String()) |
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.
Don't do 'ToSlash' for URLs on windows the output will have '' which is unexpected.
// Convert any os specific delimiters to "/". | ||
msg.FullURL = filepath.ToSlash(content.URL.String()) | ||
if content.Type.IsDir() { | ||
msg.Type = "folder" |
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 can skip the 'CommonPrefix' since that is not useful in downloading the object itself.
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 can remove the Type itself it just prints fully qualified object URLs.
c7a0376
to
ad73e92
Compare
All comments are addressed |
Fixes #1873