Skip to content

Local Authentication#215

Merged
ssherar merged 16 commits intomainfrom
feature/local-auth
Jun 11, 2025
Merged

Local Authentication#215
ssherar merged 16 commits intomainfrom
feature/local-auth

Conversation

@ssherar
Copy link
Contributor

@ssherar ssherar commented Jun 11, 2025

No description provided.

@ianmiell ianmiell requested a review from Copilot June 11, 2025 13:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds local authentication support using JWT tokens and updates API documentation to reflect new OAuth2Password security requirements. Key changes include updating the CORS configuration to allow the Authorization header, introducing a new JWT middleware alongside new authentication endpoints, and updating Swagger annotations for secured endpoints.

Reviewed Changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/api/server.go Updated CORS configuration with the Authorization header.
internal/api/middleware/auth.go Added a new JWT middleware for token validation.
internal/api/handler/* Updated Swagger documentation for 401 responses and security annotations.
auth/* Added new authentication endpoints and JWT token generation.
cmd/*, Makefile, .env.example Introduced key generation and user management command changes.

@ssherar ssherar merged commit f0b5109 into main Jun 11, 2025
4 checks passed
@ssherar ssherar deleted the feature/local-auth branch June 11, 2025 14:17
s0nny78 pushed a commit that referenced this pull request Aug 29, 2025
* Initial user creation

* Add sensible output if error is passd back

* Add endpoint for authentication with username/password

This returns a HS256 signed JWT that can be used to authenticate with standard claims attached alongside
custom claims such as given and family name that can be customised later for more information

While a secret is OK for the moment, we should move it to pub/priv keys in the future

* Change signing to RSA keypairs

* Implement JWKs

* Update helpers to load keys from the fs

* Refactor authn functions to seperate package

* Add middleware to validate tokens

* Authenticate integration tests

* Update Swgger to use authentication

* (core) swagger comment fmt

* (chore) go mod tidy

* (chore) Fix spelling mistake

* Whitespace consistency and other minor nits

* go fmt

---------

Co-authored-by: ian <ian.miell@container-solutions.com>
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.

3 participants