Skip to content

Commit

Permalink
0.28.0 (durch#238)
Browse files Browse the repository at this point in the history
* aws-creds: default to a 30-second request timeout

No (infinite) timeout is a bad default.

* aws-creds: return the previous timeout when overriding

The value is global, so it's not always possible to restore a previous
setting value, but it's better than nothing.

* Simplify instance detection

* Add ap-east-1 region (durch#235)

Co-authored-by: Juraj Sadel <[email protected]>

* Fix crates.io badge, update links and various formatting (durch#219)

* Make all fail-on-err variations run the same check (durch#233)

* Make attohttpc optional for credentials (durch#231)

* Make attohttpc optional for credentials

* Enabling tls implies enabling http

* Use async write for tokio,async-std (durch#230)

* Fix tokio async doctest

* Add support for the older ListObjects API (durch#229)

Google Cloud Storage doesn't support the newer ListObjectsV2 call.

* If file is smaller than one chunk, don't initiate multi-part upload (durch#228)

There already was a special case in put_object_stream() for a small files,
where the multi-part upload was aborted if the input turned out to be
small enough to fit in one chunk. But we can do better than that, and not
initiate the multi-part upload in the first place, avoiding two round
trips to S3 (one to initiate, and another to abort the multi-part upload).

While we're at it, refactor the loop slightly.

* Fix blocking tests

* Make minidom dependency optional (durch#226)

* Fix a typo

* Make minidom dependency optional

* Import futures-io crate directly instead of through futures (durch#227)

* Revert "Import futures-io crate directly instead of through futures (durch#227)"

This reverts commit 7b2e3a0.

* Stream is flaky with rustls-tls

* Implements durch#223

* s3/bucket: default to 30-second request timeout (durch#221)

No (infinite) timeout is a bad default.

* aws-creds 0.27.0

* aws-region 0.23.3

* Import futures-* crates directly instead of through futures (durch#237)

* 0.28.0

* No *s

Co-authored-by: Paul Khuong <[email protected]>
Co-authored-by: Drazen Urch <[email protected]>
Co-authored-by: JurajSadel <[email protected]>
Co-authored-by: Juraj Sadel <[email protected]>
Co-authored-by: Alex Touchet <[email protected]>
Co-authored-by: Riley <[email protected]>
Co-authored-by: Heikki Linnakangas <[email protected]>
Co-authored-by: Jonas Platte <[email protected]>
  • Loading branch information
9 people authored Nov 11, 2021
1 parent c00a186 commit c0eb909
Show file tree
Hide file tree
Showing 17 changed files with 423 additions and 242 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
.idea/
test.file
Expand Down
24 changes: 12 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ We love your input! We want to make contributing to this project as easy and tra
- Submitting a fix
- Proposing new features

## We Develop with Github
We use github to host code, to track issues and feature requests, as well as accept pull requests.
## We Develop With GitHub
We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.

## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:
## We Use [GitHub Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
Pull requests are the best way to propose changes to the codebase (we use [GitHub flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:

1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests.
Expand All @@ -19,20 +19,20 @@ Pull requests are the best way to propose changes to the codebase (we use [Githu
5. Make sure your code lints.
6. Issue that pull request!

## Any contributions you make will be under the MIT Software License
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.
## Any Contributions You Make Will Be Under the MIT Software License
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](https://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using Github's [issues](https://github.com/briandk/transcriptase-atom/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](); it's that easy!
## Report Bugs Using GitHub's [Issues](https://github.com/durch/rust-s3/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/durch/rust-s3/issues/new); it's that easy!

## Write bug reports with detail, background, and sample code
## Write Bug Reports With Detail, Background, and Sample Code

**Great Bug Reports** tend to have:
**Great bug reports** tend to have:

- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- Give sample code if you can
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
Expand All @@ -47,4 +47,4 @@ People *love* thorough bug reports. I'm not even kidding.
By contributing, you agree that your contributions will be licensed under its MIT License.

## References
This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md)
55 changes: 28 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![](https://camo.githubusercontent.com/2fee3780a8605b6fc92a43dab8c7b759a274a6cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72757374632d737461626c652d627269676874677265656e2e737667)](https://www.rust-lang.org/downloads.html)
[![](https://camo.githubusercontent.com/2fee3780a8605b6fc92a43dab8c7b759a274a6cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72757374632d737461626c652d627269676874677265656e2e737667)](https://www.rust-lang.org/tools/install)
[![build](https://github.com/durch/rust-s3/workflows/build/badge.svg)](https://github.com/durch/rust-s3/actions)
[![](http://meritbadge.herokuapp.com/rust-s3)](https://crates.io/crates/rust-s3)
[![](https://img.shields.io/crates/v/rust-s3.svg)](https://crates.io/crates/rust-s3)
![](https://img.shields.io/crates/d/rust-s3.svg)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/durch/rust-s3/blob/master/LICENSE.md)
<!-- [![Join the chat at https://gitter.im/durch/rust-s3](https://badges.gitter.im/durch/rust-s3.svg)](https://gitter.im/durch/rust-s3?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -->
Expand All @@ -10,15 +10,15 @@ Rust library for working with Amazon S3 or arbitrary S3 compatible APIs, fully c

### Support further development

+ BTC - `3QQdtQGSMStTWEBhe65hPiAWJekXH8n26o`
+ ETH - `0x369Fd06ACc25CCfE0A28BE40018cF3aC38AcdcB6`
+ BTC - `3NtVvyhMQepmcaVmCJURUB54wLBaZzfjci`
+ ETH - `0xfd2643D1A15787D41e61de2620D351Fd232936Af`

### Intro

Modest interface towards Amazon S3, as well as S3 compatible object storage APIs such as Wasabi, Yandex, Minio or Google Cloud Storage.
Supports: `put`, `get`, `list`, `delete`, operations on `tags` and `location`, well as `head`.

Additionally a dedicated `presign_get` `Bucket` method is available. This means you can upload to s3, and give the link to select people without having to worry about publicly accessible files on S3. This also means that you can give people
Additionally a dedicated `presign_get` `Bucket` method is available. This means you can upload to S3, and give the link to select people without having to worry about publicly accessible files on S3. This also means that you can give people
a `PUT` presigned URL, meaning they can upload to a specific key in S3 for the duration of the presigned URL.

**[AWS, Yandex and Custom (Minio) Example](https://github.com/durch/rust-s3/blob/master/s3/bin/simple_crud.rs)**
Expand All @@ -33,28 +33,29 @@ There are a lot of various featuers that enable a wide variaty of use cases, ref
+ `no-verify-ssl` - disable SSL verification for endpoints, useful for custom regions
+ `never-encode-slash` - never encode slashes in paths

##### with `default-features = false`
##### With `default-features = false`

+ `with-async-std` - `async-std` runtime
+ `sync` - no async rutime, `attohttpc` is used for HTTP requests
+ `sync` - no async runtime, `attohttpc` is used for HTTP requests
+ `tags` - required for `Bucket::get_object_tagging`

All runtimes support either `native-tls` or `rustls-tls`, there are features for all combinations, refer to `s3/Cargo.toml` for a complete list
All runtimes support either `native-tls` or `rustls-tls`, there are features for all combinations, refer to `s3/Cargo.toml` for a complete list.

#### Path or subdomain style URLs and headers

`Bucket` struct provides constructors for `path-style` paths, `subdomain` style is the default. `Bucket` exposes methods for configuring and accessing `path-style` configuration. `blocking` feature will generate a `*_blocking` variant of all of the methods listed below.

#### Buckets

| | |
|----------|-----------------------------------------------------------------------------|
| | |
|----------|------------------------------------------------------------------------------------|
| `create` | [async](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.create) |
| `delete` | [async](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.delete) |

#### Presign

| | |
|-------|----------------------------------------------------------------------------------------|
| | |
|-------|-----------------------------------------------------------------------------------------------|
| `PUT` | [presign_put](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.presign_put) |
| `GET` | [presign_get](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.presign_get) |

Expand All @@ -63,50 +64,50 @@ All runtimes support either `native-tls` or `rustls-tls`, there are features for
There are a few different options for getting an object. `sync` and `async` methods are generic over `std::io::Write`,
while `tokio` methods are generic over `tokio::io::AsyncWriteExt`.

| | |
|---------|----------------------------------------------------------------------------------------------------|
| | |
|---------|-----------------------------------------------------------------------------------------------------------|
| `async` | [get_object](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.get_object) |
| `async` | [get_object_stream](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.get_object_stream) |

#### PUT

Each `GET` method has a `PUT` companion `sync` and `async` methods are generic over `std::io::Read`. `async` `stream` methods are generic over `futures::io::AsyncReadExt`, while `tokio` methods are generic over `tokio::io::AsyncReadExt`.
Each `GET` method has a `PUT` companion `sync` and `async` methods are generic over `std::io::Read`. `async` `stream` methods are generic over `futures_io::AsyncReadExt`, while `tokio` methods are generic over `tokio::io::AsyncReadExt`.

| | |
|---------|--------------------------------------------------------------------------------------------------------------------------|
| | |
|---------|---------------------------------------------------------------------------------------------------------------------------------|
| `async` | [put_object](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.put_object) |
| `async` | [put_object_with_content_type](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.put_object_with_content_type) |
| `async` | [put_object_stream](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.put_object_stream) |

#### List

| | |
|---------|--------------------------------------------------------------------------|
| | |
|---------|---------------------------------------------------------------------------------|
| `async` | [list](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.list) |

#### DELETE

| | |
|---------|--------------------------------------------------------------------------------------------|
| | |
|---------|---------------------------------------------------------------------------------------------------|
| `async` | [delete_object](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.delete_object) |

#### Location

| | |
|---------|----------------------------------------------------------------------------------|
| | |
|---------|-----------------------------------------------------------------------------------------|
| `async` | [location](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.location) |

#### Tagging

| | |
|---------|------------------------------------------------------------------------------------------------------|
| | |
|---------|-------------------------------------------------------------------------------------------------------------|
| `async` | [put_object_tagging](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.put_object_tagging) |
| `async` | [get_object_tagging](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.get_object_tagging) |

#### Head

| | |
|---------|----------------------------------------------------------------------------------------|
| | |
|---------|-----------------------------------------------------------------------------------------------|
| `async` | [head_object](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.head_object) |

### Usage (in `Cargo.toml`)
Expand Down
9 changes: 5 additions & 4 deletions aws-creds/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aws-creds"
version = "0.26.2"
version = "0.27.1"
authors = ["Drazen Urch"]
description = "Tiny Rust library for working with Amazon IAM credential,s, supports `s3` crate"
repository = "https://github.com/durch/rust-s3"
Expand All @@ -18,7 +18,7 @@ path = "src/lib.rs"
anyhow = "1.0"
dirs = "4"
rust-ini = "0.17"
attohttpc = { version = "0.17", default-features = false, features = ["json"] }
attohttpc = { version = "0.18", default-features = false, features = ["json"], optional = true }
url = "2"
serde-xml-rs = "0.5"
serde = "1"
Expand All @@ -27,8 +27,9 @@ serde_derive = "1"

[features]
default = ["native-tls"]
native-tls = ["attohttpc/tls"]
rustls-tls = ["attohttpc/tls-rustls"]
http-credentials = ["attohttpc"]
native-tls = ["http-credentials", "attohttpc/tls"]
rustls-tls = ["http-credentials", "attohttpc/tls-rustls"]

[dev-dependencies]
env_logger = "0.9"
Loading

0 comments on commit c0eb909

Please sign in to comment.