Commit graph

122 commits

Author SHA1 Message Date
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
cduvray
bad5ad18f3
fix(jwt source): cookie from request (#18)
- JwtSource:Bearer renamed to AuthorizationHeader for more consistency with jwt terminology
- documentation added
- the token cookie should be taken from request not from the tower-cookies middleware jar
  - dependency on tower-cookies is no longer needed
- tests added
2023-04-09 08:31:39 +02:00
cduvray
3292d59d1c fix: clippy 2023-03-30 07:42:35 +02:00
cduvray
e409bee3b3 fix: merge errors 2023-03-30 07:36:52 +02:00
Felix B. Bause
9054f400dc
feat: implementation of named cookie as jwt source (#10)
* feat: working but naive implementation of named cookie as jwt source

* refactor: add with_jwt_source to JwtAuthorizer. Make Bearer default

* fix: fix the demo-server. Remove JWTSource

* refactor: rename with_jwt_source() -> jwt_source()
2023-03-30 07:25:39 +02:00
Cyril Plisko
783ed7e340
feat: allow raw PEM file content as an input for JwtAuthorizer (#15)
* Allow raw PEM file content as an input for JwtAuthorizer

* Add tests for text-based KeySourceType variants
2023-03-28 08:03:43 +02:00
perillamint
2bca19be64
Remove 'static lifetime requirement (#8)
Co-authored-by: Yonghyu Ban <yhban@cleanc.kr>
2023-03-22 07:42:07 +01:00
cduvray
5b99335da6 chore: release 0.8.1 2023-03-16 07:14:50 +01:00
cduvray
ca14e15b67 refacor: KeyStore, KeySource
- (performance) build DecodingKey once (per refresh)
- (security) store algorithm in KeyData
2023-03-15 08:21:04 +01:00
cduvray
8f55bf9d3e fix: clippy warning (rust 1.68) 2023-03-15 08:13:18 +01:00
cduvray
6dfc895876 fix(discovery): replace join and add tests 2023-03-15 08:04:25 +01:00
kschibli
2bb4b4ca34
fix: Allow non-root OIDC issuer (#5)
My OIDC endpoint is not at the root and I couldn't use `discover_jwks`
because it would strip the path of the issuer.

Before:
```
issuer: 'https://example.com/myissuer/'
result: 'https://example.com/.well-known/openid-configuration'
```

After:
```
issuer: 'https://example.com/myissuer/'
result: 'https://example.com/myissuer/.well-known/openid-configuration'
```

I checked, and having the discovery url not at the root seems to be
supported by the standard:

https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationRequest
2023-03-15 07:26:15 +01:00
cduvray
ab5f3ffc2c build: ci on push.main 2023-03-02 08:14:36 +01:00
cduvray
8b3dcd4b24 chore: dependencies update
- tower-http 0.3 -> 0.4 (as it was changed for axum 0.6.9)
- tokio 1.0 -> 1.25 (same version as in axum 0.6.9)
- other demo-server dependencies
2023-03-02 08:12:06 +01:00
cduvray
1537739f19 doc: fix. documentation links 2023-03-02 07:43:26 +01:00
cduvray
3b2ad550c3 chore: release 0.8.0 2023-02-28 07:47:46 +01:00
cduvray
1d5bdf83ca docs: badges 2023-02-27 08:37:36 +01:00
cduvray
683f932468
feat: configurable validation (validation: iss, aud, exp, nbf, leeway) (fixes #1) (#4) 2023-02-26 20:30:55 +01:00
cduvray
28c7eedcd5
fix: from_ec, from_ed (#3)
* fix: from_ec, from_ed

* chore: fix clippy warnings
2023-02-23 21:22:55 +01:00
cduvray
1579676948 build: ci 2023-02-23 08:01:31 +01:00
cduvray
3d8b5a7f46 chore: release 0.7.0 2023-02-14 07:35:12 +01:00
cduvray
857af52271 doc: README.md, CHANGELOG.md 2023-02-14 07:30:45 +01:00
cduvray
a8b510a03e refactor: refresh simplification
- difference between refresh_interval and minimal_refresh_interval was no clear,
- therfore they were merged
2023-02-13 08:32:02 +01:00
cduvray
9c45a43584 chore: key file renaming 2023-02-12 09:04:38 +01:00
cduvray
ae44a8e961 feat: integration tests 2023-02-11 20:48:59 +01:00
cduvray
a58b367c90 fix: tests 2023-02-06 23:02:21 +01:00
cduvray
3a6a31b418 chore: release 0.6.0 2023-02-05 09:50:31 +01:00
cduvray
f1b11ecf3b refactor: better url error checking (jwks, oidc) 2023-02-05 09:46:20 +01:00
cduvray
b189caaab8 refactor: Authorizer::build 2023-02-01 22:09:06 +01:00
cduvray
6ff5d88ae9 refactor: demo server (clean, refactor, docs) 2023-01-31 08:38:59 +01:00
cduvray
43f2523ec6 feat: oidc issuer 2023-01-29 19:38:26 +01:00
cduvray
d8fb138d46 chore: fmt 2023-01-28 08:43:51 +01:00