generated from bitwarden/template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
bitwardensecret_types.go
105 lines (85 loc) · 3.82 KB
/
bitwardensecret_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
Source code in this repository is covered by one of two licenses: (i) the
GNU General Public License (GPL) v3.0 (ii) the Bitwarden License v1.0. The
default license throughout the repository is GPL v3.0 unless the header
specifies another license. Bitwarden Licensed code is found only in the
/bitwarden_license directory.
GPL v3.0:
https://github.com/bitwarden/server/blob/main/LICENSE_GPL.txt
Bitwarden License v1.0:
https://github.com/bitwarden/server/blob/main/LICENSE_BITWARDEN.txt
No grant of any rights in the trademarks, service marks, or logos of Bitwarden is
made (except as may be necessary to comply with the notice requirements as
applicable), and use of any Bitwarden trademarks must comply with Bitwarden
Trademark Guidelines
<https://github.com/bitwarden/server/blob/main/TRADEMARK_GUIDELINES.md>.
*/
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// BitwardenSecretSpec defines the desired state of BitwardenSecret
type BitwardenSecretSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
// The organization ID for your organization
// +kubebuilder:Optional
OrganizationId string `json:"organizationId"`
// The name of the secret for the
// +kubebuilder:Required
SecretName string `json:"secretName"`
// The mapping of organization secret IDs to K8s secret keys. This helps improve readability and mapping to environment variables.
// +kubebuilder:Optional
SecretMap []SecretMap `json:"map,omitempty"`
// The secret key reference for the authorization token used to connect to Secrets Manager
// +kubebuilder:Required
AuthToken AuthToken `json:"authToken"`
}
type AuthToken struct {
// The name of the Kubernetes secret where the authorization token is stored
// +kubebuilder:Required
SecretName string `json:"secretName"`
// The key of the Kubernetes secret where the authorization token is stored
// +kubebuilder:Required
SecretKey string `json:"secretKey"`
}
type SecretMap struct {
// The ID of the secret in Secrets Manager
// +kubebuilder:Required
BwSecretId string `json:"bwSecretId"`
// The name of the mapped key in the created Kubernetes secret
// +kubebuilder:Required
SecretKeyName string `json:"secretKeyName"`
}
// BitwardenSecretStatus defines the observed state of BitwardenSecret
type BitwardenSecretStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
// Conditions store the status conditions of the BitwardenSecret instances
// +operator-sdk:csv:customresourcedefinitions:type=status
LastSuccessfulSyncTime metav1.Time `json:"lastSuccessfulSyncTime,omitempty"`
// Conditions store the status conditions of the BitwardenSecret instances
// +operator-sdk:csv:customresourcedefinitions:type=status
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// BitwardenSecret is the Schema for the bitwardensecrets API
type BitwardenSecret struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec BitwardenSecretSpec `json:"spec,omitempty"`
Status BitwardenSecretStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// BitwardenSecretList contains a list of BitwardenSecret
type BitwardenSecretList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []BitwardenSecret `json:"items"`
}
func init() {
SchemeBuilder.Register(&BitwardenSecret{}, &BitwardenSecretList{})
}