Skip to content
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

add PersonalAccessTokenApi #934 #1150

Merged
merged 2 commits into from
Oct 13, 2024

Conversation

katrinSaleschus
Copy link
Contributor

@katrinSaleschus katrinSaleschus commented Aug 13, 2024

Fixes #934

* Rotates the given personal access token.
* The token is revoked and a new one which will expire in one week is created to replace it.
* Only working with GitLab 16.0 and above.
*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually we mention the endpoint called in the javadoc (easier to find later), can you add something like:

     * <pre><code>GitLab Endpoint: POST /personal_access_tokens/self/rotate</code></pre>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a json file in src/test/resources/org/gitlab4j/api and a test case in TestGitLabApiBeans for this new model class

@jmini jmini force-pushed the addRotatePersonalAccessToken branch from 01371f3 to 77cf7d2 Compare October 13, 2024 05:50
@jmini jmini changed the base branch from 6.x to main October 13, 2024 05:55
@jmini
Copy link
Collaborator

jmini commented Oct 13, 2024

I have rebased the source branch of this PR (addrotatepersonalaccesstoken in the katrinsaleschus fork) on top of main of this repo:

git rebase --onto origin/main db1a7585eee4f77b53fe236950d113816ed9502b
git push katrinsaleschus HEAD:addrotatepersonalaccesstoken --force

Be aware that your local branch addrotatepersonalaccesstoken has diverged with the one on the GitHub.

If you need to do one more changes on this branch:
I recommend to use git fetch and git reset --hard origin/addrotatepersonalaccesstoken (assuming your local origin is pointing to the katrinsaleschus fork on GitHub) before doing any local modifications instead of git pull.

I have changed the target branch of this PR to be main

I have added the missing test and did the necessary fixes

@jmini jmini merged commit bd8504e into gitlab4j:main Oct 13, 2024
1 check failed
@jmini
Copy link
Collaborator

jmini commented Oct 13, 2024

Merged to main and 6.x. Thank you for this contribution 🎉

@jmini jmini mentioned this pull request Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Personal access tokens API
2 participants