Adding Authz checks that support new pathing (#328)

This commit is contained in:
Todd Knight authored and GitHub committed 2020-09-04 14:48:11 -07:00
1 parent 3d944a616f
commit 1c2c078e0a
46 files changed
+1433 -1165

No files matched your search

+4 -4
View File
@@ -123,8 +123,8 @@ func TestUser_Crud(t *testing.T) {
existed, apiErr, err = userClient.Delete(tc.Context(), u.Id)
require.NoError(err)
assert.Nil(apiErr)
assert.False(existed, "Expected user to not exist when deleted, but it did.")
assert.NotNil(apiErr)
assert.EqualValues(http.StatusForbidden, apiErr.Status)
}
func TestUser_Errors(t *testing.T) {
@@ -156,12 +156,12 @@ func TestUser_Errors(t *testing.T) {
_, apiErr, err = userClient.Read(tc.Context(), iam.UserPrefix+"_doesntexis")
require.NoError(err)
assert.NotNil(apiErr)
assert.EqualValues(http.StatusNotFound, apiErr.Status)
assert.EqualValues(http.StatusForbidden, apiErr.Status)
_, apiErr, err = userClient.Read(tc.Context(), "invalid id")
require.NoError(err)
assert.NotNil(apiErr)
assert.EqualValues(http.StatusForbidden, apiErr.Status)
assert.EqualValues(http.StatusBadRequest, apiErr.Status)
_, apiErr, err = userClient.Update(tc.Context(), u.Id, u.Version)
require.NoError(err)