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

Add policy links command #1943

Merged
merged 1 commit into from
Jan 4, 2017
Merged

Conversation

vadmeste
Copy link
Member

@vadmeste vadmeste commented Jan 2, 2017

Fixes #1873

@codecov-io
Copy link

codecov-io commented Jan 2, 2017

Current coverage is 8.53% (diff: 0.00%)

Merging #1943 into master will decrease coverage by 0.06%

@@            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          

Powered by Codecov. Last update 5581915...ad73e92

@vadmeste vadmeste force-pushed the add_links_cmd branch 2 times, most recently from 3ee7f0d to c7a0376 Compare January 3, 2017 19:33
@vadmeste vadmeste changed the title [WIP] Add policy links command Add policy links command Jan 3, 2017
@vadmeste
Copy link
Member Author

vadmeste commented Jan 3, 2017

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.
Copy link
Member

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"`
Copy link
Member

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())
Copy link
Member

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"
Copy link
Member

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.

Copy link
Member

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.

@vadmeste
Copy link
Member Author

vadmeste commented Jan 4, 2017

All comments are addressed

@harshavardhana harshavardhana merged commit 66a65aa into minio:master Jan 4, 2017
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.

3 participants