-
Notifications
You must be signed in to change notification settings - Fork 11
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
initial version of group access token #50
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #50 +/- ##
==========================================
- Coverage 59.45% 55.92% -3.54%
==========================================
Files 10 10
Lines 550 608 +58
==========================================
+ Hits 327 340 +13
- Misses 195 240 +45
Partials 28 28
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
there is some linting issues but it looks very cool, i really wanna try this feature
@nickshine Hi. is this still used and maintained outside here? and also, is it compatible with the running gitlab versions (I don't know which version but based on version compatibility, this should work). I'm more than happy to hand this someone who's actively using and potentially maintaining it |
Hey @M0roSan , yep this is still used and compatible with GitLab 15.x. Group access token feature hasn't been implemented b/c nobody has been asking for it, at least not that I've seen. |
I'll take a look at this and see if we can test it out internally (and also update CI). |
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.
PGS is looking to use this. Initial testing shows that it works with our self-hosted GitLab instance (15.11.2-ee)
func (baseTokenStorage *BaseTokenStorageEntry) createAccessToken(gc Client, expiresAt time.Time) (data map[string]interface{}, err error) { | ||
switch baseTokenStorage.TokenType { | ||
case tokenTypeGroup: | ||
gat, err := gc.CreateGroupAccessToken(baseTokenStorage, &expiresAt) |
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.
This shadows err
} | ||
data = groupTokenDetails(gat) | ||
case tokenTypeProject: | ||
pat, err := gc.CreateProjectAccessToken(baseTokenStorage, &expiresAt) |
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.
Also shadows err
as described in the issue, only adding
token_type
in BaseTokenStorage and it'll do population.TODO: switch to create group/project access token based on
token_type
fieldhaven't tested with gitlab instance nor vault instance yet
close #36