You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGELOG.md
+23-7
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
7
7
## [Unreleased]
8
8
9
+
## [0.20.0] - 2024-02-12
10
+
### Fixed
11
+
- Remove deprecation warnings due to usage of `utcnow` and `utcfromtimestamp`. Thanks to [`Raphael Krupinski`](https://github.com/rafalkrupinski).
12
+
-`httpx_auth.AWS4Auth.default_include_headers` value kept growing in size every time a new `httpx_auth.AWS4Auth` instance was created with `security_token` parameter provided. Thanks to [`Miikka Koskinen`](https://github.com/miikka).
13
+
-`httpx_auth.AWS4Auth` is now based almost entirely on AWS documentation, diverging from the original implementation based on `requests-aws4auth` and solving implementation issues in the process.
14
+
- As the AWS documentation might be wrong or not exhaustive enough, feel free to open issues, should you encounter edge cases.
15
+
16
+
### Changed
17
+
-`httpx_auth.AWS4Auth.default_include_headers` is not available anymore, use `httpx_auth.AWS4Auth``include_headers` parameter instead to include additional headers if the default does not fit your need (refer to documentation for an exhaustive list).
18
+
-`httpx_auth.AWS4Auth``include_headers` values will not be stripped anymore, meaning that you can now include headers prefixed and/or suffixed with blank spaces.
19
+
-`httpx_auth.AWS4Auth` does not includes `date` header by default anymore. You will have to provide it via `include_headers` yourself if you need to.
20
+
- Note that it should not be required as `httpx_auth.AWS4Auth` is sending `x-amz-date` by default and AWS documentation states that the request date can be specified by using either the HTTP `Date` or the `x-amz-date` header. If both headers are present, `x-amz-date` takes precedence.
21
+
-`httpx_auth.AWS4Auth``include_headers` does not needs to include `host`, `content-type` or `x-amz-*` anymore as those headers will always be included. It is now expected to be provided as a list of additional headers.
22
+
-`httpx_auth.AWS4Auth` will not modify the headers values spaces when computing the canonical headers, only trim leading and trailing whitespaces as per AWS documentation.
23
+
9
24
## [0.19.0] - 2024-01-09
10
25
### Added
11
26
- Explicit support for Python 3.12
@@ -112,7 +127,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
112
127
113
128
### Changed
114
129
-`get_token` cache method now requires `on_missing_token` function args to be provided as kwargs instead of args.
115
-
-`get_token` cache method now requires `on_missing_token` parameter to be provided as a nonpositional argument.
130
+
-`get_token` cache method now requires `on_missing_token` parameter to be provided as a non-positional argument.
116
131
-`get_token` cache method now expose `early_expiry` parameter, defaulting to 30 seconds.
117
132
118
133
### Fixed
@@ -164,13 +179,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
164
179
### Added
165
180
- Still under development, subject to breaking changes without notice: `AWS4Auth` authentication class for AWS. Ported from [`requests-aws4auth`](https://github.com/sam-washington/requests-aws4auth) by [`Michael E. Martinka`](https://github.com/martinka).
166
181
Note that a few changes were made:
167
-
-deprecated`amz_date` attribute has been removed.
168
-
-it is not possible to provide an `AWSSigningKey` instance, use explicit parameters instead.
169
-
-it is not possible to provide a `date`. It will default to now.
170
-
-it is not possible to provide `raise_invalid_date` parameter anymore as the date will always be valid.
182
+
-Deprecated`amz_date` attribute has been removed.
183
+
-It is not possible to provide an `AWSSigningKey` instance, use explicit parameters instead.
184
+
-It is not possible to provide a `date`. It will default to now.
185
+
-It is not possible to provide `raise_invalid_date` parameter anymore as the date will always be valid.
171
186
-`include_hdrs` parameter was renamed into `include_headers`
172
187
-`host` is not considered as a specific Amazon service anymore (no test specific code).
173
-
- Each request now has it's own signing key and x-amz-date. Meaning you can use the same auth instance for more than one request.
188
+
- Each request now has its own signing key and `x-amz-date`. Meaning you can use the same auth instance for more than one request.
174
189
-`session_token` was renamed into `security_token` for consistency with the underlying name at Amazon.
175
190
176
191
## [0.3.0] - 2020-05-26
@@ -193,7 +208,8 @@ Note that a few changes were made:
Amazon Web Service Signature version 4 is implemented following [Amazon S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html) and [request-aws4auth](https://github.com/sam-washington/requests-aws4auth).
671
+
Amazon Web Service Signature version 4 is implemented following [Amazon S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html) and [request-aws4auth 1.2.3](https://github.com/sam-washington/requests-aws4auth) (with some changes, see below).
671
672
672
673
Use `httpx_auth.AWS4Auth` to configure this kind of authentication.
673
674
@@ -680,15 +681,31 @@ with httpx.Client() as client:
Note that the following changes were made compared to `requests-aws4auth`:
685
+
- Each request now has its own signing key and `x-amz-date`. Meaning **you can use the same auth instance for more than one request**.
686
+
-`session_token` was renamed into `security_token` for consistency with the underlying name at Amazon.
687
+
-`include_hdrs` parameter was renamed into `include_headers`. When using this parameter:
688
+
- Provided values will not be stripped, [WYSIWYG](https://en.wikipedia.org/wiki/WYSIWYG).
689
+
- If multiple values are provided for a same header, the computation will be based on the value order you provided and value separated by `, `. Instead of ordered values separated by comma for `requests-aws4auth`.
690
+
-`amz_date` attribute has been removed.
691
+
- It is not possible to provide a `date`. It will default to now.
692
+
- It is not possible to provide an `AWSSigningKey` instance, use explicit parameters instead.
693
+
- It is not possible to provide `raise_invalid_date` parameter anymore as the date will always be valid.
694
+
-`host` is not considered as a specific Amazon service anymore (no test specific code).
695
+
- Canonical query string computation is entirely based on AWS documentation (and consider undocumented fragment (`#` and following characters) as part of the query string).
696
+
- Canonical uri computation is entirely based on AWS documentation.
697
+
- Canonical headers computation is entirely based on AWS documentation.
698
+
683
699
### Parameters
684
700
685
-
| Name | Description | Mandatory | Default value |
|`region`| The region you are connecting to, as per [this list](http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region). For services which do not require a region (e.g. IAM), use us-east-1. | Mandatory ||
690
-
|`service`| The name of the service you are connecting to, as per [this list](http://docs.aws.amazon.com/general/latest/gr/rande.html). e.g. elasticbeanstalk. | Mandatory ||
691
-
|`security_token`| Used for the `x-amz-security-token` header, for use with STS temporary credentials. | Optional ||
701
+
| Name | Description | Mandatory | Default value |
|`region`| The region you are connecting to, as per [this list](http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region). For services which do not require a region (e.g. IAM), use us-east-1. | Mandatory ||
706
+
|`service`| The name of the service you are connecting to, as per [this list](http://docs.aws.amazon.com/general/latest/gr/rande.html). e.g. elasticbeanstalk. | Mandatory ||
707
+
|`security_token`| Used for the `x-amz-security-token` header, for use with STS temporary credentials. | Optional ||
708
+
|`include_headers`| Set of headers to include in the canonical and signed headers (in addition to the default). Note that `x-amz-client-context` is not included by default and `*` will include all headers. | Optional | {"host", "content-type", "x-amz-*"} and if `security_token` is provided, `x-amz-security-token`. |
692
709
693
710
## API key in header
694
711
@@ -859,7 +876,7 @@ import datetime
859
876
from httpx_auth.testing import browser_mock, BrowserMock, create_token
0 commit comments