Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Session to Project even without account #28

Merged
merged 1 commit into from
Nov 20, 2024
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