mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
14b8cf4894
This PR starts the OIDC implementation for the API V2 including the Implicit and Code Flow. Co-authored-by: Livio Spring <livio.a@gmail.com> Co-authored-by: Tim Möhlmann <tim+github@zitadel.com> Co-authored-by: Stefan Benz <46600784+stebenz@users.noreply.github.com>
15 lines
619 B
Go
15 lines
619 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 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)
|
|
}
|