-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
Clean up HTTP authentication reference and Update constructors #562
base: master
Are you sure you want to change the base?
Changes from 3 commits
77d1c5a
69f849e
6333c27
5b1eb3d
34c2dee
f3005df
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 |
---|---|---|
|
@@ -263,7 +263,8 @@ public JiraSite( | |
boolean updateJiraIssueForAllStatus, | ||
@CheckForNull String groupVisibility, | ||
@CheckForNull String roleVisibility, | ||
boolean useHTTPAuth) { | ||
boolean useHTTPAuth, | ||
boolean useBearerAuth) { | ||
this( | ||
url, | ||
alternativeUrl, | ||
|
@@ -275,6 +276,7 @@ public JiraSite( | |
groupVisibility, | ||
roleVisibility, | ||
useHTTPAuth, | ||
useBearerAuth, | ||
DEFAULT_TIMEOUT, | ||
DEFAULT_READ_TIMEOUT, | ||
DEFAULT_THREAD_EXECUTOR_NUMBER); | ||
|
@@ -293,7 +295,8 @@ public JiraSite( | |
boolean updateJiraIssueForAllStatus, | ||
@CheckForNull String groupVisibility, | ||
@CheckForNull String roleVisibility, | ||
boolean useHTTPAuth) { | ||
boolean useHTTPAuth, | ||
boolean useBearerAuth) { | ||
this( | ||
url, | ||
alternativeUrl, | ||
|
@@ -304,7 +307,8 @@ public JiraSite( | |
updateJiraIssueForAllStatus, | ||
groupVisibility, | ||
roleVisibility, | ||
useHTTPAuth); | ||
useHTTPAuth, | ||
useBearerAuth); | ||
} | ||
|
||
// Deprecate the previous constructor but leave it in place for Java-level compatibility. | ||
|
@@ -319,7 +323,8 @@ public JiraSite( | |
boolean updateJiraIssueForAllStatus, | ||
String groupVisibility, | ||
String roleVisibility, | ||
boolean useHTTPAuth) { | ||
boolean useHTTPAuth, | ||
boolean useBearerAuth) { | ||
this( | ||
url, | ||
alternativeUrl, | ||
|
@@ -331,6 +336,7 @@ public JiraSite( | |
groupVisibility, | ||
roleVisibility, | ||
useHTTPAuth, | ||
useBearerAuth, | ||
DEFAULT_TIMEOUT, | ||
DEFAULT_READ_TIMEOUT, | ||
DEFAULT_THREAD_EXECUTOR_NUMBER); | ||
|
@@ -359,6 +365,7 @@ public JiraSite( | |
String groupVisibility, | ||
String roleVisibility, | ||
boolean useHTTPAuth, | ||
boolean useBearerAuth, | ||
int timeout, | ||
int readTimeout, | ||
int threadExecutorNumber) { | ||
|
@@ -383,6 +390,7 @@ public JiraSite( | |
setGroupVisibility(groupVisibility); | ||
setRoleVisibility(roleVisibility); | ||
this.useHTTPAuth = useHTTPAuth; | ||
this.useBearerAuth = useBearerAuth; | ||
this.jiraSession = null; | ||
} | ||
|
||
|
@@ -408,6 +416,7 @@ public JiraSite( | |
String groupVisibility, | ||
String roleVisibility, | ||
boolean useHTTPAuth, | ||
boolean useBearerAuth, | ||
int timeout, | ||
int readTimeout, | ||
int threadExecutorNumber) { | ||
|
@@ -422,45 +431,12 @@ public JiraSite( | |
groupVisibility, | ||
roleVisibility, | ||
useHTTPAuth, | ||
useBearerAuth, | ||
timeout, | ||
readTimeout, | ||
threadExecutorNumber); | ||
} | ||
|
||
// Deprecate the previous constructor but leave it in place for Java-level compatibility. | ||
@Deprecated | ||
public JiraSite( | ||
URL url, | ||
URL alternativeUrl, | ||
StandardUsernamePasswordCredentials credentials, | ||
boolean supportsWikiStyleComment, | ||
boolean recordScmChanges, | ||
String userPattern, | ||
boolean updateJiraIssueForAllStatus, | ||
String groupVisibility, | ||
String roleVisibility, | ||
boolean useHTTPAuth, | ||
int timeout, | ||
int readTimeout, | ||
int threadExecutorNumber, | ||
boolean useBearerAuth) { | ||
this( | ||
url, | ||
alternativeUrl, | ||
credentials == null ? null : credentials.getId(), | ||
supportsWikiStyleComment, | ||
recordScmChanges, | ||
userPattern, | ||
updateJiraIssueForAllStatus, | ||
groupVisibility, | ||
roleVisibility, | ||
useHTTPAuth, | ||
timeout, | ||
readTimeout, | ||
threadExecutorNumber); | ||
this.useBearerAuth = useBearerAuth; | ||
} | ||
|
||
static URL toURL(String url) { | ||
url = Util.fixEmptyAndTrim(url); | ||
if (url == null) { | ||
|
@@ -647,7 +623,8 @@ protected Object readResolve() { | |
updateJiraIssueForAllStatus, | ||
groupVisibility, | ||
roleVisibility, | ||
useHTTPAuth); | ||
useHTTPAuth, | ||
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. @olamy I think this whole |
||
useBearerAuth); | ||
} else { | ||
jiraSite = new JiraSite( | ||
url, | ||
|
@@ -660,6 +637,7 @@ protected Object readResolve() { | |
groupVisibility, | ||
roleVisibility, | ||
useHTTPAuth, | ||
useBearerAuth, | ||
timeout, | ||
readTimeout, | ||
threadExecutorNumber); | ||
|
@@ -1355,6 +1333,7 @@ public FormValidation doValidate( | |
.withGroupVisibility(groupVisibility) | ||
.withRoleVisibility(roleVisibility) | ||
.withUseHTTPAuth(useHTTPAuth) | ||
.withUseBearerAuth(useBearerAuth) | ||
.build(); | ||
|
||
if (threadExecutorNumber < 1) { | ||
|
@@ -1417,6 +1396,7 @@ static class Builder { | |
private String groupVisibility; | ||
private String roleVisibility; | ||
private boolean useHTTPAuth; | ||
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. Drop this as well 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. Revision finished, waiting for your review! |
||
private boolean useBearerAuth; | ||
|
||
public Builder withMainURL(URL mainURL) { | ||
this.mainURL = mainURL; | ||
|
@@ -1468,6 +1448,11 @@ public Builder withUseHTTPAuth(boolean useHTTPAuth) { | |
return this; | ||
} | ||
|
||
public Builder withUseBearerAuth(boolean useBearerAuth) { | ||
this.useBearerAuth = useBearerAuth; | ||
return this; | ||
} | ||
|
||
public JiraSite build() { | ||
return new JiraSite( | ||
mainURL, | ||
|
@@ -1479,7 +1464,8 @@ public JiraSite build() { | |
updateJiraIssueForAllStatus, | ||
groupVisibility, | ||
roleVisibility, | ||
useHTTPAuth); | ||
useHTTPAuth, | ||
useBearerAuth); | ||
} | ||
} | ||
|
||
|
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.
Let's remove all deprecated constructors, it they are there for quite a while.
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.
Revision finished, waiting for your review!