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 docs for protected storage level #626

Merged
merged 4 commits into from
Apr 20, 2018
Merged

add docs for protected storage level #626

merged 4 commits into from
Apr 20, 2018

Conversation

ceich
Copy link
Contributor

@ceich ceich commented Apr 11, 2018

I noticed that the code in Storage.ts supports protected content, while the docs do not. I added minimal content to docs files, and updated the api comments in Storage.ts.

Note: I had to use git commit -n because the tests look to have been broken by previous commits.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ceich ceich requested a review from mbahar as a code owner April 11, 2018 00:25
@codecov-io
Copy link

codecov-io commented Apr 11, 2018

Codecov Report

Merging #626 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #626   +/-   ##
=======================================
  Coverage   87.28%   87.28%           
=======================================
  Files          72       72           
  Lines        3428     3428           
  Branches      652      652           
=======================================
  Hits         2992     2992           
  Misses        419      419           
  Partials       17       17
Impacted Files Coverage Δ
packages/aws-amplify/src/Storage/Storage.ts 96.21% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2283a9b...1905785. Read the comment docs.

@ceich
Copy link
Contributor Author

ceich commented Apr 14, 2018

After some experimentation and code-reading, I'm having trouble figuring out how one user might easily access another's protected storage items, since the Storage class hardcodes the current user's identity pool id in the _prefix() function.

It may not be worth adding protected to the docs unless there is a workaround.

My workaround would be to use the public level, and add my own prefixes (e.g. Cognito user pool sub values), to share files between users.

@mlabieniec mlabieniec requested a review from powerful23 April 19, 2018 20:38
@mlabieniec
Copy link
Contributor

@powerful23 does your pr for configurable prefixes address this?

@mlabieniec mlabieniec requested a review from nidsharm April 19, 2018 20:38
@powerful23
Copy link
Contributor

We need provide an option for people to pass idenetityId so that we can construct a path to get the object. For now users can only put or delete. The docs seems fine to me.

@mlabieniec
Copy link
Contributor

@powerful23 does this pr address that?
#665

@powerful23
Copy link
Contributor

@mlabieniec no that's about auth. What I mean is to do like

Storage.get(path, file, {
   level: 'protected', 
   identityId: 'XXXXXXX',
   ....
});

In that way one is able to read other's protected object

@mlabieniec mlabieniec merged commit 652c2ab into aws-amplify:master Apr 20, 2018
@ceich
Copy link
Contributor Author

ceich commented Apr 20, 2018

Thanks, waiting for identityId option so I can make use of protected!

@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants