-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes_secret.go
More file actions
61 lines (50 loc) · 2.25 KB
/
types_secret.go
File metadata and controls
61 lines (50 loc) · 2.25 KB
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
package slicer
import "time"
// Secret represents a secret stored in the slicer system.
// Secrets can be used to store sensitive configuration data, keys, or other private information
// that can be mounted into nodes or used by services.
type Secret struct {
// Name is the unique name of the secret
Name string `json:"name"`
// Size is the size of the secret data in bytes
Size int64 `json:"size"`
// Permissions specifies the file permissions for the secret (e.g., "0600")
Permissions string `json:"permissions"`
// GID is the user ID that should own the secret file. If not set, the default for
// a uint32 will be used i.e root.
UID uint32 `json:"uid,omitempty"`
// GID is the group ID that should own the secret file. If not set, the default for
// a uint32 will be used i.e root.
GID uint32 `json:"gid,omitempty"`
// ModifiedAt is the time the secret was last modified
ModifiedAt *time.Time `json:"modified_at,omitempty"`
}
// CreateSecretRequest is the payload for creating a new secret via the REST API.
type CreateSecretRequest struct {
// Name is the unique name of the secret
Name string `json:"name"`
// Data is the secret content
Data string `json:"data"`
// Permissions specifies the file permissions (defaults to system default)
Permissions string `json:"permissions,omitempty"`
// GID is the user ID that should own the secret file. If not set, the default for
// a uint32 will be used i.e root.
UID uint32 `json:"uid,omitempty"`
// GID is the group ID that should own the secret file. If not set, the default for
// a uint32 will be used i.e root.
GID uint32 `json:"gid,omitempty"`
}
// UpdateSecretRequest is the payload for updating an existing secret via the REST API.
// All fields are optional - only provided fields will be updated.
type UpdateSecretRequest struct {
// Data is the updated secret content
Data string `json:"data"`
// Permissions specifies the file permissions
Permissions string `json:"permissions,omitempty"`
// GID is the user ID that should own the secret file. If not set, the default for
// a uint32 will be used i.e root.
UID uint32 `json:"uid,omitempty"`
// GID is the group ID that should own the secret file. If not set, the default for
// a uint32 will be used i.e root.
GID uint32 `json:"gid,omitempty"`
}