Skip to content

Feat/authentication strategy#4

Merged
marcjazz merged 18 commits intomainfrom
feat/authentication-strategy
Feb 16, 2026
Merged

Feat/authentication strategy#4
marcjazz merged 18 commits intomainfrom
feat/authentication-strategy

Conversation

@marcjazz
Copy link
Owner

No description provided.

This commit refactors the offline JWT validation mechanism by introducing
a builder pattern for `OfflineValidator` and improving the example resource server.

- **feat(token): Introduce `OfflineValidationBuilder` and `OfflineValidator`**
  - Provides a flexible builder for configuring `OfflineValidator` instances
    with custom JWKS URI, refresh interval, issuer, audience, and algorithms.
  - Implements `TokenValidator` for `OfflineValidator`, allowing it to be
    used seamlessly with the new authentication strategy system.

- **deps(token): Add `async-trait` dependency**
  - Adds `async-trait` to `authkestra-token` to enable async traits for
    `TokenValidator` implementation.

- **refactor(examples): Improve `axum_resource_server` example**
  - Refactors `axum_resource_server.rs` to use a `Config` struct for better
    management of environment variables and application settings.
  - Updates the resource server to leverage the new `OfflineValidationBuilder`
    for configuring JWT validation.
  - Adds a `scope` claim to `MyClaims` and includes it in the protected
    resource response for more comprehensive token introspection.
This commit finalizes the changes by updating the root `Cargo.lock` file
to reflect all dependency changes introduced in previous commits.
Additionally, the root `README.md` is updated to highlight the new
"Flexible Chaining" capability provided by the `Authenticator`.

- **chore(deps): Update `Cargo.lock`**
  - Synchronizes the `Cargo.lock` file with the latest dependency tree
    after the introduction of new features and associated dependencies.

- **docs: Update root `README.md` for flexible chaining**
  - Adds a new bullet point to the main `README.md` emphasizing the
    `Authenticator`'s ability to chain multiple authentication strategies.
…ategy`

This commit refactors the `axum_auth_strategy` example to demonstrate the
use of the new `AuthenticationStrategy` trait.

Key changes include:
- Introduction of `CustomHeaderStrategy` for API key authentication.
- Simplification of the `User` identity struct.
- Update `MyBasicAuthenticator` to align with the new trait.
- Removal of `TokenStrategy` and `AuthPolicy` specific configurations.
- Adjustment of tests to reflect the new authentication strategies and
  expected behavior.
…uards

- Moves `AuthGuard` (formerly `Authenticator`) and `AuthPolicy` to the new crate.
- Relocates offline JWT validation (JWKS) and `OfflineValidator` to `authkestra-guard`.
- Updates root `README.md` and workspace `Cargo.toml` to include the new crate.
…en crates

- Removed `Authenticator` and `AuthPolicy` from `authkestra-core`.
- Removed `offline_validation.rs` from `authkestra-token`.
- Simplified `authkestra-token` to focus on symmetric JWT management.
- Updated crate documentation to reflect the new architecture.
- Updated `authkestra-oidc` to use `JwksCache` and validation from `authkestra-guard`.
- Refactored `authkestra-axum` and `authkestra-actix` extractors to use `AuthGuard`.
- Updated dependencies and documentation for all three crates.
- Updated existing examples to use `AuthGuard` and the new strategy pattern.
- Added `axum_combined_flow.rs` to demonstrate chaining multiple strategies.
- Updated `Cargo.lock` to reflect all workspace changes.
@marcjazz marcjazz merged commit 28fdea2 into main Feb 16, 2026
3 checks passed
@marcjazz marcjazz deleted the feat/authentication-strategy branch February 16, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant