mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +00:00
refactor: rename package errors to zerrors (#7039)
* chore: rename package errors to zerrors * rename package errors to gerrors * fix error related linting issues * fix zitadel error assertion * fix gosimple linting issues * fix deprecated linting issues * resolve gci linting issues * fix import structure --------- Co-authored-by: Elio Bischof <elio@zitadel.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"github.com/zitadel/logging"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/crypto"
|
||||
"github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/zerrors"
|
||||
)
|
||||
|
||||
type authNKey interface {
|
||||
@@ -53,12 +53,12 @@ func NewAuthNKeyPair(keySize int) (privateKey, publicKey []byte, err error) {
|
||||
private, public, err := crypto.GenerateKeyPair(keySize)
|
||||
if err != nil {
|
||||
logging.Log("AUTHN-Ud51I").WithError(err).Error("unable to create authn key pair")
|
||||
return nil, nil, errors.ThrowInternal(err, "AUTHN-gdg2l", "Errors.Project.CouldNotGenerateClientSecret")
|
||||
return nil, nil, zerrors.ThrowInternal(err, "AUTHN-gdg2l", "Errors.Project.CouldNotGenerateClientSecret")
|
||||
}
|
||||
publicKey, err = crypto.PublicKeyToBytes(public)
|
||||
if err != nil {
|
||||
logging.Log("AUTHN-Dbb35").WithError(err).Error("unable to convert public key")
|
||||
return nil, nil, errors.ThrowInternal(err, "AUTHN-Bne3f", "Errors.Project.CouldNotGenerateClientSecret")
|
||||
return nil, nil, zerrors.ThrowInternal(err, "AUTHN-Bne3f", "Errors.Project.CouldNotGenerateClientSecret")
|
||||
}
|
||||
privateKey = crypto.PrivateKeyToBytes(private)
|
||||
return privateKey, publicKey, nil
|
||||
|
Reference in New Issue
Block a user