Enhancement #1984
Use credentials plugin for authenticating SCM access
Status: | Resolved | Start date: | 09/08/2014 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | J. Moringen | % Done: | 100% | |
Category: | Jenkins API | |||
Target version: | 0.5 |
Description
We have found out a quite simple way to use the credentials plugin of jenkins in combination with the generator.
There are currently two URLs available that expose the existing credentials:
- https://ci.cor-lab.org/descriptorByName/hudson.scm.SubversionSCM$ModuleLocation/fillCredentialsIdItems
- https://ci.cor-lab.org/descriptorByName/hudson.plugins.git.UserRemoteConfig/fillCredentialsIdItems
These URLs, in contrast to the API, also include the description given to each credential pair.
The following scheme might work.
For each generated job, the generator checks whether a credential pair exists with a description containing the pattern SOME IDENTIFIER: <project name>
. In case such a pair exists at generation time, the generator will configure the job to use these credentials. Otherwise, no authentication will be used. Maybe we could also override the identifier / string to match also in the config file and / or on the command line. Especially with the command line, users could end up with a configuration where only one credential pair is used for all jobs, which would be quite nice.
Related issues
Associated revisions
Support credentials for git, svn in lib/jenkins.api/, src/projects/aspects.lisp
fixes #1984
- src/api/classes.lisp (define-interface-implementations scm): added
credentials slot to subversion and git plugins
(define-of-type-methods builder): new method - src/api/package.lisp (package jenkins.api): added exported symbol
credentials - src/project/aspects.lisp (define-aspect git): use value of
:aspect.git.credentials variable for :credentials initarg
(subversion): similar for :aspect.subversion.credentials
Use access property for auto credentials in src/{project/aspects,commandline-interface/main}.lisp
refs #1984
Specifying "access": "private" in a project recipe makes
"scm.credentials" default to the host part of the repository URL.
- src/commandline-interface/main.lisp (analyze-project): cosmetic change
- src/project/aspects.lisp (define-aspect subversion): if credentials
variable is not set, maybe derive credentials form URL
(define-aspect git): likewise
History
#1 Updated by J. Wienke over 9 years ago
#2 Updated by J. Moringen over 9 years ago
- Related to Enhancement #1848: Do not remove repository credentials while regenerating a job added
#3 Updated by J. Moringen over 9 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
#4 Updated by J. Wienke over 9 years ago
Btw, security fixes for these URLs are on their way ;)
#5 Updated by J. Moringen about 9 years ago
- Related to Tasks #1676: Support repository authentication for parsing added
#6 Updated by J. Moringen about 9 years ago
- Status changed from In Progress to Resolved
- % Done changed from 10 to 100
Applied in changeset 3222a530df11970881b69b64bc092aad929bb588.
#7 Updated by J. Moringen over 7 years ago
- Target version set to 0.5