mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Rbac more coderd endpoints, unit test to confirm (#1437)
* feat: Enforce authorize call on all endpoints - Make 'request()' exported for running custom requests * Rbac users endpoints * 401 -> 403
This commit is contained in:
@@ -110,7 +110,7 @@ func TestAutostart(t *testing.T) {
|
||||
clitest.SetupConfig(t, client, root)
|
||||
|
||||
err := cmd.Execute()
|
||||
require.ErrorContains(t, err, "status code 404: no workspace found by name", "unexpected error")
|
||||
require.ErrorContains(t, err, "status code 403: forbidden", "unexpected error")
|
||||
})
|
||||
|
||||
t.Run("Disable_NotFound", func(t *testing.T) {
|
||||
@@ -128,7 +128,7 @@ func TestAutostart(t *testing.T) {
|
||||
clitest.SetupConfig(t, client, root)
|
||||
|
||||
err := cmd.Execute()
|
||||
require.ErrorContains(t, err, "status code 404: no workspace found by name", "unexpected error")
|
||||
require.ErrorContains(t, err, "status code 403: forbidden", "unexpected error")
|
||||
})
|
||||
|
||||
t.Run("Enable_DefaultSchedule", func(t *testing.T) {
|
||||
|
||||
@@ -109,7 +109,7 @@ func TestAutostop(t *testing.T) {
|
||||
clitest.SetupConfig(t, client, root)
|
||||
|
||||
err := cmd.Execute()
|
||||
require.ErrorContains(t, err, "status code 404: no workspace found by name", "unexpected error")
|
||||
require.ErrorContains(t, err, "status code 403: forbidden", "unexpected error")
|
||||
})
|
||||
|
||||
t.Run("Disable_NotFound", func(t *testing.T) {
|
||||
@@ -127,7 +127,7 @@ func TestAutostop(t *testing.T) {
|
||||
clitest.SetupConfig(t, client, root)
|
||||
|
||||
err := cmd.Execute()
|
||||
require.ErrorContains(t, err, "status code 404: no workspace found by name", "unexpected error")
|
||||
require.ErrorContains(t, err, "status code 403: forbidden", "unexpected error")
|
||||
})
|
||||
|
||||
t.Run("Enable_DefaultSchedule", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user