MCPcopy Index your code
hub / github.com/197g/oxide-auth

github.com/197g/oxide-auth @v0.6.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.6.1 ↗ · + Follow
1,346 symbols 3,435 edges 98 files 386 documented · 29%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

oxide-auth

A OAuth2 server library, for use in combination with common web servers, featuring a set of configurable and pluggable backends.

About

oxide-auth aims at providing a comprehensive and extensible interface to managing OAuth2 tokens on a server. The core package is agnostic of the used front-end web server and adaptors for the actix, rocket, iron and rouille crates are provided in extension crates. Through an interface designed with traits, the frontend is as easily pluggable as the backend.

Example

$ cargo run example-actix

In the example folder you can find an interactive example. This configures a server, registers a public client and initializes a resource requiring an authorization token. A client is also activated which can be used to access the resource. The example assumes the user to be the validated resource owner, who can deny or allow the request by the client.

Integration

Some popular server libraries have ready-made integration. These still require some dependency on the base crate but generally wrap the interface into a user that is considered more idiomatic for their library. Besides the implementation of oxide-auth traits for the request type, specific error and response traits are also implemented.

What Crate Notes Docs
actix oxide-auth-actix - actix docs
async wrappers oxide-auth-async - async docs
redis oxide-auth-db - redis docs
rocket oxide-auth-rocket nightly rocket docs
rouille oxide-auth-rouille - rouille docs
iron oxide-auth-iron - iron docs

Additional

Crates.io Status Docs.rs Status License License CI Status

A more or less comprehensive list of changes is contained in the changelog. Sometimes less as larger releases and reworks profit from a rough overview of the changes more than a cumulative list of detailed features.

For some hints on upgrading from older versions see the migration notes.

More information about contributing. Please respect that I maintain this on my own currently and have limited time. I appreciate suggestions but sometimes the associate workload can seem daunting. That means that simplifications to the workflow are also highly appreciated.

Licensed under either of * MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) * Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) at your option.

The license applies to all parts of the source code, its documentation and supplementary files unless otherwise indicated. It does NOT apply to the replicated full-text copies of referenced RFCs which were included for the sake of completion. These are distributed as permitted by IETF Trust License 4–Section 3.c.i.

Extension points exported contracts — how you extend this code

OwnerSolicitor (Interface)
Checks consent with the owner of a resource, identified in a request. See [`frontends::simple`] for an implementation t [9 …
oxide-auth/src/endpoint/mod.rs
OAuthOperation (Interface)
Describes an operation that can be performed in the presence of an `Endpoint` This trait can be implemented by any type [5 …
oxide-auth-actix/src/lib.rs
Endpoint (Interface)
(no doc) [6 implementers]
oxide-auth-async/src/endpoint/mod.rs
OauthClientDBRepository (Interface)
methods to search and regist clients from DataSource. which should be implemented for all DataSource type. [1 implementers]
oxide-auth-db/src/primitives/db_registrar.rs
Scopes (Interface)
Determine the scopes applying to a request of a resource. It is possible to use a slice of [`Scope`]s as an implementat [6 …
oxide-auth/src/endpoint/mod.rs
OwnerSolicitor (Interface)
(no doc) [5 implementers]
oxide-auth-async/src/endpoint/mod.rs
WebRequest (Interface)
Abstraction of web requests with several different abstractions and constructors needed by an endpoint. It is assumed to [12 …
oxide-auth/src/endpoint/mod.rs
Extension (Interface)
(no doc) [3 implementers]
oxide-auth-async/src/code_grant.rs

Core symbols most depended-on inside this repo

iter
called by 130
oxide-auth/src/code_grant/error.rs
to_owned
called by 74
oxide-auth/src/endpoint/query.rs
as_ref
called by 69
oxide-auth/src/code_grant/error.rs
into
called by 68
oxide-auth/src/frontends/simple/request.rs
into
called by 55
oxide-auth-iron/src/lib.rs
execute
called by 39
oxide-auth-async/src/endpoint/refresh.rs
unique_value
called by 37
oxide-auth/src/endpoint/query.rs
encode
called by 32
oxide-auth/src/primitives/registrar.rs

Shape

Method 789
Function 256
Class 182
Enum 73
Interface 46

Languages

Rust100%

Modules by API surface

oxide-auth/src/primitives/registrar.rs53 symbols
oxide-auth/src/endpoint/mod.rs43 symbols
oxide-auth/src/primitives/issuer.rs39 symbols
oxide-auth/src/code_grant/accesstoken.rs39 symbols
oxide-auth-async/src/tests/access_token.rs38 symbols
oxide-auth/src/frontends/simple/endpoint.rs37 symbols
oxide-auth/src/frontends/gotham.rs34 symbols
oxide-auth/src/code_grant/client_credentials.rs34 symbols
oxide-auth/src/endpoint/tests/access_token.rs31 symbols
oxide-auth-actix/src/lib.rs31 symbols
oxide-auth/src/code_grant/authorization.rs29 symbols
oxide-auth-async/src/tests/refresh.rs29 symbols

For agents

$ claude mcp add oxide-auth \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact