feat: add HeaderSessionType constant and set it in Session middleware#54
Merged
klaidliadon merged 2 commits intomasterfrom Dec 4, 2025
Merged
feat: add HeaderSessionType constant and set it in Session middleware#54klaidliadon merged 2 commits intomasterfrom
klaidliadon merged 2 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new Session-Type response header to expose the session type information to clients. The session type is already tracked internally (in context and logs) and used for access control, but was not previously exposed in HTTP response headers. This enhancement allows client applications to inspect the determined session type for debugging or auditing purposes.
- Introduced a new constant
HeaderSessionTypefor standardized header name usage - Set the
Session-Typeresponse header in both code paths of the Session middleware (early return for SpecialKey and normal flow)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| common.go | Adds HeaderSessionType constant defining the "Session-Type" header name, following the same pattern as HeaderAccessKey |
| middleware.go | Sets the Session-Type response header in the Session middleware for both the SpecialKey early return path and the standard session type determination path |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
VojtechVitek
approved these changes
Dec 4, 2025
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.
No description provided.