Skip to content

Commit e47dc98

Browse files
Review fixes
1 parent 47edd6a commit e47dc98

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pkg/agent/rest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ func FindAuthTokenFromAssetStore(assetDir string) (string, error) {
132132

133133
if authConfigError != nil {
134134
logrus.Debug(errors.Wrapf(authConfigError, "failed to load %s", authConfigAsset.Name()))
135+
return "", errors.New("failed to load AuthConfig")
135136
}
136137

137138
token := authConfig.(*gencrypto.AuthConfig).Token

pkg/asset/agent/gencrypto/authconfig.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ func (a *AuthConfig) Generate(dependencies asset.Parents) error {
4444
infraEnvID := &common.InfraEnvID{}
4545
dependencies.Get(infraEnvID)
4646

47-
PublicKey, PrivateKey, err := keyPairPEM()
47+
publicKey, privateKey, err := keyPairPEM()
4848
if err != nil {
4949
return err
5050
}
5151
// Encode to Base64 (Standard encoding)
52-
encodedPubKeyPEM := base64.StdEncoding.EncodeToString([]byte(PublicKey))
52+
encodedPubKeyPEM := base64.StdEncoding.EncodeToString([]byte(publicKey))
5353

5454
a.PublicKey = encodedPubKeyPEM
5555

56-
token, err := localJWTForKey(infraEnvID.ID, PrivateKey)
56+
token, err := localJWTForKey(infraEnvID.ID, privateKey)
5757
if err != nil {
5858
return err
5959
}

0 commit comments

Comments
 (0)