Skip to content

Commit c0eb909

Browse files
durchPaul KhuongDrazen UrchJurajSadelatouchet
authored
0.28.0 (#238)
* 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 (#235) Co-authored-by: Juraj Sadel <juraj.sadel@espressif.com> * Fix crates.io badge, update links and various formatting (#219) * Make all fail-on-err variations run the same check (#233) * Make attohttpc optional for credentials (#231) * Make attohttpc optional for credentials * Enabling tls implies enabling http * Use async write for tokio,async-std (#230) * Fix tokio async doctest * Add support for the older ListObjects API (#229) Google Cloud Storage doesn't support the newer ListObjectsV2 call. * If file is smaller than one chunk, don't initiate multi-part upload (#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 (#226) * Fix a typo * Make minidom dependency optional * Import futures-io crate directly instead of through futures (#227) * Revert "Import futures-io crate directly instead of through futures (#227)" This reverts commit 7b2e3a0. * Stream is flaky with rustls-tls * Implements #223 * s3/bucket: default to 30-second request timeout (#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 (#237) * 0.28.0 * No *s Co-authored-by: Paul Khuong <pkhuong@backtrace.io> Co-authored-by: Drazen Urch <durch@users.noreply.guthub.com> Co-authored-by: JurajSadel <43887390+JurajSadel@users.noreply.github.com> Co-authored-by: Juraj Sadel <juraj.sadel@espressif.com> Co-authored-by: Alex Touchet <alextouchet@outlook.com> Co-authored-by: Riley <asonix@asonix.dog> Co-authored-by: Heikki Linnakangas <heikki.linnakangas@iki.fi> Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
1 parent c00a186 commit c0eb909

17 files changed

+423
-242
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**/target/
44

55
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
6-
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
6+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
77
Cargo.lock
88
.idea/
99
test.file

CONTRIBUTING.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ We love your input! We want to make contributing to this project as easy and tra
66
- Submitting a fix
77
- Proposing new features
88

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

12-
## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
13-
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:
12+
## We Use [GitHub Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
13+
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:
1414

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

22-
## Any contributions you make will be under the MIT Software License
23-
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.
22+
## Any Contributions You Make Will Be Under the MIT Software License
23+
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.
2424

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

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

30-
**Great Bug Reports** tend to have:
30+
**Great bug reports** tend to have:
3131

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

4949
## References
50-
This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
50+
This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md)

README.md

+28-27
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[![](https://camo.githubusercontent.com/2fee3780a8605b6fc92a43dab8c7b759a274a6cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72757374632d737461626c652d627269676874677265656e2e737667)](https://www.rust-lang.org/downloads.html)
1+
[![](https://camo.githubusercontent.com/2fee3780a8605b6fc92a43dab8c7b759a274a6cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72757374632d737461626c652d627269676874677265656e2e737667)](https://www.rust-lang.org/tools/install)
22
[![build](https://github.com/durch/rust-s3/workflows/build/badge.svg)](https://github.com/durch/rust-s3/actions)
3-
[![](http://meritbadge.herokuapp.com/rust-s3)](https://crates.io/crates/rust-s3)
3+
[![](https://img.shields.io/crates/v/rust-s3.svg)](https://crates.io/crates/rust-s3)
44
![](https://img.shields.io/crates/d/rust-s3.svg)
55
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/durch/rust-s3/blob/master/LICENSE.md)
66
<!-- [![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) -->
@@ -10,15 +10,15 @@ Rust library for working with Amazon S3 or arbitrary S3 compatible APIs, fully c
1010

1111
### Support further development
1212

13-
+ BTC - `3QQdtQGSMStTWEBhe65hPiAWJekXH8n26o`
14-
+ ETH - `0x369Fd06ACc25CCfE0A28BE40018cF3aC38AcdcB6`
13+
+ BTC - `3NtVvyhMQepmcaVmCJURUB54wLBaZzfjci`
14+
+ ETH - `0xfd2643D1A15787D41e61de2620D351Fd232936Af`
1515

1616
### Intro
1717

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

21-
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
21+
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
2222
a `PUT` presigned URL, meaning they can upload to a specific key in S3 for the duration of the presigned URL.
2323

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

36-
##### with `default-features = false`
36+
##### With `default-features = false`
3737

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

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

4344
#### Path or subdomain style URLs and headers
4445

4546
`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.
4647

4748
#### Buckets
4849

49-
| | |
50-
|----------|-----------------------------------------------------------------------------|
50+
| | |
51+
|----------|------------------------------------------------------------------------------------|
5152
| `create` | [async](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.create) |
5253
| `delete` | [async](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.delete) |
5354

5455
#### Presign
5556

56-
| | |
57-
|-------|----------------------------------------------------------------------------------------|
57+
| | |
58+
|-------|-----------------------------------------------------------------------------------------------|
5859
| `PUT` | [presign_put](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.presign_put) |
5960
| `GET` | [presign_get](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.presign_get) |
6061

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

66-
| | |
67-
|---------|----------------------------------------------------------------------------------------------------|
67+
| | |
68+
|---------|-----------------------------------------------------------------------------------------------------------|
6869
| `async` | [get_object](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.get_object) |
6970
| `async` | [get_object_stream](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.get_object_stream) |
7071

7172
#### PUT
7273

73-
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`.
74+
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`.
7475

75-
| | |
76-
|---------|--------------------------------------------------------------------------------------------------------------------------|
76+
| | |
77+
|---------|---------------------------------------------------------------------------------------------------------------------------------|
7778
| `async` | [put_object](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.put_object) |
7879
| `async` | [put_object_with_content_type](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.put_object_with_content_type) |
7980
| `async` | [put_object_stream](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.put_object_stream) |
8081

8182
#### List
8283

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

8788
#### DELETE
8889

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

9394
#### Location
9495

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

99100
#### Tagging
100101

101-
| | |
102-
|---------|------------------------------------------------------------------------------------------------------|
102+
| | |
103+
|---------|-------------------------------------------------------------------------------------------------------------|
103104
| `async` | [put_object_tagging](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.put_object_tagging) |
104105
| `async` | [get_object_tagging](https://docs.rs/rust-s3/latest/s3/bucket/struct.Bucket.html#method.get_object_tagging) |
105106

106107
#### Head
107108

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

112113
### Usage (in `Cargo.toml`)

aws-creds/Cargo.toml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-creds"
3-
version = "0.26.2"
3+
version = "0.27.1"
44
authors = ["Drazen Urch"]
55
description = "Tiny Rust library for working with Amazon IAM credential,s, supports `s3` crate"
66
repository = "https://github.com/durch/rust-s3"
@@ -18,7 +18,7 @@ path = "src/lib.rs"
1818
anyhow = "1.0"
1919
dirs = "4"
2020
rust-ini = "0.17"
21-
attohttpc = { version = "0.17", default-features = false, features = ["json"] }
21+
attohttpc = { version = "0.18", default-features = false, features = ["json"], optional = true }
2222
url = "2"
2323
serde-xml-rs = "0.5"
2424
serde = "1"
@@ -27,8 +27,9 @@ serde_derive = "1"
2727

2828
[features]
2929
default = ["native-tls"]
30-
native-tls = ["attohttpc/tls"]
31-
rustls-tls = ["attohttpc/tls-rustls"]
30+
http-credentials = ["attohttpc"]
31+
native-tls = ["http-credentials", "attohttpc/tls"]
32+
rustls-tls = ["http-credentials", "attohttpc/tls-rustls"]
3233

3334
[dev-dependencies]
3435
env_logger = "0.9"

0 commit comments

Comments
 (0)