Add service_account.Credentials.with_claims#140
Conversation
google/auth/jwt.py
Outdated
| Returns: | ||
| google.auth.jwt.Credentials: A new credentials instance. | ||
| """ | ||
| new_additional_claims = self._additional_claims.copy() |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| google.auth.jwt.Credentials: A new credentials instance. | ||
| """ | ||
| new_additional_claims = self._additional_claims.copy() | ||
| new_additional_claims.update(additional_claims or {}) |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| subject=subject, | ||
| additional_claims=self._additional_claims.copy()) | ||
|
|
||
| def with_claims(self, additional_claims): |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
LGTM I suppose. It seems you want to eat the teeny cost of |
The cost of that vs. the cost of copy/deepcopy is insignificant. I'm going to update this to use deepcopy, but I'm finishing something else up first. Thanks for the review! |
Resolves #129.