Re: [jclouds/jclouds] rename oauth properties (#1014)

2016-09-26 Thread Andrea Turli
thx @nacx for the explanation! I'll close the pr as not needed

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1014#issuecomment-249579672

Re: [jclouds/jclouds] rename oauth properties (#1014)

2016-09-26 Thread Andrea Turli
Closed #1014.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1014#event-802329941

Re: [jclouds/jclouds] rename oauth properties (#1014)

2016-09-26 Thread Ignasi Barrera
Well, I'd say the wrong properties are the ones you point in this last comment, 
as they double-prefix the property. When jclouds creates the context, it tries 
to resolve the properties that are prefixed with the "provider id", and if not, 
it tries to resolve them with the "jclouds" prefix. You can see how this is 
done 
[here](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/ContextBuilder.java#L414).

This allows users to configure the same properties with different values for 
different providers, which is desirable if you run one single app that consumes 
several apis; the "identity" property should be different for each connection. 
Apart from the override properties, jclouds loads all properties prefixed with 
"jclouds" or the "provider id" that are configured as systme properties (see 
[here](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/ContextBuilder.java#L373)),
 so you can have global configuration variables for all providers.

So, in this case, "oauth" is the prefix, designating the endpoint the oauth api 
uses. It would not be correct to double-prefix it as "jclouds.oauth".

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1014#issuecomment-249578664

Re: [jclouds/jclouds] rename oauth properties (#1014)

2016-09-26 Thread Andrea Turli
because I thought it was jclouds's convention, thinking about stuff like
```
public static final String AUTO_ALLOCATE_FLOATING_IPS = 
"jclouds.openstack-nova.auto-create-floating-ips";
```
so for simmetry I'd have expected that for oauth things as well, no?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1014#issuecomment-249573689

Re: [jclouds/jclouds] rename oauth properties (#1014)

2016-09-26 Thread Ignasi Barrera
Why do you want to pass it like that? I mean, you are providing properties of 
two different jclouds providers/apis: "azurecompute-arm" and "oauth". And you 
are passing both using the jclouds convention `.endpoint`. Why 
do you want to change that add a prefix to one of the properties?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1014#issuecomment-249572518

Re: [jclouds/jclouds] rename oauth properties (#1014)

2016-09-26 Thread Andrea Turli
thanks @nacx but I don't follow completely.

For example, to run tests in `jclouds-labs/azurecompute-arm` I need to specify:
```
mvn clean install -Plive -Dtest.azurecompute-arm.identity="identity" 
-Dtest.azurecompute-arm.credential="password" 
-Dtest.azurecompute-arm.endpoint="https://management.azure.com/subscriptions/subscription-id";
 -Dtest.oauth.endpoint="endpoint"
```
Is there a way to pass the last property as `-Dtest.jclouds.oauth.endpoint` ?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1014#issuecomment-249566789

Re: [jclouds/jclouds] rename oauth properties (#1014)

2016-09-26 Thread Ignasi Barrera
:-1: jclouds alrady reads properties in the form: `.`, so you can configure properties (endpoints, for example) for multiple 
providers:

* `aws-ec2.endpoint`
* `openstack-nova.endpoint`
* `openstack-nova.identity`

If no provider specific property is found, jclouds fallsback to the `jclouds` 
prefix. In this case `oauth` is the API ID, so it respects the property naming 
convention.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1014#issuecomment-249550542

[jclouds/jclouds] rename oauth properties (#1014)

2016-09-26 Thread Andrea Turli
- oauth.{endpoint.identity, credential} to jclouds.oauth.{endpoint, identity, 
credential}

 @nacx what do you think? I think it is more homogenous this way
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds/pull/1014

-- Commit Summary --

  * rename oauth properties

-- File Changes --

M apis/oauth/README (26)
M apis/oauth/pom.xml (16)
M apis/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthModule.java (4)
M 
apis/oauth/src/test/java/org/jclouds/oauth/v2/AuthorizationApiLiveTest.java (6)
M 
apis/oauth/src/test/java/org/jclouds/oauth/v2/AuthorizationApiMockTest.java (2)
M apis/oauth/src/test/java/org/jclouds/oauth/v2/OAuthTestUtils.java (12)
M 
apis/oauth/src/test/java/org/jclouds/oauth/v2/config/PrivateKeySupplierTest.java
 (4)
M 
providers/digitalocean2/src/main/java/org/jclouds/digitalocean2/DigitalOcean2ApiMetadata.java
 (2)
M 
providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java
 (2)
M 
providers/softlayer/src/main/java/org/jclouds/softlayer/compute/strategy/SoftLayerComputeServiceAdapter.java
 (3)
M 
providers/softlayer/src/test/java/org/jclouds/softlayer/compute/SoftLayerComputeServiceAdapterLiveTest.java
 (34)
R providers/softlayer/src/test/resources/logback-test.xml (0)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/1014.patch
https://github.com/jclouds/jclouds/pull/1014.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1014