Skip to content

Add endpoint for self personal access token creation in UserApi #1260

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

Merged
merged 1 commit into from
Jun 30, 2025

Conversation

loicgreffier
Copy link
Contributor

@loicgreffier loicgreffier commented Jun 29, 2025

Fixes #1257.

This PR adds:

  • Support for the POST /user/personal_access_tokens endpoint.
  • Support for the k8s_proxy scope.

Basically, the update reuses the existing createPersonalAccessTokenOrImpersonationToken function and updating it to use the /user/personal_access_tokens endpoint when userIdOrUsername is not defined.

Link to the documentation: https://docs.gitlab.com/api/user_tokens/#create-a-personal-access-token


👉 Unrelated to this PR, but the build was failing by default on Windows due to a special quote character in Setting.java:

* When set to false disable the “You won’t be able to pull or push project code

Setting.java:1135: error: unmappable character (0x9D) for encoding windows-1252
     * via SSH�? warning shown to users with no uploaded SSH key.

If needed, I can include a fix for this in this PR or submit it separately.

@jmini jmini merged commit 204d6d6 into gitlab4j:main Jun 30, 2025
2 checks passed
@jmini
Copy link
Collaborator

jmini commented Jun 30, 2025

@loicgreffier Thank you for this contribution! 🎉

the build was failing by default on Windows due to a special quote character in Setting.java

Yes please this can be fixed in a follow up PR.

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.

Support create a self personal access token in UserApi
2 participants