You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Jim Spring <no...@github.com> on 2016/05/15 04:16:11 UTC

[jclouds/jclouds] client credentials JWT support (#952)

This pull request adds support for using certificate authentication via the client_credentials grant type and JWT.  

One note, I was unable to do a full "mvn clean install" as the build failed somewhere unrelated to OAuth.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * client credentials JWT support

-- File Changes --

    M apis/oauth/README (13)
    M apis/oauth/src/main/java/org/jclouds/oauth/v2/AuthorizationApi.java (14)
    A apis/oauth/src/main/java/org/jclouds/oauth/v2/config/CertificateFingerprintSupplier.java (119)
    M apis/oauth/src/main/java/org/jclouds/oauth/v2/config/CredentialType.java (5)
    M apis/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthModule.java (14)
    M apis/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthProperties.java (9)
    A apis/oauth/src/main/java/org/jclouds/oauth/v2/domain/CertificateFingerprint.java (44)
    A apis/oauth/src/main/java/org/jclouds/oauth/v2/domain/ClientCredentialsAuthArgs.java (48)
    A apis/oauth/src/main/java/org/jclouds/oauth/v2/domain/ClientCredentialsClaims.java (61)
    A apis/oauth/src/main/java/org/jclouds/oauth/v2/filters/ClientCredentialsJWTBearerTokenFlow.java (121)
    A apis/oauth/src/main/java/org/jclouds/oauth/v2/functions/ClientCredentialsClaimsToAssertion.java (93)
    M apis/oauth/src/test/java/org/jclouds/oauth/v2/AuthorizationApiLiveTest.java (34)
    M apis/oauth/src/test/java/org/jclouds/oauth/v2/AuthorizationApiMockTest.java (87)
    A apis/oauth/src/test/resources/testcert.pem (22)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/952.patch
https://github.com/jclouds/jclouds/pull/952.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/952

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Ignasi Barrera <no...@github.com>.
> @@ -30,10 +28,8 @@
>  import javax.inject.Singleton;
>  
>  import org.jclouds.oauth.v2.AuthorizationApi;
> -import org.jclouds.oauth.v2.filters.BearerTokenFromCredentials;
> -import org.jclouds.oauth.v2.filters.ClientCredentialsSecretFlow;
> -import org.jclouds.oauth.v2.filters.JWTBearerTokenFlow;
> -import org.jclouds.oauth.v2.filters.OAuthFilter;
> +import org.jclouds.oauth.v2.filters.*;

Same here about wildcard imports

---
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/952/files/d4668db228287c7620b0f7c3a37291dc7d61be47#r63672415

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Ignasi Barrera <no...@github.com>.
> @@ -29,7 +29,10 @@
>     P12_PRIVATE_KEY_CREDENTIALS,
>  
>     /** Contents are an ID and Secret */
> -   CLIENT_CREDENTIALS_SECRET;
> +   CLIENT_CREDENTIALS_SECRET,
> +
> +   /** Contents are an ID and PEM-encoded Private Key.  The certificate is specified as it's own property. */
> +   CLIENT_CREDENTIALS_P12;

Rename it to differentiate from the Google credential, which is also a P12 private key? Perhaps something like `CLIENT_CREDENTIALS_P12_AND_CERTIFICATE`, to indicate that a certificate will also be required?

---
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/952/files/d4668db228287c7620b0f7c3a37291dc7d61be47#r63672336

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Ignasi Barrera <no...@github.com>.
> One note, I was unable to do a full "mvn clean install" as the build failed somewhere unrelated to OAuth.

Hint: you can build only the OAuth dependencies and the projects that depend on it with:
```bash
mvn clean install -pl :oauth -am -amd
```

Thanks for the PR! I'll review it in a while. I'm trying to get the PR builds back to live again: rebuild please

---
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/952#issuecomment-219961400

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Ignasi Barrera <no...@github.com>.
Closed #952.

---
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/952#event-664394703

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Ignasi Barrera <no...@github.com>.
> @@ -0,0 +1,119 @@
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one or more
> + * contributor license agreements.  See the NOTICE file distributed with
> + * this work for additional information regarding copyright ownership.
> + * The ASF licenses this file to You under the Apache License, Version 2.0
> + * (the "License"); you may not use this file except in compliance with
> + * the License.  You may obtain a copy of the License at
> + *
> + *     http:://www.apache.org/licenses/LICENSE-2.0

The build is failing because an invalid license. There is a double colon here `::` :)

---
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/952/files/d4668db228287c7620b0f7c3a37291dc7d61be47#r63705555

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Ignasi Barrera <no...@github.com>.
> @@ -16,9 +16,7 @@
>   */
>  package org.jclouds.oauth.v2.config;
>  
> -import static org.jclouds.oauth.v2.config.CredentialType.BEARER_TOKEN_CREDENTIALS;
> -import static org.jclouds.oauth.v2.config.CredentialType.CLIENT_CREDENTIALS_SECRET;
> -import static org.jclouds.oauth.v2.config.CredentialType.P12_PRIVATE_KEY_CREDENTIALS;
> +import static org.jclouds.oauth.v2.config.CredentialType.*;

[style] Avoid wildcard imports.

---
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/952/files/d4668db228287c7620b0f7c3a37291dc7d61be47#r63672391

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Jim Spring <no...@github.com>.
@nacx -- here is an update to Azure OAuth support.


---
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/952#issuecomment-219448822

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Jim Spring <no...@github.com>.
@nacx -- all edits should be in place.  local build completing successfully.  Will check PR build in a bit.

---
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/952#issuecomment-220393228

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Ignasi Barrera <no...@github.com>.
Reopened #952.

---
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/952#event-664394738

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Ignasi Barrera <no...@github.com>.
Just a couple minor style comments. The PR looks great @jmspring! Thanks!

---
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/952#issuecomment-219976065

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Ignasi Barrera <no...@github.com>.
Build failure was unrelated. Merged to master as [f46b38dd](http://git-wip-us.apache.org/repos/asf/jclouds/commit/f46b38dd). Thanks @jmspring!

---
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/952#issuecomment-220473336

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Ignasi Barrera <no...@github.com>.
Closed #952.

---
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/952#event-666493032

Re: [jclouds/jclouds] client credentials JWT support (#952)

Posted by Ignasi Barrera <no...@github.com>.
Just closing and reopening to trigger the build again; it should be fixed now.

---
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/952#issuecomment-220026065