Skip to content

Commit

Permalink
use admin client instead of backend directly
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoandredinis committed Jan 10, 2025
1 parent 61bb2ec commit 8f0e59c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/web/usertasks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
usertasksv1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/usertasks/v1"
"github.com/gravitational/teleport/api/types"
"github.com/gravitational/teleport/api/types/usertasks"
"github.com/gravitational/teleport/lib/auth"
"github.com/gravitational/teleport/lib/services"
"github.com/gravitational/teleport/lib/web/ui"
)
Expand All @@ -53,6 +54,8 @@ func TestUserTask(t *testing.T) {
})
require.NoError(t, err)
pack := env.proxies[0].authPack(t, userWithRW, []types.Role{roleRWUserTask})
adminClient, err := env.server.NewClient(auth.TestAdmin())
require.NoError(t, err)

getAllEndpoint := pack.clt.Endpoint("webapi", "sites", clusterName, "usertask")
singleItemEndpoint := func(name string) string {
Expand Down Expand Up @@ -90,7 +93,7 @@ func TestUserTask(t *testing.T) {
})
require.NoError(t, err)

_, err = env.proxies[0].auth.Auth().CreateUserTask(ctx, userTask)
_, err = adminClient.UserTasksServiceClient().CreateUserTask(ctx, userTask)
require.NoError(t, err)
userTaskForTest = userTask
}
Expand Down

0 comments on commit 8f0e59c

Please sign in to comment.