Skip to content

Commit ce15cd3

Browse files
author
Mauricio Harley
committed
Barbican Support for Luna HSM
Signed-off-by: Mauricio Harley <[email protected]>
1 parent 74c8370 commit ce15cd3

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

api/v1beta1/barbicanapi_types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ type APIOverrideSpec struct {
5858
Service map[service.Endpoint]service.RoutedOverrideSpec `json:"service,omitempty"`
5959
}
6060

61-
// +kubebuilder:validation:Enum=simple_crypto;pkcs11
62-
type SecretStore string
63-
6461
// BarbicanAPISpec defines the desired state of BarbicanAPI
6562
type BarbicanAPISpec struct {
6663
BarbicanTemplate `json:",inline"`

api/v1beta1/barbicanworker_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type BarbicanWorkerSpec struct {
5151
// +kubebuilder:validation:Optional
5252
// +kubebuilder:validation:MinItems=1
5353
// +kubebuilder:validation:MaxItems=2
54-
EnabledSecretStores []SecretStore `json:"enabledSecretStores"`
54+
EnabledSecretStores []SecretStore `json:"enabledSecretStores,omitempty"`
5555

5656
// +kubebuilder:validation:Optional
5757
// +kubebuilder:default="simple_crypto"

templates/barbican/config/00-default.conf

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[DEFAULT]
22
# keep this for backward compatibility
33
sql_connection = {{ .DatabaseConnection }}
4-
{{ if (index . "ServiceURL") }}
4+
{{- if (index . "ServiceURL") }}
55
host_href = {{ .ServiceURL }}
6-
{{ end }}
6+
{{- end }}
77
debug = true
88
transport_url = {{ .TransportURL }}
99
log_file = {{ .LogFile }}
@@ -13,7 +13,7 @@ max_retries=-1
1313
db_max_retries=-1
1414
connection={{ .DatabaseConnection }}
1515

16-
{{ if (index . "KeystoneAuthURL") }}
16+
{{- if (index . "KeystoneAuthURL") }}
1717
[keystone_authtoken]
1818
auth_version = v3
1919
auth_url={{ .KeystoneAuthURL }}
@@ -24,7 +24,7 @@ password = {{ .ServicePassword }}
2424
project_name=service
2525
project_domain_name=Default
2626
interface = internal
27-
{{ end }}
27+
{{- end }}
2828

2929
[keystone_notifications]
3030
enable = true
@@ -33,40 +33,42 @@ topic = barbican_notifications
3333
[oslo_messaging_notifications]
3434
driver=messagingv2
3535

36-
{{ if (index . "EnableSecureRBAC") }}
36+
{{- if (index . "EnableSecureRBAC") }}
3737
[oslo_policy]
3838
enforce_scope = {{ .EnableSecureRBAC }}
3939
enforce_new_defaults = {{ .EnableSecureRBAC }}
40-
{{ end }}
40+
{{- end }}
4141

4242
[queue]
4343
enable = true
4444

4545
[secretstore]
4646
enable_multiple_secret_stores = true
4747
stores_lookup_suffix = {{ .EnabledSecretStores }}
48-
48+
# enabled_secretstore_plugins = store_crypto
4949
{{ if .SimpleCryptoEnabled }}
50-
[secretstore:software]
50+
[secretstore:simple_crypto]
5151
secret_store_plugin = store_crypto
5252
crypto_plugin = simple_crypto
53-
{{ end }}
54-
{{ if eq .GlobalDefaultSecretStore "simple_crypto" }} global_default = true {{ end }}
53+
{{- if eq .GlobalDefaultSecretStore "simple_crypto" }}
54+
global_default = true
55+
{{- end }}
5556

56-
{{ if .SimpleCryptoEnabled }}
5757
[simple_crypto_plugin]
5858
plugin_name = Software Only Crypto
59-
{{ end }}
60-
{{ if (index . "SimpleCryptoKEK") }} kek = {{ .SimpleCryptoKEK }} {{ end }}
61-
59+
{{- if (index . "SimpleCryptoKEK") }}
60+
kek = {{ .SimpleCryptoKEK }}
61+
{{- end }}
62+
{{- end }}
6263
{{ if and (index . "HSMEnabled") .HSMEnabled }}
6364
[secretstore:pkcs11]
6465
secret_store_plugin = store_crypto
6566
crypto_plugin = p11_crypto
67+
{{- if eq .GlobalDefaultSecretStore "pkcs11" }}
68+
global_default = true
6669
{{ end }}
67-
{{ if eq .GlobalDefaultSecretStore "pkcs11" }} global_default = true {{ end }}
6870

69-
{{ if and (index . "HSMEnabled") .HSMEnabled }}
71+
>>>>>>> cb6279b (Barbican Support for Luna HSM)
7072
[p11_crypto_plugin]
7173
library_path = {{ .HSMLibraryPath }}
7274
token_serial_number = {{ .HSMTokenSerialNumber }}

0 commit comments

Comments
 (0)