Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ func Session(cfg Options) func(next http.Handler) http.Handler {

if user != nil {
ctx = WithUser(ctx, user)

sessionType = proto.SessionType_User
if isAdmin {
sessionType = proto.SessionType_Admin
Expand All @@ -196,11 +195,11 @@ func Session(cfg Options) func(next http.Handler) http.Handler {
if adminClaim {
sessionType = proto.SessionType_Admin
}
}

if projectClaim > 0 {
ctx = WithProjectID(ctx, uint64(projectClaim))
sessionType = proto.SessionType_Project
}
if projectClaim > 0 {
ctx = WithProjectID(ctx, uint64(projectClaim))
sessionType = max(sessionType, proto.SessionType_Project)
Copy link
Contributor

@VojtechVitek VojtechVitek Nov 20, 2024

Choose a reason for hiding this comment

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

How do we distinguish between AccessKey and Project session types?

Should we have a "session" claim?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The sessionType is accessKey vs project

}
}

Expand Down
Loading