Skip to content

Commit 25a7bf4

Browse files
committed
do not include BASIC_AUTH_KEY in generated storage secret
1 parent 86283a7 commit 25a7bf4

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

internal/controllers/secrets.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import (
1919
"errors"
2020
"fmt"
2121

22-
b64 "encoding/base64"
23-
2422
"github.com/cryostatio/cryostat-operator/internal/controllers/constants"
2523
"github.com/cryostatio/cryostat-operator/internal/controllers/model"
2624
corev1 "k8s.io/api/core/v1"
@@ -123,9 +121,6 @@ const storageSecretAccessKey = "ACCESS_KEY"
123121
// storageSecretUserKey indexes the password within the Cryostat storage Secret
124122
const storageSecretPassKey = "SECRET_KEY"
125123

126-
// storageSecretBasicAuthKey indexes the Basic auth credentials (Base64-encoded) within the Cryostat storage Secret
127-
const storageSecretBasicAuthKey = "BASIC_AUTH_KEY"
128-
129124
func (r *Reconciler) reconcileStorageSecret(ctx context.Context, cr *model.CryostatInstance) error {
130125
secret := &corev1.Secret{
131126
ObjectMeta: metav1.ObjectMeta{
@@ -145,7 +140,6 @@ func (r *Reconciler) reconcileStorageSecret(ctx context.Context, cr *model.Cryos
145140
passwd := r.GenPasswd(32)
146141
secret.StringData[storageSecretAccessKey] = accessKey
147142
secret.StringData[storageSecretPassKey] = passwd
148-
secret.StringData[storageSecretBasicAuthKey] = b64.StdEncoding.EncodeToString(fmt.Appendf(nil, "%s:%s", accessKey, passwd))
149143
}
150144
return nil
151145
})

internal/test/resources.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,9 +1805,8 @@ func (r *TestResources) NewStorageSecret() *corev1.Secret {
18051805
Namespace: r.Namespace,
18061806
},
18071807
Data: map[string][]byte{
1808-
"SECRET_KEY": []byte("object_storage"),
1809-
"ACCESS_KEY": []byte("cryostat"),
1810-
"BASIC_AUTH_KEY": []byte("Y3J5b3N0YXQ6b2JqZWN0X3N0b3JhZ2U="),
1808+
"SECRET_KEY": []byte("object_storage"),
1809+
"ACCESS_KEY": []byte("cryostat"),
18111810
},
18121811
}
18131812
}

0 commit comments

Comments
 (0)