-
Notifications
You must be signed in to change notification settings - Fork 313
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
feat: add properties to customize universe-domain and host in Storage #3287
Changes from all commits
e493d3c
061be96
33872a6
476dde2
e5b3503
fa194d7
ff84418
45d0984
37bf0d8
9938248
5635a01
4af01b7
29cd19a
7e3de7e
de28054
02ca643
92e143e
a7beae4
cae2e8f
1d76e4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,11 +38,36 @@ public Credentials getCredentials() { | |
|
||
private String projectId; | ||
|
||
/** | ||
* Universe domain of the client which is part of the host that is formatted as | ||
* `https://${service}.${universeDomain}/`. | ||
*/ | ||
private String universeDomain; | ||
|
||
/** Host of the Storage client that is formatted as `https://${service}.${universeDomain}/`. */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that we have an ending slash here but not in the format example above for universeDomain, which one we should go for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, modified the documentation to be consistent. |
||
private String host; | ||
|
||
public String getProjectId() { | ||
return projectId; | ||
} | ||
|
||
public void setProjectId(String projectId) { | ||
this.projectId = projectId; | ||
} | ||
|
||
public String getUniverseDomain() { | ||
return universeDomain; | ||
} | ||
|
||
public void setUniverseDomain(String universeDomain) { | ||
this.universeDomain = universeDomain; | ||
} | ||
|
||
public String getHost() { | ||
return host; | ||
} | ||
|
||
public void setHost(String host) { | ||
this.host = host; | ||
} | ||
} |
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.
Did we get this format from Storage client library code?
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.
I know we have it in java-core, is it where get it from? But we don't have the ending slash in java-core
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.
Ah thanks for the question. From doing a check with breakpoints in a spring storage app, Storage calls
getResolvedApiaryHost()
when setting the host at https://github.com/googleapis/java-storage/blob/7d47307d10e285f92b3e2125c4993b6a292001bf/google-cloud-storage/src/main/java/com/google/cloud/storage/HttpStorageOptions.java#L267.getResolvedApiaryHost()
returns a host with a/
so applied the same behavior here.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.
Thanks! Do you mind adding some comment regarding where we get the format from? I think a link to the implementation of
getResolvedApiaryHost()
in java-core should be good enough.In addition, anywhere we mention the format of
host
, we should always have an ending slash, which I see that it is missing in the Javadoc of universeDomain.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.
Yup! Added a javadoc and also modified other locations where we mention host follow a consistent style.