-
Notifications
You must be signed in to change notification settings - Fork 291
test: add grants test for auth-token resource #5588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: llb-normalized-grants-tests-only
Are you sure you want to change the base?
test: add grants test for auth-token resource #5588
Conversation
89e5134
to
aae3126
Compare
} | ||
} | ||
|
||
func TestGrants_Read(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test that covers output_fields=*
to verify that all the fields are being returned properly in the happy path case?
if tc.wantErr != nil { | ||
require.ErrorIs(t, finalErr, tc.wantErr) | ||
return | ||
testcases := []struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a few negative tests for missing permissions, tests with specific scope grants, and tests with specific resource ID grants?
} | ||
} | ||
|
||
func TestGrants_ReadSelf(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a case that covers grants with specific resource ID?
} | ||
} | ||
|
||
func TestGrants_DeleteSelf(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests for specific resource ID grants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the changes LGTM! I'd like to see a few more test cases covering grants with specific IDs - specifically for ...-self
calls where the granted resource ID doesn't match the user's token
* Fix bug where the `ParentScopeId` is not set when fetching output fields for a resource. Output fields were not being respected for children grant scopes.
- add test that tests the grants for the auth-token resource with different actions, scopes and output fields
85c9230
to
0fcf4e5
Compare
test: add grants test for auth-token resource
ParentScopeId
is not set when fetching output fields for a resource. Output fields were not being respected for children grant scopes.