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