Skip to content

Commit

Permalink
New OAuth2 implementation (#601)
Browse files Browse the repository at this point in the history
* new crate skeleton

* add rfcs for me to remember 🥺

* add param storage

* authorizer extractor

* test assertion

* update lantern sdk

* restructure, workspace deps

* add nix badge

* up

* progress

* fix typos

* response_type not grant_type

* add oauth errors as strum enum

* log event paths too

* some more traits

* prog

* move file to mod

* progress

* rm unused fn

* rename

* add refresh flow

* add pkce verifier

* up

* add send bounds

* integrate verifier

* fix errors

* fix errors

* fix clippy errors

* return more errors in a standard compliant way

* brainworms 🥺

* debug

* make bunch of stuff public, add some more tests

* pkce bench

* add basic auth bench

* expand tests, add benches for basic auth

* move tests

* change coverage gha

* enable branch coverage

* stable, no branch cov

* get rid of oxide-auth deps

* upgrade npm

* fix website

* rename, revert stuff, fix error handling

* move around, change errors

* more rfc compliance

* rename fn

* up

* up

* use rfc-compliant granular errors

* rename fns

* add scope primitive

* fix typo

* move mod

* use scopes

* fix safety comment, remove chrono dep

* up

* extract event handler

* rm some old code

* fix tests

* impl some things

* port endpoint

* del solicitor

* impl trait

* delete some old impls

* make own request type :33

* fix compile errors

* fix some stuff

* fix stuff

* rm unused dep

* fix ci

* move logic into separate funcs

* fix compiles

* add cowstr crate for eventual optimizations

* add size assert at compile time

* add some helper fn

* add tests, impl ord and eq

* more scope tests

* use new version of embed sdk

* use altair. maybe?

* mount websocket subscription for graphql

* mount websocket to graphql

* fix loading thing

* change body limit on graphql route

* up

* fix warnings and errors from new rust version

* add some more comments

* make const fn

* use lantern-client-sdk itself

* optimize access of array

* add some request deser tests

* add client cmp tests

* client credentials tests

* flake.lock: Update

Flake lock file updates:

• Updated input 'crane':
    'github:ipetkov/crane/76d64e779e2fbaf172110038492343a8c4e29b55' (2024-12-01)
  → 'github:ipetkov/crane/9172acc1ee6c7e1cbafc3044ff850c568c75a5a3' (2025-01-11)
• Updated input 'devenv':
    'github:cachix/devenv/2c928a199d56191d7a53f29ccafa56238c8ce4e5' (2024-11-29)
  → 'github:cachix/devenv/1c384bc4be3ee571511fbbc6fdc94fe47d60f6cf' (2025-01-09)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/ac35b104800bff9028425fec3b6e8a41de2bbfff' (2024-12-01)
  → 'github:nixos/nixpkgs/bffc22eb12172e6db3c5dde9e3e5628f8e3e7912' (2025-01-08)
• Updated input 'rust-overlay':
    'github:oxalica/rust-overlay/e66c0d43abf5bdefb664c3583ca8994983c332ae' (2024-12-02)
  → 'github:oxalica/rust-overlay/09f2869b164f8b6d5e30f0bd7ed30d6eb8237058' (2025-01-11)

* pkce tests

* add fixtures mod

* eliminate pkce allocs

* make just-retry slightly more mockable

* fix benches

* use assoc output size

* instrument more

* add finished test stuff

* restructure

* initial success tests

* update to use deterministic rng

* use fastrand instead

* exclude tracing instrument from coverage for more acc

* redirect uri mismatch

* more codegrant tests

* up

* pkce part tests

* create auth storage

* basic success test auth flow

* pkce success test

* error cases

* more error cases

* refresh flow tests

* dispatch tests

* fix test
  • Loading branch information
aumetra committed Jan 16, 2025
1 parent a32edf5 commit c9aa380
Show file tree
Hide file tree
Showing 100 changed files with 4,795 additions and 1,970 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ jobs:
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov nextest --all-features --workspace --lcov --output-path lcov.info
run: cargo llvm-cov nextest --all-features --workspace --codecov --output-path codecov.json
env:
DATABASE_URL: "postgres://postgres:postgres@localhost/test_db"
MINIO_URL: "http://127.0.0.1:9000"
REDIS_URL: "redis://localhost"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: lcov.info
files: codecov.json
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"rust-analyzer.cargo.buildScripts.enable": true,
"editor.formatOnSave": true,
"rust-analyzer.showUnlinkedFileNotification": false,
"rust-analyzer.cargo.features": [
"oidc"
],

"search.exclude": {
// Avoid polluting search results with lockfile content
Expand Down
Loading

0 comments on commit c9aa380

Please sign in to comment.