Skip to content

Commit

Permalink
Add secret scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-sadura authored and RafalKorepta committed Nov 27, 2024
1 parent f888ad1 commit 0123b37
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions operator/api/vectorized/v1alpha1/console_enterprise_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ type SecretStore struct {
GCPSecretManager *SecretManagerGCP `json:"gcpSecretManager,omitempty"`
AWSSecretManager *SecretManagerAWS `json:"awsSecretManager,omitempty"`
KafkaConnect *SecretStoreKafkaConnect `json:"kafkaConnect,omitempty"`
// Scopes is a list of supported secret scopes
Scopes []string `json:"scopes,omitempty"`
}

// SecretManagerGCP is the configuration object for using Google Cloud's secret manager.
Expand Down
5 changes: 5 additions & 0 deletions operator/api/vectorized/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,11 @@ spec:
- clusters
- enabled
type: object
scopes:
description: Scopes is a list of supported secret scopes
items:
type: string
type: array
secretNamePrefix:
description: |-
SecretNamePrefix is the prefix that shall be used for each secret name
Expand Down
7 changes: 7 additions & 0 deletions operator/pkg/console/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,19 @@ func (cm *ConfigMap) genSecretStore() EnterpriseSecretStore {
})
}
}
s := EnterpriseSecretStoreScopes{}
if ss.Scopes != nil {
s = EnterpriseSecretStoreScopes{
Scopes: ss.Scopes,
}
}
return EnterpriseSecretStore{
Enabled: ss.Enabled,
SecretNamePrefix: ss.SecretNamePrefix,
GCPSecretManager: smGCP,
AWSSecretManager: smAWS,
KafkaConnect: kc,
Scopes: s,
}
}

Expand Down
5 changes: 5 additions & 0 deletions operator/pkg/console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ type EnterpriseSecretStore struct {
GCPSecretManager EnterpriseSecretManagerGCP `json:"gcpSecretManager" yaml:"gcpSecretManager"`
AWSSecretManager EnterpriseSecretManagerAWS `json:"awsSecretManager" yaml:"awsSecretManager"`
KafkaConnect EnterpriseSecretStoreKafkaConnect `json:"kafkaConnect" yaml:"kafkaConnect"`
Scopes EnterpriseSecretStoreScopes `json:"scopes" yaml:"scopes"`
}

type EnterpriseSecretManagerGCP struct {
Expand All @@ -186,6 +187,10 @@ type EnterpriseSecretStoreKafkaConnect struct {
Clusters []EnterpriseSecretStoreKafkaConnectCluster `json:"clusters" yaml:"clusters"`
}

type EnterpriseSecretStoreScopes struct {
Scopes []string `json:"scopes" yaml:"scopes"`
}

type EnterpriseSecretStoreKafkaConnectCluster struct {
Name string `json:"name" yaml:"name"`
SecretNamePrefixAppend string `json:"secretNamePrefixAppend" yaml:"secretNamePrefixAppend"`
Expand Down

0 comments on commit 0123b37

Please sign in to comment.