From e4d67425149b983b70eb22a176ce31a7efe7b6b6 Mon Sep 17 00:00:00 2001 From: Jim Date: Fri, 5 May 2023 13:03:10 -0400 Subject: [PATCH] feat (action/resource): add Download and SessionRecording --- globals/prefixes.go | 1 + internal/types/action/action.go | 3 +++ internal/types/action/action_test.go | 4 ++++ internal/types/resource/resource.go | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/globals/prefixes.go b/globals/prefixes.go index 8ca80c6df0..3e8adae7de 100644 --- a/globals/prefixes.go +++ b/globals/prefixes.go @@ -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 diff --git a/internal/types/action/action.go b/internal/types/action/action.go index ade1ece535..03864fab87 100644 --- a/internal/types/action/action.go +++ b/internal/types/action/action.go @@ -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] } diff --git a/internal/types/action/action_test.go b/internal/types/action/action_test.go index 3f0f2837d8..38c74b00b2 100644 --- a/internal/types/action/action_test.go +++ b/internal/types/action/action_test.go @@ -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) { diff --git a/internal/types/resource/resource.go b/internal/types/resource/resource.go index 46041fa49a..95a2d7344e 100644 --- a/internal/types/resource/resource.go +++ b/internal/types/resource/resource.go @@ -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,