Skip to content

Commit

Permalink
feat: add SSO impersonate feature
Browse files Browse the repository at this point in the history
Signed-off-by: Mathew Wicks <[email protected]>
  • Loading branch information
thesuperzapper committed Nov 18, 2021
1 parent fd79a41 commit 91e72f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/workflowarchive/archived_workflow_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func Test_archivedWorkflowServer(t *testing.T) {
t.Run("ListArchivedWorkflows", func(t *testing.T) {
allowed = false
_, err := w.ListArchivedWorkflows(ctx, &workflowarchivepkg.ListArchivedWorkflowsRequest{ListOptions: &metav1.ListOptions{Limit: 1}})
assert.Equal(t, status.Error(codes.PermissionDenied, "caller is not allowed to 'list' argoproj.io/workflows in namespace ''"), err)
assert.Equal(t, status.Error(codes.PermissionDenied, "caller is not allowed to 'list' argoproj.io/workflows in cluster"), err)
allowed = true
resp, err := w.ListArchivedWorkflows(ctx, &workflowarchivepkg.ListArchivedWorkflowsRequest{ListOptions: &metav1.ListOptions{Limit: 1}})
if assert.NoError(t, err) {
Expand Down Expand Up @@ -117,7 +117,7 @@ func Test_archivedWorkflowServer(t *testing.T) {
t.Run("GetArchivedWorkflow", func(t *testing.T) {
allowed = false
_, err := w.GetArchivedWorkflow(ctx, &workflowarchivepkg.GetArchivedWorkflowRequest{Uid: "my-uid"})
assert.Equal(t, status.Error(codes.PermissionDenied, "caller is not allowed to 'get' argoproj.io/workflows/my-name in namespace ''"), err)
assert.Equal(t, status.Error(codes.PermissionDenied, "caller is not allowed to 'get' argoproj.io/workflows/my-name in cluster"), err)
allowed = true
_, err = w.GetArchivedWorkflow(ctx, &workflowarchivepkg.GetArchivedWorkflowRequest{})
assert.Equal(t, err, status.Error(codes.NotFound, "not found"))
Expand All @@ -129,7 +129,7 @@ func Test_archivedWorkflowServer(t *testing.T) {
allowed = false
_, err := w.DeleteArchivedWorkflow(ctx, &workflowarchivepkg.DeleteArchivedWorkflowRequest{Uid: "my-uid"})
// note, this is 'get', not 'delete', because `archivedWorkflowServer.DeleteArchivedWorkflow()` attempts to 'get' the workflow before deleting it
assert.Equal(t, status.Error(codes.PermissionDenied, "caller is not allowed to 'get' argoproj.io/workflows/my-name in namespace ''"), err)
assert.Equal(t, status.Error(codes.PermissionDenied, "caller is not allowed to 'get' argoproj.io/workflows/my-name in cluster"), err)
allowed = true
_, err = w.DeleteArchivedWorkflow(ctx, &workflowarchivepkg.DeleteArchivedWorkflowRequest{Uid: "my-uid"})
assert.NoError(t, err)
Expand Down

0 comments on commit 91e72f3

Please sign in to comment.