fix(auth): swap out hybrid auth in relevant callsites#3160
Merged
icecrasher321 merged 10 commits intostagingfrom Feb 7, 2026
Merged
fix(auth): swap out hybrid auth in relevant callsites#3160icecrasher321 merged 10 commits intostagingfrom
icecrasher321 merged 10 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile OverviewGreptile SummaryReplaced
The changes correctly narrow authentication methods based on each endpoint's security requirements, improving the principle of least privilege. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant APIRoute
participant AuthMiddleware
participant AuthVerifier
Note over Client,AuthVerifier: Scenario 1: checkHybridAuth (Before PR)
Client->>APIRoute: Request with credentials
APIRoute->>AuthMiddleware: checkHybridAuth()
AuthMiddleware->>AuthVerifier: Check JWT token
alt JWT valid
AuthVerifier-->>AuthMiddleware: JWT verified
else JWT invalid
AuthMiddleware->>AuthVerifier: Check session cookie
alt Session valid
AuthVerifier-->>AuthMiddleware: Session verified
else Session invalid
AuthMiddleware->>AuthVerifier: Check API key header
AuthVerifier-->>AuthMiddleware: API key verified or fail
end
end
AuthMiddleware-->>APIRoute: Auth result
APIRoute-->>Client: Response
Note over Client,AuthVerifier: Scenario 2: checkSessionOrInternalAuth (After PR)
Client->>APIRoute: Request with credentials
APIRoute->>AuthMiddleware: checkSessionOrInternalAuth()
AuthMiddleware->>AuthVerifier: Check for API key header
alt API key detected
AuthMiddleware-->>APIRoute: Reject with error
APIRoute-->>Client: 401 Unauthorized
else No API key
AuthMiddleware->>AuthVerifier: Check JWT token
alt JWT valid
AuthVerifier-->>AuthMiddleware: JWT verified
AuthMiddleware-->>APIRoute: Success
else JWT invalid
AuthMiddleware->>AuthVerifier: Check session cookie
alt Session valid
AuthVerifier-->>AuthMiddleware: Session verified
AuthMiddleware-->>APIRoute: Success
else All failed
AuthMiddleware-->>APIRoute: Reject
end
end
APIRoute-->>Client: Response
end
Note over Client,AuthVerifier: Scenario 3: checkInternalAuth (After PR)
Client->>APIRoute: Request to memory/parse endpoint
APIRoute->>AuthMiddleware: checkInternalAuth()
AuthMiddleware->>AuthVerifier: Check for API key or session
alt API key or session detected
AuthMiddleware-->>APIRoute: Reject immediately
APIRoute-->>Client: 401 Unauthorized
else Only JWT present
AuthMiddleware->>AuthVerifier: Verify JWT token
alt JWT valid
AuthVerifier-->>AuthMiddleware: JWT verified
AuthMiddleware-->>APIRoute: Success
else JWT invalid
AuthMiddleware-->>APIRoute: Reject
end
APIRoute-->>Client: Response
end
|
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@cursor review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
Testing
Tested manually
Checklist