Amazon S3 Access Grants plugin for boto3
Amazon S3 Access Grants Plugin provides the functionality to enable S3 customers to configure S3 ACCESS GRANTS as a permission layer on top of the S3 Clients.
S3 Access Grants is a feature from S3 that allows its customers to configure fine-grained access permissions for the data in their buckets.
Installing the plugin
Run this command to install the plugin.
pip install aws-s3-access-grants-boto3-plugin==<Latest_Version>
Using the plugin
- Create your S3 Client.
- Create a S3AccessGrantsPlugin object and pass the S3 Client and fallback option during initialization.
- Register the plugin.
import botocore.session
from aws_s3_access_grants_boto3_plugin.s3_access_grants_plugin import S3AccessGrantsPlugin
session = botocore.session.get_session()
s3_client = session.create_client('s3')
plugin = S3AccessGrantsPlugin(s3_client, fallback_enabled=True, customer_session=session)
plugin.register()
fallback_enabled takes in a boolean value. This option decides if we will fall back to the credentials set on the S3 Client by the user.
- If fallback_enabled is set to True then we will fall back every time we are not able to get the credentials from Access Grants, no matter the reason.
- If fallback_enabled option is set to False we will fall back only in case the operation/API is not supported by Access Grants.
Note that fallback_enabled can be passed while creating the plugin (as showed in example above). If fallback_enabled is not set, we will default to False.
customer_session is an optional parameter of type botocore.session.Session. This session will be used to create the internal sts, s3, and s3control clients. If no session is passed the default botocore session will be used to create these clients.
Notes
- The plugin supports delete_objects API and copy_object API which S3 Access Grants does not implicitly support. For these APIs we get the common prefix of all the object keys and find their common ancestor. If you have a grant present on the common ancestor, you will get Access Grants credentials based on that grant. For copy_object API the source and destination buckets should be same, since a grant cannot give access to multiple buckets.
- The plugin's support for a specific python version is inline with the minimum python version requirements of botocore. This is to ensure that our customers are always getting the latest security and feature updates of botocore.
Contributions
- See CONTRIBUTING.md
License
This project is licensed under the Apache-2.0 License.
Metadata
Release files for aws-s3-access-grants-boto3-plugin 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aws_s3_access_grants_boto3_plugin-1.3.0.tar.gz | 20.4 kB | Without provenance | Details for aws_s3_access_grants_boto3_plugin-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aws_s3_access_grants_boto3_plugin-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for aws_s3_access_grants_boto3_plugin-1.3.0-py3-none-any.whl |
Total release size: 35.2 kB
Release files / aws_s3_access_grants_boto3_plugin-1.3.0.tar.gz
| Download URL | aws_s3_access_grants_boto3_plugin-1.3.0.tar.gz |
|---|---|
| Size | 20.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83fab0f08dd5c1a0508a4df1a43ada1128a51b4f7fb12c8c1e1650089e029940
|
|
BLAKE2b-256 checksum How to use checksums |
418add2c9c9b31f57ef87a2d30fa55c0d65147f58ef3bfa00619a64915e6f88a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / aws_s3_access_grants_boto3_plugin-1.3.0-py3-none-any.whl
| Download URL | aws_s3_access_grants_boto3_plugin-1.3.0-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0aaf009d98b91bd28822ca7773f35ca55e911177d43fc44b72a5f213e99c8382
|
|
BLAKE2b-256 checksum How to use checksums |
5c86b4e6cb3eb5bf46fe5e16dbf5f5e81ed27727f66f0d77abefacb7006869d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Security for aws-s3-access-grants-boto3-plugin 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.