Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Adding common sign_blob() service account types. #421

Merged
merged 1 commit into from
Feb 23, 2016

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Feb 19, 2016

Also adding service_account_email() property.

See googleapis/google-cloud-python#922 for some details on why sign_blob won't work on GCE.

I'm a bit worried about service_account_id on the GAE credentials class. In the implementation it seems to be almost synonymous with the svc. account email / name, but not quite (i.e. there may be some legacy behavior). ISTM the reason it's in the constructor is so that it could be passed to app_identity. Anyhow, our service_account_name could either shadow or conflict with service_account_id if a user passed one in. Though I don't imagine anyone in the history of this library has passed in a value for service_account_id.

Context: We use these utilities in a haphazard way in gcloud-python when creating a signed URL (for cloud storage objects). This just puts the auth utils in the auth library in a unified way.

/cc @tseaver @jgeewax @jonparrott

@property
def service_account_email(self):
"""Get the email for the current service account."""
_abstract()

This comment was marked as spam.

This comment was marked as spam.

@dhermes dhermes force-pushed the sign-blob-all-svc-accounts branch 3 times, most recently from 59f1853 to eae8ba6 Compare February 20, 2016 18:24
@property
def service_account_email(self):
"""Get the email for the current service account."""
raise NotImplementedError

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor Author

dhermes commented Feb 20, 2016

@nathanielmanistaatgoogle Removed the abstract service_account_email property. What remains to be reviewed?

tuple, A pair of the private key ID used to sign the blob and
the signed contents.
"""
raise NotImplementedError

This comment was marked as spam.

@nathanielmanistaatgoogle
Copy link
Contributor

(Completed a full review pass.)

content = _from_bytes(content)
return content
else:
raise RuntimeError(response, content)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@nathanielmanistaatgoogle
Copy link
Contributor

Looks good except for the copied-and-pasted doc strings.

(EDIT: Oops, and your comment about RuntimeError to which I've just now responded.)

content = _from_bytes(content)
return None, content
else:
return response, content

This comment was marked as spam.

@dhermes
Copy link
Contributor Author

dhermes commented Feb 22, 2016

@nathanielmanistaatgoogle See the 4th commit for the "implements" note.

@nathanielmanistaatgoogle
Copy link
Contributor

All looks great; squash and merge. Thanks for the conversation.

Also adding service_account_email() property.
@dhermes
Copy link
Contributor Author

dhermes commented Feb 22, 2016

👍 Will wait to merge until Travis is done in 10 hours.

dhermes added a commit that referenced this pull request Feb 23, 2016
Adding common sign_blob() service account types.
@dhermes dhermes merged commit 498d0b6 into googleapis:master Feb 23, 2016
@dhermes dhermes deleted the sign-blob-all-svc-accounts branch February 23, 2016 03:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants