mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +00:00
cleanup merge
This commit is contained in:
parent
38f7b1bd06
commit
3b0be67627
@ -91,26 +91,3 @@ func secretGeneratorConfigWithDefault(ctx context.Context, filter preparation.Fi
|
||||
IncludeSymbols: wm.IncludeSymbols,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func secretGeneratorConfigWithDefault(ctx context.Context, filter preparation.FilterToQueryReducer, typ domain.SecretGeneratorType, defaultGenerator *crypto.GeneratorConfig) (*crypto.GeneratorConfig, error) {
|
||||
wm := NewInstanceSecretGeneratorConfigWriteModel(ctx, typ)
|
||||
events, err := filter(ctx, wm.Query())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
wm.AppendEvents(events...)
|
||||
if err := wm.Reduce(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if wm.State != domain.SecretGeneratorStateActive {
|
||||
return defaultGenerator, nil
|
||||
}
|
||||
return &crypto.GeneratorConfig{
|
||||
Length: wm.Length,
|
||||
Expiry: wm.Expiry,
|
||||
IncludeLowerLetters: wm.IncludeLowerLetters,
|
||||
IncludeUpperLetters: wm.IncludeUpperLetters,
|
||||
IncludeDigits: wm.IncludeDigits,
|
||||
IncludeSymbols: wm.IncludeSymbols,
|
||||
}, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user