mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:17:32 +00:00
feat: Hosted login translation API (#10011)
# Which Problems Are Solved This PR implements https://github.com/zitadel/zitadel/issues/9850 # How the Problems Are Solved - New protobuf definition - Implementation of retrieval of system translations - Implementation of retrieval and persistence of organization and instance level translations # Additional Context - Closes #9850 # TODO - [x] Integration tests for Get and Set hosted login translation endpoints - [x] DB migration test - [x] Command function tests - [x] Command util functions tests - [x] Query function test - [x] Query util functions tests
This commit is contained in:
@@ -1,10 +1,28 @@
|
||||
package authz
|
||||
|
||||
import "context"
|
||||
import (
|
||||
"context"
|
||||
|
||||
func NewMockContext(instanceID, orgID, userID string) context.Context {
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
|
||||
type MockContextInstanceOpts func(i *instance)
|
||||
|
||||
func WithMockDefaultLanguage(lang language.Tag) MockContextInstanceOpts {
|
||||
return func(i *instance) {
|
||||
i.defaultLanguage = lang
|
||||
}
|
||||
}
|
||||
|
||||
func NewMockContext(instanceID, orgID, userID string, opts ...MockContextInstanceOpts) context.Context {
|
||||
ctx := context.WithValue(context.Background(), dataKey, CtxData{UserID: userID, OrgID: orgID})
|
||||
return context.WithValue(ctx, instanceKey, &instance{id: instanceID})
|
||||
|
||||
i := &instance{id: instanceID}
|
||||
for _, o := range opts {
|
||||
o(i)
|
||||
}
|
||||
|
||||
return context.WithValue(ctx, instanceKey, i)
|
||||
}
|
||||
|
||||
func NewMockContextWithAgent(instanceID, orgID, userID, agentID string) context.Context {
|
||||
|
Reference in New Issue
Block a user