-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[analyze] Add Analyzer interface for Gitlab #3232
base: main
Are you sure you want to change the base?
Conversation
ccc7f7c
to
ca8ac04
Compare
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 code looks good but the test isn't passing. It looks like the gitlab token is expired:
» curl 'https://gitlab.com/api/v4/personal_access_tokens/self' -H "Private-Token: $GITLAB_TOKEN"
{
"error": "invalid_token",
"error_description": "Token is expired. You can either do re-authorization or token refresh."
}
3b5b769
to
051aadf
Compare
to make more unique FullyQualifiedName, Ids are added for resources.
@mcastorina I have updated the active |
Bindings: []analyzers.Binding{}, | ||
} | ||
|
||
// Add token and it's permissions to bindings |
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.
Are we sure token
should be a resource here? Does the credential we're analyzing grant permission to perform actions on the token?
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.
Yup, The permission determine what action can be perform using that token.
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.
Permissions operate on a resource though, so in this case the permissions would describe operations that could be performed on the token itself, which seems wrong to me..
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.
@mcastorina I had gone through the login. PAT token does belongs to user and we do get userID in response. So, resource can be a User with those permissions. What do you think ?
Description:
This PR implements the analyzer interface for Gitlab.
Checklist:
make test-community
)?make lint
this requires golangci-lint)?