Skip to content

lore-server: Support file:// JWKS endpoints in JWK service #44

Open
kidskoding wants to merge 2 commits into
EpicGames:mainfrom
kidskoding:main
Open

lore-server: Support file:// JWKS endpoints in JWK service #44
kidskoding wants to merge 2 commits into
EpicGames:mainfrom
kidskoding:main

Conversation

@kidskoding

Copy link
Copy Markdown

Summary

Fixes #32

Added a scheme check in fetch_new_keys() that checks for either file:// or http:// (https://)

  • If http:// or https://, nothing changes - same network fetch as before
  • If it's a file://, open the path on disk and read contents directly (implemented via tokio::fs::read_to_string instead of communicating over HTTP)

Test Plan

Added two tests covering the new file-read path: one verifies keys load correctly from a file:// endpoint and the other confirms a missing file still fails cleanly

  • Ran Tests: cargo test -p lore-server auth::jwk:: — both loads_keys_from_file_url and file_url_missing_file_returns_error - PASS
  • Format, Build, and Pre-commit - Formatted via clippy and cargo nightly formatter; Built via cargo build; pre-commit tool ran
    • cargo +nightly fmt --all
    • cargo clippy --all-targets -- -D warnings --no-deps
    • cargo build — all clean (no error)
    • pre-commit run --all-files — clean

@kidskoding

Copy link
Copy Markdown
Author

maintainers / someone please review - @ragnarula @mjansson

Comment thread lore-server/src/auth/jwk.rs Outdated

@peter-lockhart-pub peter-lockhart-pub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for the contribution, this looks good to me. Can I be a bit pedantic please; could you move the .gitignore change to another PR? Just so the commit remains meticulous and free from unrelated changes?

@kidskoding

Copy link
Copy Markdown
Author

sure thing! accidentally stashed all changes at once!

Anirudh Konidala added 2 commits June 22, 2026 03:58
Signed-off-by: Anirudh Konidala <kidskodingclub@gmail.com>
Per review feedback, the file:// and http(s):// JWKS load paths shared one generic parse-error
  warning. Split it so the file case logs "invalid JWKS file contents" and the remote case keeps "failed to parse JWKS response".

Signed-off-by: Anirudh Konidala <kidskodingclub@gmail.com>
@kidskoding

Copy link
Copy Markdown
Author

@peter-lockhart-pub please review again, along with #50!

@peter-lockhart-pub peter-lockhart-pub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kidskoding

kidskoding commented Jun 22, 2026

Copy link
Copy Markdown
Author

Maintainers may need to reapprove CI/CD workflows due to a force push of commits on existing fork, intended to align with relevant PR titles - @mjansson, @peter-lockhart-pub

@peter-lockhart-pub

Copy link
Copy Markdown
Collaborator

Maintainers may need to reapprove CI/CD workflows due to a force push of commits on existing fork, intended to align with relevant PR titles - @mjansson, @peter-lockhart-pub

Done! This PR will be picked up by another process that will merge it now that it is approved and good to go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

JWK key ring URL does not support "file://"

3 participants