mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-21 23:37:31 +00:00
15 lines
445 B
Go
15 lines
445 B
Go
|
package domain
|
||
|
|
||
|
import (
|
||
|
"github.com/zitadel/zitadel/internal/crypto"
|
||
|
"github.com/zitadel/zitadel/internal/errors"
|
||
|
)
|
||
|
|
||
|
func NewMachineClientSecret(generator crypto.Generator) (*crypto.CryptoValue, string, error) {
|
||
|
cryptoValue, stringSecret, err := crypto.NewCode(generator)
|
||
|
if err != nil {
|
||
|
return nil, "", errors.ThrowInternal(err, "MODEL-57cjsiw", "Errors.User.Machine.Secret.CouldNotGenerate")
|
||
|
}
|
||
|
return cryptoValue, stringSecret, nil
|
||
|
}
|