Skip to content

Commit

Permalink
Release v0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MikelElizondo committed Mar 19, 2024
1 parent 9f470a2 commit 9e1f9b3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ file. This change log follows the conventions of

## [Unreleased]

## [0.7.1] - 2024-03-19
### Added
- Add option to upload files with specific ACL
- Add the option to get public URL

## [0.7.0] - 2023-05-07
### Changed
- Bump `integrant`, `amazonica` and AWS Java SDK dependencies.
Expand Down Expand Up @@ -67,7 +72,8 @@ file. This change log follows the conventions of
### Changed
- Use the protocol definition in [dev.gethop.object-storage.core](https://github.com/gethop-dev/object-storage.core) instead of a local definition (it doesn't affect the functionality).

[Unreleased]: https://github.com/gethop-dev/object-storage.s3/compare/v0.7.0...HEAD
[Unreleased]: https://github.com/gethop-dev/object-storage.s3/compare/v0.7.1...HEAD
[0.7.1]: https://github.com/gethop-dev/object-storage.s3/releases/tag/v0.7.1
[0.7.0]: https://github.com/gethop-dev/object-storage.s3/releases/tag/v0.7.0
[0.6.10]: https://github.com/gethop-dev/object-storage.s3/releases/tag/v0.6.10
[0.6.9]: https://github.com/gethop-dev/object-storage.s3/releases/tag/v0.6.9
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This library provides a single Integrant key, `:dev.gethop.object-storage/s3`, t
* `:bucket-name`: A string with the name of the bucket where we want to perform S3 operations. This key is mandatory.
* `:presigned-url-lifespan`: A number with the lifespan for the presigned URLs. It is specified in minutes (fractional values can be used). This key is optional. If not provided, the default value is one hour.
* `:endpoint`: A string with the URL of the S3 service endpoint the adapter will use. This key is optional. If not provided, the endpoint is determined by the AWS SDK (using its own standard criteria).
* `:explicit-object-acl`: A map with the ACL configuration the adapter will use to create all new objects. The key is optional. If not provided, objects will inherit the access configuration of the bucket.

Example configuration, with a presigned URL life span of 30 minutes:

Expand All @@ -35,6 +36,15 @@ Another example configuration, with a presigned URL life span of 10 minutes, spe
:endpoint "https://s3.rbx.io.cloud.ovh.net"}
```

Another example configuration, with a presigned URL life span of 15 minutes, specifying a particular endpoint (for the S3-compatible OVH Object Storage service in this case) and with an ACL policy set to allow all users to `Read` the object:

``` edn
:dev.gethop.object-storage/s3 {:bucket-name "ovh-object-store-bucket"
:presigned-url-lifespan 15
:endpoint "https://s3.rbx.io.cloud.ovh.net"
:explicit-object-acl {:grant-permission ["AllUsers" "Read"]}}
```

### Performing S3 object operations

We need to require the `dev.gethop.object-storage.core` namespace to get the `ObjectStorage` protocol definition.
Expand Down Expand Up @@ -335,6 +345,7 @@ user> (object-storage/get-object-url s3-boundary "some-s3-key")
- `:filename`: Specifies the filename that will be included in the "Content-Disposition" header for `:read` requests. It allows retrieving the object with a different name that the S3 key it was stored under.
- `:content-type`: Specifies the value that will be included in the "Content-Type" header. Uses "application/octet-stream" as default if unspecified. Requires `filename` to be present in the opts.
- `:content-disposition`: Specifies the value that will be included in the "Content-Disposition" header. Has to be either `:inline` or `:attachment`. Defaults to `:attachment`. Requires `filename` to be present in the opts.
- `:object-public-url?`: A boolean that specifies if the URL given by this function is going to be a public accessible one, instead of presigned. This only give us the url, the object should be accessible this way for this URL work.
* return value: a map with the following keys:
- `:success?`: boolean stating if the operation was successful or not.
- `:object-url`: If the operation was successful, this key contains a string with a presigned URL that can be used to get the specified object without authentication, but only within the configured lifespan. In addition, the presigned URL is only valid for GET requests.
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject dev.gethop/object-storage.s3 "0.7.1-SNAPSHOT"
(defproject dev.gethop/object-storage.s3 "0.7.1"
:description "A Duct library for managing AWS S3 objects"
:url "https://github.com/gethop-dev/object-storage.s3"
:license {:name "Mozilla Public Licence 2.0"
Expand Down

0 comments on commit 9e1f9b3

Please sign in to comment.