GitHub user sjcorbett opened a pull request:
https://github.com/apache/brooklyn-server/pull/918
Blueprints can include username and password for catalog libraries
For example:
```yaml
brooklyn.catalog:
id: simple-example
version: "1.0"
itemType: template
libraries:
- url: https://nexus.example.com/mybundle.jar
auth:
username: $brooklyn:external("myprovider", "username")
password: $brooklyn:external("myprovider", "password")
item:
...
```
See https://issues.apache.org/jira/browse/BROOKLYN-421 for the motivation.
Changes:
* Moves `Credentials` and `UsernamePassword` from
`org.apache.brooklyn.util.http.executor` to
`org.apache.brooklyn.util.http.auth`. Deprecated placeholders are left in place
in case either has ended up in persisted state.
* Adds `ResourceUtils#getResourceFromUrl(String, Credentials)` to supply
credentials when retrieving HTTP resources. The second argument has no effect
when the URL's scheme is neither HTTP nor HTTPS.
* Adds `@Nullable Credentials getUrlCredential()` to `OsgiBundleWithUrl`.
* `CatalogItemDtoAbstract#parseLibraries` tests for a map named `auth`
containing `username` and `password` keys.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sjcorbett/brooklyn-server lib-cred
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/brooklyn-server/pull/918.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #918
----
commit be52a748941a6e181242dc6b87b2722736964fa5
Author: Sam Corbett <[email protected]>
Date: 2017-12-18T12:21:53Z
ResourceUtils.getResource accepts username and password
Only used for HTTP resources.
commit 47d87053e0e3631872f94afd4cb236552fe8ff9d
Author: Sam Corbett <[email protected]>
Date: 2017-12-18T12:22:40Z
Blueprints can include username and password for catalog libraries
For example:
brooklyn.catalog:
id: simple-example
version: "1.0"
itemType: template
libraries:
- url: https://nexus.example.com/mybundle.jar
auth:
username: $brooklyn:external("myprovider", "username")
password: $brooklyn:external("myprovider", "password")
item:
...
commit a6c9f71e3fde1daeddb869ed9b9af71fb43ae6a2
Author: Sam Corbett <[email protected]>
Date: 2017-12-18T15:28:15Z
Move Credentials and UsernamePassword to auth package
----
---