-
Notifications
You must be signed in to change notification settings - Fork 309
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
fix: add with_universe_domain #1408
Conversation
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.
No issue with the code.. but let's discuss this on next weekly sync. Maybe we can drop create_with_universe_domain helpers.
@@ -415,6 +415,22 @@ def with_token_uri(self, token_uri): | |||
new_cred._metrics_options = self._metrics_options | |||
return new_cred | |||
|
|||
def with_universe_domain(self, universe_domain): |
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.
not sure if use patters are the same, but for Java I decided not to got with this method. It works best for properties that don't depend on other credential fields, like scopes. Using this could be confusing because it does not make sense change a universe for a particular credential. If it has one - it should be the only one possible. If developer sets up universe programmatically - there should be builder or constructor. And in Java you can emulate same functionality with 1 line (toBuilder().setUniverseDomain().build()). Not sure how things are in Python ) I will add this as a comment to the requirements doc as well, that mentions this method pattern.
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.
with_*
is the regular pattern for google-auth lib, for example, with_quota_project_id
, with_scopes
, with_token_uri
etc. Builder/Constructor pattern is specific for Java auth lib, python lib doesn't do this.
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.
Ack, LGTM (passing by)
No description provided.