Commit graph

103 commits

Author SHA1 Message Date
cduvray
5284ff72aa refactor: JwtAuthorizer -> AuthorizerBuilder
- renaming
- type JwtAuthorizer for backward compatibility
2023-09-18 08:30:14 +02:00
cduvray
f452f15b0b
Merge pull request #35 from cduvray/refactor
refactor: renaming, reorganising
2023-09-18 08:28:56 +02:00
cduvray
4a3077fa3a refactor: extract JwtAuthorizer in builder.rs
- JwtAuthorizer is in fact a builder, it may be renamed in future
2023-09-10 09:01:51 +02:00
cduvray
850bab9a0a refactor: internal renaming (simplifications)
- AsyncAuthorizationLayer -> AuthorizationLayer
- AsyncAuthorizationService -> AuthorizationService
- AsyncAuthorizer (trait) -> Authorize
2023-09-10 09:00:56 +02:00
cduvray
da56a83c29
Merge pull request #34 from cduvray/release
chore: release 0.11.0
2023-09-06 07:43:46 +02:00
cduvray
310444007d chore: release 0.11.0 2023-09-06 07:32:58 +02:00
cduvray
6adce03c17 feat: implement into_layer for Arc<...> 2023-09-05 07:43:25 +02:00
cduvray
44bdc8ad4c
Merge pull request #33 from cduvray/ci-fix
fix: ci test (pinned: 1.68)
2023-09-05 07:38:01 +02:00
cduvray
6f2ca786c0 fix: ci test (pinned: 1.68)
- minimal rust version 1.68 (wiremock issue)
2023-09-04 18:59:44 +02:00
cduvray
2e1ba38419 build: minimal rust version 1.67.0 for CI tests
- time cratee requires 1.67.0 minimum
2023-09-04 08:56:50 +02:00
cduvray
c27f38138a fix: clippy warnings 2023-09-04 08:52:15 +02:00
cduvray
ad3d846175 build: re-enable, nightly build tests 2023-09-04 08:43:07 +02:00
cduvray
0738ec13ea chore: deps update 2023-08-25 08:08:33 +02:00
cduvray
5098e34b96
Merge pull request #23 from cduvray/multiple-authorizers2
feat: multiple authorizers
2023-08-24 07:55:13 +02:00
cduvray
cf6e3270b2 doc: multiple authorizers 2023-08-23 08:16:55 +02:00
cduvray
cc7969db08 chore: merge 'upstream/main' into multiple-authorizers2 2023-08-22 07:51:43 +02:00
cduvray
940acb17a1 feat: optional claim extraction (fixes #12)
- error 401 rather than INTERNAL_SERVER_ERROR, when no claims exist (no layer in front of the handler)
- do not log error
- tests
2023-08-22 07:43:30 +02:00
cduvray
a8ea0288cd tests: (jwt_auth_to_layer) more information in case of falure 2023-08-20 08:04:30 +02:00
cduvray
20f7eff01e refactor: AsyncAuthorizer::authorize, map - > filter_map 2023-08-19 14:21:11 +02:00
cduvray
e815d35a55 refactor: JwtAuthorizer::IntoLayer -> Authorizer::IntoLayer
- better error management (avoids composite errors when transforming multiple builder into layer)
2023-08-18 07:48:53 +02:00
cduvray
3d5367da88 fix: tonic/clippy errors 2023-08-14 08:04:53 +02:00
cduvray
efa378b3bf feat: implement IntoLayer for slices (IntoIter) 2023-08-14 08:04:53 +02:00
cduvray
36bc0fca7d doc: multi authorizer 2023-08-14 08:04:53 +02:00
cduvray
50c2ecac38 refactor: simplification ToAuthorizationLayer -> IntoLayer 2023-08-14 08:02:56 +02:00
cduvray
0fbdc0df84 test: add multiple authorizer tests 2023-08-14 08:02:56 +02:00
cduvray
603c042ee3 refactor: move jwt_source to Authorizer
allows multiple sorces with multiple authorizers
2023-08-14 08:02:56 +02:00
cduvray
55c4f7cc16 chore: clippy 2023-08-14 08:02:56 +02:00
cduvray
d7d945c075 feat: ToAuthorizationLayer 2023-08-14 08:02:56 +02:00
cduvray
57fbc6e399 feat: multiple auths per AsyncAuthorizationService 2023-08-14 08:02:56 +02:00
cduvray
27cce24372 doc: CHANGELOG.md 2023-07-11 08:44:19 +02:00
cduvray
ae1a29ed10 chore: release 0.10.1 2023-07-11 08:36:44 +02:00
cduvray
6db2912acf doc: CHANGELOG.md 2023-07-11 08:09:35 +02:00
cduvray
a869c25538 refactor: NumericDate.inner replaced by From<NumericDate>
- "inner" should be inner and not public, I think From trait implementation looks nicer
- tests added
2023-07-10 09:00:05 +02:00
cduvray
157cdfa396 chore: Merge branch 'NotNorom/main' into main 2023-07-10 08:15:30 +02:00
cduvray
b96c4f323a fix(claims): impl. of iter for OneOrArray 2023-07-09 16:03:00 +02:00
cduvray
70ce996275 fix(claims): aud can a string or an array of strings
fixes #26
2023-07-09 16:03:00 +02:00
cduvray
fc82bea5f4 build: disable temporarily nightly tests
-  to avoid "error[E0635]: unknown feature `proc_macro_span_shrink`" when testing with nightly
2023-07-06 07:32:07 +02:00
cduvray
f961639e75 build: use dtolnay/rust-toolchain, update ubuntu (LTS)
- avoid node 12 actions
2023-07-06 07:32:07 +02:00
Andre Julius
9a4751ef59 Add getter for inner timestamp for NumericDate 2023-06-26 17:17:25 +02:00
Andre Julius
70d1ac3786 Add support for time crate. 2023-06-26 17:17:03 +02:00
cduvray
7f9ad54694 chore: release 0.10.0 2023-05-19 09:14:53 +02:00
cduvray
d3fc883006 feat: claims 2023-05-18 17:13:29 +02:00
cduvray
93325dce96 chore: Merge 'sjoerdsimons/use-ready-inner-service'
- containing 2 PRs: #21, #19
2023-05-17 08:24:54 +02:00
Cyril Plisko
7fc800dbc4
feat: Allow different choices of TLS support (#6)
Allow same TLS options as underlying `reqwest` crate
2023-05-02 08:16:24 +02:00
Sjoerd Simons
28df895754 feature: tests readyness handling
Use a Tower Buffer service/layer to verify the crate handles inner
service readyness correctly as the buffer service will panic when being
called if it's not ready

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2023-04-22 15:03:19 +02:00
Sjoerd Simons
1cec99e522 fix: Ensure the ready inner service is used
Cloning the inner service to use in call can mean a not-ready clone gets
used which violates the tower service preconditions. Replace the cloned
service with the ready service to ensure the right copy gets used. See
https://docs.rs/tower/0.4.13/tower/trait.Service.html#be-careful-when-cloning-inner-services
for more details

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2023-04-22 14:56:31 +02:00
Sjoerd Simons
f628617601 build: Run cargo tests with all features
As tonic support is optional also run cargo test with all features
enabled such that the tonic support gets tested

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2023-04-22 14:36:41 +02:00
Sjoerd Simons
89f795368c features: Add integration test for tonic support
Add an integration tests for tonic in such a way that it avoids having
to create a build.rs with tonic code generation; As such it hand-codes
some parts of the tonic service implementation which is normally
code-generated. This also simply tests successfull and failed auth
without validating other authorization functionality as that's not
different between usage in tonic and axum

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2023-04-22 14:36:41 +02:00
Sjoerd Simons
5f3a08c4c7 feat: Add support for tonic
Tonic and Axum are quite closely related; From a tower perspective the
main difference is in the Error type in the body for their Response.

This refactor the code a little bit and add conversions from AuthError
to a tonic's Response such that the exact same code can be used by both
Axum and tonic services

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2023-04-22 14:36:41 +02:00
cduvray
f45568a044 chore: release 0.9.0 2023-04-14 07:59:38 +02:00