Skip to content

[CX-3001] JWT token authorisation enabled#12

Merged
ankitpunchh merged 3 commits into
mainfrom
CX-3001
May 15, 2026
Merged

[CX-3001] JWT token authorisation enabled#12
ankitpunchh merged 3 commits into
mainfrom
CX-3001

Conversation

@kshitij-partech
Copy link
Copy Markdown
Collaborator

@kshitij-partech kshitij-partech commented Apr 20, 2026

This PR introduces JWT token authorization functionality to the code-push-server-go project
Contains changes across 4 files with net addition of 48 lines
The PR is currently mergeable but in an unstable state
One comment has been added to the discussion
Author is a member of the organization

@kvlad-par
Copy link
Copy Markdown

kvlad-par commented Apr 20, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@kshitij-partech kshitij-partech changed the title JWT token authorisation enabled [CX-3001] JWT token authorisation enabled Apr 21, 2026
@kshitij-partech kshitij-partech requested a review from Copilot April 24, 2026 05:36
Copy link
Copy Markdown

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 JWT-based authorization support to the Go code-push server by attempting to authenticate incoming requests using a JWT (shared secret) before falling back to the existing DB-backed token mechanism.

Changes:

  • Add JWT parsing/validation path in the CheckToken middleware with fallback to DB token lookup.
  • Introduce jwt_secret configuration loading into appConfig.
  • Add the github.com/golang-jwt/jwt/v4 module dependency (go.mod/go.sum).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 6 comments.

File Description
middleware/middleware.go Adds JWT validation attempt before existing DB token lookup in auth middleware.
config/config.go Adds JWTSecret field and loads it from secrets (jwt_secret).
go.mod Adds github.com/golang-jwt/jwt/v4 dependency entry.
go.sum Adds checksum entries for the new JWT dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread middleware/middleware.go Outdated
Comment thread config/config.go Outdated
Comment thread go.mod Outdated
Comment thread middleware/middleware.go Outdated
Comment thread middleware/middleware.go
Comment thread middleware/middleware.go
@ankitpunchh ankitpunchh merged commit 73a03f0 into main May 15, 2026
5 checks passed
@ankitpunchh ankitpunchh deleted the CX-3001 branch May 15, 2026 06:13
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.

4 participants