2023-01-31 19:52:47 +00:00
|
|
|
package domain
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/zitadel/zitadel/internal/crypto"
|
2023-12-08 14:30:55 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/zerrors"
|
2023-01-31 19:52:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func NewMachineClientSecret(generator crypto.Generator) (*crypto.CryptoValue, string, error) {
|
|
|
|
cryptoValue, stringSecret, err := crypto.NewCode(generator)
|
|
|
|
if err != nil {
|
2023-12-08 14:30:55 +00:00
|
|
|
return nil, "", zerrors.ThrowInternal(err, "MODEL-57cjsiw", "Errors.User.Machine.Secret.CouldNotGenerate")
|
2023-01-31 19:52:47 +00:00
|
|
|
}
|
|
|
|
return cryptoValue, stringSecret, nil
|
|
|
|
}
|