-
Notifications
You must be signed in to change notification settings - Fork 299
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
StorageBrowser RFC #5731
Comments
looks awesome. I'm now desperate to see examples of validation / feedback of the upload. for example, after uploading a CSV, a table listing the rows, together with valid/invalid. |
Very nice, would be even more awesome if a simple search functionality based on s3 prefixes were added. |
Great feature, very impressed
Looking forward to the release! |
Just set up the Storage Browser in my environment, and I'm loving it! a couple of questions:
|
Awesome package, can this use cdn(cloudfront) for file browsing and downloading and keep the bucket read access only on cdn and do we have multi bucket support |
Hello @reesscot , Great feature! Could you please provide an approximate target date for the release of the production-ready version? |
Really nice RFC 👍 Looking forward to it! Feature Request:
|
Nice, looks super exciting
Thanks :) |
AWS S3 SDK provides an "endpoint" parameter, can we configure that with this new UI browser ?
|
Need some help guys, not able to run it :(
Usage
amplify/storage/resource.ts
What I am missing ? What I am doing wrong ? Getting this error always when attempting to build/run the project :(
Is this an error with
|
@reesscot , do you have somewhere published a working version/project/template of this RFC please ? |
@scorobogaci It looks like you're getting the wrong versions of the dependencies somehow, can you try forcing the storage-browser version of the
Alternatively, you could try this example repo which we've been testing with on Next.js: https://github.com/reesscot/nextjs-storage-browser |
@tttol @scorobogaci In regards to the styling questions, can you tell me what order you are imported the CSS in? Also, do you have any other CSS styling that might be conflicting in your app? |
Perfect, thanks a lot @reesscot , explicitly adding |
thanks for the hint @reesscot . I have imported the styles in the component directly Final simple component looks like this and works fine 👍
|
Sample is not reachable, 404 |
@scorobogaci Sorry about that, I just made this example repo and was able to get it running and deployed to Amplify Hosting. |
@reesscot , I see you've edited a bit the setup by adding
explicitly Man, can you please review this setup and this tag/RFC so that is work with other components of the Amplify please ? It is becoming a nightmare already |
@scorobogaci Can you please try out the example repo app? The What issues are you having with deploying changes? When I've had issues with deploying changes to the storage definitions, it's usually been a missing command in the amplify.yml file. Specifically check to make sure you have this line: https://github.com/reesscot/nextjs-storage-browser/blob/main/amplify.yml#L7 |
Alright mate, the issue is ... once you add the package
won't be added to |
ignore this please, I forgot to add |
|
@reesscot Thanks for all the support. I have a doubt, is it possible to use this component to build an app that serves the purpose of an S3 browser where users can access multiple buckets based on their access. |
Yes, you can use S3 Access Grants to create grants for users and groups. The component will list those buckets or prefixes as locations and the user will be able to navigate them. |
@reesscot & @koiker thank you for this needed component! I would request to enable also for CEPH buckets to be used with your opensource component. This will require enable custom endpoints & force pathstyle. I see you already have this enabled for internal usage/development, would be great it is also enabled for StorgaBrowser component. |
Is it possible to deploy storage-browser self-hosted and connect to my ceph cluster or is only Amazon services required? |
@ineplyueva , yes it would be possible if it is enabled through the component configurations (Custom authentication and authorization). Currently the component configs doesn't accept customEndpoint or forcePathStyle. As this functionality is only available for internal development. Hey @reesscot & @koiker, any feedback or comments on this would be highly appreciated. |
Are there any examples of how to make this work? Getting S3 Access Grants set up is OK, but then once that's done there seems like there is quite a bit of logic required to do the token exchange? The example above says...
|
Do you have any plan to support vuejs soon? |
Could someone tell how to use Storage Browser for S3 for an S3 bucket that was not created with Amplify? |
I added storage using backend for the bucket i have created without Amplify, followed this doc to enable CORS on my bucket https://sto-bro-docs.ddzh7dd1jott2.amplifyapp.com/react/connected-components/storage/storage-browser backend.addOutput({ |
I'm using amplify auth and custom bucket for setting up storage browser, I'm trying to use multiple buckets. I have tried setting the storage using backend, getting only the first bucket
I also tried to add storage without using amplify backend, in the amplify configuration, but only getting the first bucket
Can someone point me on how to use storage browser with multiple custom buckets? Thanks |
@KaranamLokesh, yes this is possible. 1. Configuring multiple buckets on storage browser using gen2:
You can follow the existing Add multiple storage buckets to your app using AWS Amplify doc with no additional change to generate the above. You would notice a new 2. Configuring multiple buckets on storage browser (buckets created outside gen2): example:
Note: Also please make sure necessary permission is added to Amplify cognito's auth/unauth IAM roles to access this custom bucket. You can find the auth/unauth IAM roles gen2 created under |
Is it possible to control access on existing S3 depending on the Cognito user group, without using amplify backend? Amplify.configure({
Auth: {
Cognito: {
userPoolId: "xxx",
userPoolClientId: "xxx",
identityPoolId: "xxx",
},
},
Storage: {
S3: {
bucket: 'my-sample-bucket',
region: 'us-east-1',
buckets: {
"first-bucket": {
bucketName: 'my-sample-bucket',
region: 'us-east-1',
paths: {
"private/": {
// ↓ working.
"guest": ["read"],
"authenticated": ["read", "write"],
// ↓ not working. "admin" is a cognito user group name.
"admin": ["read", "write", "delete"]
}
}
}
}
},
},
}); If I can control access depending on the custom attribute of the Cognito, it's perfect... |
Overview
StorageBrowser
for Amazon S3 is an open source Amplify UI React component customers can add to their web applications to provide end-users with a simple interface for data stored in Amazon S3. Using StorageBrowser for S3, customers provide authorized end-users access to easily browse, download, and upload data in Amazon S3 from their own applications. StorageBrowser for S3 only displays the data that your end-users are authorized to access and automatically optimizes requests to deliver high throughput data transfer. You can control access to your data based on your end-user’s identity using AWS security and identity services or your own managed services.StorageBrowser for S3 is currently in developer preview while we collect your feedback before making the component generally available. The API might change while in developer preview so we do not recommend using it in production until it is generally available. We will post updates to this RFC as we make changes to the component.
StorageBrowser for S3 has 3 main views:
1 Installation #
Fork the example repo:
https://github.com/reesscot/nextjs-storage-browser
OR:
You can install StorageBrowser for S3 from tagged versions of the @aws-amplify/ui-react-storage and aws-amplify packages. Add these dependencies to your package.json file:
Or add them via
npm
:We will publish StorageBrowser for S3 to the latest version of these packages once it is generally available.
2 Setting up authentication and authorization #
In order to show S3 locations and their contents to end users, you first need to set up your preferred authentication and authorization methods. There are 3 ways you can set up authentication/authorization with the storage browser component:
Amplify auth
Make sure you have an Amplify project started, by following the getting started guides: https://docs.amplify.aws/react/start/quickstart/. Then create an S3 bucket with access rules by defining a storage resource and adding authorization rules https://docs.amplify.aws/react/build-a-backend/storage/authorization/:
In your frontend code, create the
StorageBrowser
component with the Amplify Auth adapter:Or if you want to use Amplify Auth with prebuilt Amplify UI you can just import the default
StorageBrowser
component and render it:AWS Identity Center and S3 Access Grants
For detailed setup instructions see this blog post: https://aws.amazon.com/blogs/storage/how-to-develop-a-user-facing-data-application-with-iam-identity-center-and-s3-access-grants/
Once you have IAM Identity Center and S3 Access Grants set up, in your React application you can use
createManagedAuthAdapter
to set up the auth rules andcreateStorageBrowser
to create theStorageBrowser
component:Go to step 3
Custom authentication and authorization
You can also use StorageBrowser for S3 with your own authentication and authorization setup. Rather than calling
createManagedAuthAdapter
orcreateAmplifyAuthAdapter
you can directly configure how StorageBrowser for S3 lists S3 locations and gets credentials for each location:3 Rendering the StorageBrowser #
Now that you have created the
StorageBrowser
component using one of the 3 auth methods above, you can place the component into your app:4 Customizing the StorageBrowser #
Composing
StorageBrowser for S3 has 3 main views that can be composed into your application if you want to move around parts of the component:
LocationsView
: initial screen showing a table with all S3 locations a user has access toLocationDetailView
: file browsing view once the user has selected an S3 locationLocationActionView
: view rendered when the user initiates an action like uploading filesFor example, to display the
LocationsView
(locations table) side-by-side with theLocationDetailView
(file browser table) with theLocationActionView
in a dialog:Using a custom UI
createStorageBrowser
improves bundle size by shipping without Amplify UI React Primitives, rendering basic HTML elements by default with only layout styling applied.You can control all of the elements used in the
StorageBrowser
component by passing in elements to thecreateStorageBrowser
function. Elements have a variant prop that is used to signify where that element is being used within the component tree of theStorageBrowser
. For example, theButton
element is used in many different places in theStorageBrowser
UI,variant
allows you control over how your button looks and behaves in different usage scenarios:Here are all the elements that you can override:
Feedback for dev preview #
We are looking for any and all feedback on StorageBrowser for S3. We would love to hear from you about bugs, aspects about the developer experience and APIs that could be improved, additional features and functionality you need, and more. We plan on addressing all of your feedback as it comes in.
Thank you to everyone that made this launch possible: @dbanksdesign @reesscot @calebpollman @timngyn @esauerbo @hbuchel @AllanZhengYP @jimblanc @ashwinkumar6 @Jordan-Nelson @haverchuck
The text was updated successfully, but these errors were encountered: