-
Notifications
You must be signed in to change notification settings - Fork 960
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
Support more options for list PATs #1977
Conversation
personal_access_tokens.go
Outdated
CreatedAfter *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"` | ||
CreatedBefore *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"` | ||
LastUsedAfter *time.Time `url:"last_used_after,omitempty" json:"last_used_after,omitempty"` | ||
LastUsedBefore *time.Time `url:"last_used_before,omitempty" json:"last_used_before,omitempty"` |
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.
I guess these *time.Time
fields should be *ISOTime
looking at the docs. Can you check/confirm?
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.
I check gitlab api document and confirm that you are right,we need to use *ISOTime instead of *time.Time
I have change the type
personal_access_tokens.go
Outdated
Revoked *bool `url:"revoked,omitempty" json:"revoked,omitempty"` | ||
Search *string `url:"search,omitempty" json:"search,omitempty"` | ||
State *string `url:"state,omitempty" json:"state,omitempty"` | ||
UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` |
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.
Think this should be an interface{}
as it can be either a string or an in. Not sure if we have that elsewhere and already have something for that more specific than an interface{}
...
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.
We declare user id as type int in all our sdk golang code. Even through gitlab list PATs api support user id as type string in query string paramers as well, I think it's better to just declare user id as type int.
Supporting type string may increase complexity and inconsistency
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.
I'll take it, thanks!
In my production environment, hope that we can support more options for list PATs.
I have run my branch in production for a week, and it runs well yet