Skip to content

Commit

Permalink
Ability to set a Preemptive bearer token for npm proxy (#388)
Browse files Browse the repository at this point in the history
* Update create_repos_from_list.groovy

* Update README.md

---------

Co-authored-by: Olivier Clavel <olivier.clavel@gmail.com>
  • Loading branch information
brianveltman and zeitounator committed Dec 15, 2023
1 parent 2a6888d commit 0b5a659
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,14 @@ Feel free to use them or implement your own install scenario at your convenience
- jboss
- vaadin-addons
- jaspersoft
nexus_repos_npm_proxy:
- name: npm-proxy-name
blob_store: company-artifacts
remote_url: https://some-private-registry.dev/
remote_username: 'secret-username'
remote_password: "{{ vault_alfresco_secret_password }}"
# You can use a Preemptive Bearer Token as well by defining the bearerToken property
# bearerToken: "{{ vault_alfresco_secret_bearertoken }}"


roles:
Expand Down
8 changes: 8 additions & 0 deletions files/groovy/create_repos_from_list.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ parsed_args.each { currentRepo ->
]
}

// Configs for npm proxy repos usign bearer token
if (currentRepo.bearerToken && currentRepo.type == 'proxy' && currentRepo.format == 'npm') {
configuration.attributes['httpclient']['authentication'] = [
type: 'bearerToken',
bearerToken: currentRepo.bearerToken
]
}

// Configs for docker proxy repos
if (currentRepo.type == 'proxy' && currentRepo.format == 'docker') {
configuration.attributes['dockerProxy'] = [
Expand Down

0 comments on commit 0b5a659

Please sign in to comment.