mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:07:31 +00:00
fix: v2 human command (#3435)
* add/register human command done * validations * crypto * move clientid * keys * fix: clientID * remove v2 package * tests * tests running * revert old code * instance domain from ctx * chore: rename zitadel app ids * comments * fix: test
This commit is contained in:
@@ -12,6 +12,7 @@ type Instance interface {
|
||||
InstanceID() string
|
||||
ProjectID() string
|
||||
ConsoleClientID() string
|
||||
RequestedDomain() string
|
||||
}
|
||||
|
||||
type InstanceVerifier interface {
|
||||
@@ -19,7 +20,8 @@ type InstanceVerifier interface {
|
||||
}
|
||||
|
||||
type instance struct {
|
||||
ID string
|
||||
ID string
|
||||
Domain string
|
||||
}
|
||||
|
||||
func (i *instance) InstanceID() string {
|
||||
@@ -34,6 +36,10 @@ func (i *instance) ConsoleClientID() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (i *instance) RequestedDomain() string {
|
||||
return i.Domain
|
||||
}
|
||||
|
||||
func GetInstance(ctx context.Context) Instance {
|
||||
instance, ok := ctx.Value(instanceKey).(Instance)
|
||||
if !ok {
|
||||
@@ -49,3 +55,13 @@ func WithInstance(ctx context.Context, instance Instance) context.Context {
|
||||
func WithInstanceID(ctx context.Context, id string) context.Context {
|
||||
return context.WithValue(ctx, instanceKey, &instance{ID: id})
|
||||
}
|
||||
|
||||
func WithRequestedDomain(ctx context.Context, domain string) context.Context {
|
||||
i, ok := ctx.Value(instanceKey).(*instance)
|
||||
if !ok {
|
||||
i = new(instance)
|
||||
}
|
||||
|
||||
i.Domain = domain
|
||||
return context.WithValue(ctx, instanceKey, i)
|
||||
}
|
||||
|
Reference in New Issue
Block a user