mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 03:37:34 +00:00
chore(linting): changes to make clean-transactional-propsal_lint pass… (#10072)
This commit is contained in:
@@ -1,37 +1,37 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"context"
|
||||
// import (
|
||||
// "context"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/crypto"
|
||||
)
|
||||
// "github.com/zitadel/zitadel/internal/crypto"
|
||||
// )
|
||||
|
||||
type generateCodeCommand struct {
|
||||
code string
|
||||
value *crypto.CryptoValue
|
||||
}
|
||||
// type generateCodeCommand struct {
|
||||
// code string
|
||||
// value *crypto.CryptoValue
|
||||
// }
|
||||
|
||||
// I didn't update this repository to the solution proposed please view one of the following interfaces for correct usage:
|
||||
// - [UserRepository]
|
||||
// - [InstanceRepository]
|
||||
// - [OrgRepository]
|
||||
type CryptoRepository interface {
|
||||
GetEncryptionConfig(ctx context.Context) (*crypto.GeneratorConfig, error)
|
||||
}
|
||||
// // I didn't update this repository to the solution proposed please view one of the following interfaces for correct usage:
|
||||
// // - [UserRepository]
|
||||
// // - [InstanceRepository]
|
||||
// // - [OrgRepository]
|
||||
// type CryptoRepository interface {
|
||||
// GetEncryptionConfig(ctx context.Context) (*crypto.GeneratorConfig, error)
|
||||
// }
|
||||
|
||||
// String implements [Commander].
|
||||
func (cmd *generateCodeCommand) String() string {
|
||||
return "generateCodeCommand"
|
||||
}
|
||||
// // String implements [Commander].
|
||||
// func (cmd *generateCodeCommand) String() string {
|
||||
// return "generateCodeCommand"
|
||||
// }
|
||||
|
||||
func (cmd *generateCodeCommand) Execute(ctx context.Context, opts *CommandOpts) error {
|
||||
config, err := cryptoRepo(opts.DB).GetEncryptionConfig(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
generator := crypto.NewEncryptionGenerator(*config, userCodeAlgorithm)
|
||||
cmd.value, cmd.code, err = crypto.NewCode(generator)
|
||||
return err
|
||||
}
|
||||
// func (cmd *generateCodeCommand) Execute(ctx context.Context, opts *CommandOpts) error {
|
||||
// config, err := cryptoRepo(opts.DB).GetEncryptionConfig(ctx)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// generator := crypto.NewEncryptionGenerator(*config, userCodeAlgorithm)
|
||||
// cmd.value, cmd.code, err = crypto.NewCode(generator)
|
||||
// return err
|
||||
// }
|
||||
|
||||
var _ Commander = (*generateCodeCommand)(nil)
|
||||
// var _ Commander = (*generateCodeCommand)(nil)
|
||||
|
Reference in New Issue
Block a user