Enhancement #1984

Use credentials plugin for authenticating SCM access

Added by J. Wienke over 9 years ago. Updated over 7 years ago.

Status:ResolvedStart date:09/08/2014
Priority:NormalDue 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:

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

Related to Automated Build Generator - Enhancement #1848: Do not remove repository credentials while regenerating a... Rejected 04/16/2014
Related to Automated Build Generator - Tasks #1676: Support repository authentication for parsing In Progress 12/04/2013

Associated revisions

Revision 3222a530
Added by J. Moringen about 9 years ago

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

Revision d5bb24bd
Added by J. Moringen about 9 years ago

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

I have opened to issues upstream to improve the real API for accessing this kind of information:

#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

#7 Updated by J. Moringen over 7 years ago

  • Target version set to 0.5

Also available in: Atom PDF