mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-01 11:37:23 +00:00

# Which Problems Are Solved ListSessions only works to list the sessions that you are the creator of. # How the Problems Are Solved Add options to search for sessions created by other users, sessions belonging to the same useragent and sessions belonging to your user. Possible through additional search parameters which as default use the information contained in your session token but can also be filled with specific IDs. # Additional Changes Remodel integration tests, to separate the Create and Get of sessions correctly. # Additional Context Closes #8301 --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
20 lines
897 B
Go
20 lines
897 B
Go
package authz
|
|
|
|
import "context"
|
|
|
|
func NewMockContext(instanceID, orgID, userID string) context.Context {
|
|
ctx := context.WithValue(context.Background(), dataKey, CtxData{UserID: userID, OrgID: orgID})
|
|
return context.WithValue(ctx, instanceKey, &instance{id: instanceID})
|
|
}
|
|
|
|
func NewMockContextWithAgent(instanceID, orgID, userID, agentID string) context.Context {
|
|
ctx := context.WithValue(context.Background(), dataKey, CtxData{UserID: userID, OrgID: orgID, AgentID: agentID})
|
|
return context.WithValue(ctx, instanceKey, &instance{id: instanceID})
|
|
}
|
|
|
|
func NewMockContextWithPermissions(instanceID, orgID, userID string, permissions []string) context.Context {
|
|
ctx := context.WithValue(context.Background(), dataKey, CtxData{UserID: userID, OrgID: orgID})
|
|
ctx = context.WithValue(ctx, instanceKey, &instance{id: instanceID})
|
|
return context.WithValue(ctx, requestPermissionsKey, permissions)
|
|
}
|