Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Optional JWT authorisation middleware for API #11

Merged
merged 14 commits into from
Sep 23, 2024
Merged

Conversation

PeterBaker0
Copy link
Collaborator

Adds an optional middleware to the Oxygen API which

  • fetches the public key from WKT
  • parses the JWT
  • ensures it validates against pub key
  • ensures the iss field matches the configured JWT issuer

See new README for description of config fields.

Currently protection is added on a per route basis so that the "/" path can remain open for health checks.

Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Manifest.toml Outdated
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This doesn't have JSON in it which could be the problem.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Defs is!

PeterBaker0 and others added 3 commits September 23, 2024 14:15
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
end

return jwt_auth_middleware
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Set up your formatter to ensure newlines at EOF please

@ConnectedSystems ConnectedSystems merged commit 1d4b296 into main Sep 23, 2024
1 check passed
@ConnectedSystems ConnectedSystems deleted the jwt-auth branch September 23, 2024 08:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants