feat (action/resource): add Download and SessionRecording

This commit is contained in:
Jim authored and Timothy Messier committed 2023-05-31 12:18:16 +00:00
1 parent 46348d7b49
commit e4d6742514
4 files changed
+12

No files matched your search

+1
View File
@@ -160,6 +160,7 @@ var prefixToResourceType = map[string]resource.Type{
SshTargetPrefix: resource.Target,
WorkerPrefix: resource.Worker,
PluginStorageBucketPrefix: resource.StorageBucket,
SessionRecordingPrefix: resource.SessionRecording,
}
// ResourceTypeFromPrefix takes in a resource ID (or a prefix) and returns the
+3
View File
@@ -67,6 +67,7 @@ const (
RotateScopeKeys Type = 53
ListScopeKeyVersionDestructionJobs Type = 54
DestroyScopeKeyVersion Type = 55
Download Type = 56
// When adding new actions, be sure to update:
//
@@ -130,6 +131,7 @@ var Map = map[string]Type{
RotateScopeKeys.String(): RotateScopeKeys,
ListScopeKeyVersionDestructionJobs.String(): ListScopeKeyVersionDestructionJobs,
DestroyScopeKeyVersion.String(): DestroyScopeKeyVersion,
Download.String(): Download,
}
var DeprecatedMap = map[string]Type{
@@ -199,6 +201,7 @@ func (a Type) String() string {
"rotate-keys",
"list-key-version-destruction-jobs",
"destroy-key-version",
"download",
}[a]
}
+4
View File
@@ -134,6 +134,10 @@ func TestAction(t *testing.T) {
action: DestroyScopeKeyVersion,
want: "destroy-key-version",
},
{
action: Download,
want: "download",
},
}
for _, tt := range tests {
t.Run(tt.want, func(t *testing.T) {
+4
View File
@@ -25,6 +25,7 @@ const (
Controller
Worker
Session
SessionRecording
ManagedGroup
CredentialStore
CredentialLibrary
@@ -62,6 +63,7 @@ func (r Type) String() string {
"controller",
"worker",
"session",
"session-recording",
"managed-group",
"credential-store",
"credential-library",
@@ -96,6 +98,7 @@ var Map = map[string]Type{
Controller.String(): Controller,
Worker.String(): Worker,
Session.String(): Session,
SessionRecording.String(): SessionRecording,
ManagedGroup.String(): ManagedGroup,
CredentialStore.String(): CredentialStore,
CredentialLibrary.String(): CredentialLibrary,
@@ -139,6 +142,7 @@ func TopLevelType(typ Type) bool {
Role,
Scope,
Session,
SessionRecording,
Target,
User,
StorageBucket,