Files
zitadel/backend/v3/domain/crypto.go

38 lines
1.0 KiB
Go
Raw Permalink Normal View History

2025-04-29 06:03:47 +02:00
package domain
// import (
// "context"
2025-04-29 06:03:47 +02:00
// "github.com/zitadel/zitadel/internal/crypto"
// )
2025-04-29 06:03:47 +02:00
// type generateCodeCommand struct {
// code string
// value *crypto.CryptoValue
// }
2025-04-29 06:03:47 +02:00
// // 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)
// }
2025-04-29 06:03:47 +02:00
// // String implements [Commander].
// func (cmd *generateCodeCommand) String() string {
// return "generateCodeCommand"
// }
2025-05-08 15:30:06 +02:00
// 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
// }
2025-05-08 15:30:06 +02:00
// var _ Commander = (*generateCodeCommand)(nil)