gitlab-plugin icon indicating copy to clipboard operation
gitlab-plugin copied to clipboard

Plugin's PAT requirements don't match what gitlab generates

Open DominicTulley opened this issue 4 years ago • 1 comments

Issue

The Personal Access Tokens generated in gitlab are no longer 20 characters long. They have a prefix making them 26 characters long. The plugin validates the token you enter and rejects the newly generated tokens as being the wrong length. This change appears to have happened in November 2021.

Jenkins and plugins versions report

Environment
Jenkins: 2.319.1
OS: Linux - 5.10.47-linuxkit
---
ace-editor:1.1
apache-httpcomponents-client-4-api:4.5.13-1.0
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-4
bouncycastle-api:2.25
branch-api:2.7.0
build-timeout:1.20
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-folder:6.17
command-launcher:1.6
credentials:1061.vb_1fceb_58fa_18
credentials-binding:1.27
display-url-api:2.3.5
durable-task:493.v195aefbb0ff2
echarts-api:5.2.2-2
font-awesome-api:5.15.4-5
git:4.10.1
git-client:3.11.0
git-server:1.10
github:1.34.1
github-api:1.301-378.v9807bd746da5
github-branch-source:2.11.4
gitlab-api:1.0.6
gitlab-branch-source:1.5.9
gitlab-plugin:1.5.27
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
jackson2-api:2.13.1-246.va8a9f3eaf46a
jaxb:2.3.0.1
jdk-tool:1.5
jersey2-api:2.35-3
jjwt-api:0.11.2-9.c8b45b8bb173
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.53
ldap:2.7
lockable-resources:2.13
mailer:391.ve4a_38c1b_cf4b_
matrix-auth:3.0
matrix-project:1.19
momentjs:1.1.1
okhttp-api:4.9.3-105.vb96869f8ac3a
pam-auth:1.6.1
pipeline-build-step:2.15
pipeline-github-lib:1.0
pipeline-graph-analysis:188.v3a01e7973f2c
pipeline-input-step:427.va6441fa17010
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.3
pipeline-model-definition:1.9.3
pipeline-model-extensions:1.9.3
pipeline-rest-api:2.20
pipeline-stage-step:291.vf0a8a7aeeb50
pipeline-stage-tags-metadata:1.9.3
pipeline-stage-view:2.20
plain-credentials:1.7
plugin-util-api:2.12.0
popper-api:1.16.1-2
popper2-api:2.11.0-1
resource-disposer:0.17
scm-api:2.6.5
script-security:1118.vba21ca2e3286
snakeyaml-api:1.29.1
ssh-credentials:1.19
sshd:3.1.0
structs:308.v852b473a2b8c
timestamper:1.15
token-macro:267.vcdaea6462991
trilead-api:1.0.13
workflow-aggregator:2.6
workflow-api:1108.v57edf648f5d4
workflow-basic-steps:2.24
workflow-cps:2648.va9433432b33c
workflow-cps-global-lib:552.vd9cc05b8a2e1
workflow-durable-task-step:1112.vda00e6febcc1
workflow-job:1145.v7f2433caa07f
workflow-multibranch:696.v52535c46f4c9
workflow-scm-step:2.13
workflow-step-api:622.vb_8e7c15b_c95a_
workflow-support:804.vba10a18a1476
ws-cleanup:0.40  ```

</details>


### What Operating System are you using (both controller, and any agents involved in the problem)?

Running jenkins official docker image on Mac OS Big Sur.

### Reproduction steps

Install GitLab plugin
Go to Gitlab and generate a new Personal Access Token
Go to Manage Jenkins/Configure System 
Add a credential to the Gitlab Server, choose type "Gitlab Personal Access Token"
Paste in the new token you made.
Observe a validation error because it is not 20 characters long.

### Expected Results

Credential should be saved

### Actual Results

cannot save

### Anything else?

The credential has a prefix now.
Where before the token might be "abcdeabcdeabcdeabcde" it is now "glpat-abcdeabcdeabcdeabcde"

DominicTulley avatar Jan 06 '22 10:01 DominicTulley

Copied to: https://github.com/jenkinsci/gitlab-branch-source-plugin/issues/207

jycchoi avatar May 24 '22 09:05 jycchoi