-
Notifications
You must be signed in to change notification settings - Fork 235
Allows to use GCE service credentials to sign blobs (#141) #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for your pull request. t looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
CLAs look good, thanks! |
@jadekler any estimation when will this be checked/merged? |
Hi @nbali; we're unfortunately critically short staffed at the moment, and my cycles are being spent elsewhere. I'll see if I can find an appropriate reviewer for this; I'm happy to release it after review. |
@@ -69,7 +70,7 @@ public int hashCode() { | |||
/** | |||
* Returns the service account associated with the signer. | |||
*/ | |||
String getAccount(); | |||
String getAccount() throws IOException; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
import com.google.api.client.http.HttpRequest; | ||
import com.google.api.client.http.HttpResponse; | ||
import com.google.api.client.http.HttpStatusCodes; | ||
import com.google.api.client.http.*; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -57,13 +59,16 @@ | |||
* | |||
* <p>Fetches access tokens from the Google Compute Engine metadata server. | |||
*/ | |||
public class ComputeEngineCredentials extends GoogleCredentials { | |||
public class ComputeEngineCredentials extends GoogleCredentials implements ServiceAccountSigner { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* Don't change ServiceAccountSigner method signatures * Use complete list of imports in ComputeEngineCredentials
@vchudnov-g could you take a look? |
@vchudnov-g ping? |
Any updates regarding whether this PR will ever be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality looks great!
We've added several failure cases that don't have tests for. Can we add a few more test cases here and we'll get this merged?
@@ -53,6 +46,8 @@ | |||
import java.util.List; | |||
import java.util.Map; | |||
|
|||
import static org.junit.Assert.*; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
private static final Logger LOGGER = Logger.getLogger(ComputeEngineCredentials.class.getName()); | ||
|
||
// Note: the explicit IP address is used to avoid name server resolution issues. | ||
static final String DEFAULT_METADATA_SERVER_URL = "http://169.254.169.254"; | ||
|
||
static final String IAM_API_ROOT_URL = "https://iam.googleapis.com/v1"; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This change allows to use GCE service credentials to get a signature.