-
-
Notifications
You must be signed in to change notification settings - Fork 284
Clean up HTTP authentication reference and Update constructors #562
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
Open
programbeginnerTW
wants to merge
6
commits into
jenkinsci:master
Choose a base branch
from
programbeginnerTW:Clean-up-HTTP-authentication-code-references
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
77d1c5a
1. Clean up HTTP authentication reference
programbeginnerTW 69f849e
Remove duplicated JiraSite object
programbeginnerTW 6333c27
Fix Spotless check format violations
programbeginnerTW 5b1eb3d
Remove all deprecated `useHTTPAuth` constructor according to change r…
programbeginnerTW 34c2dee
Fix compilation error on JiraSite.java and remove unused parameters i…
programbeginnerTW f3005df
Fix wrong parameters in DescriptorImplTest.java
programbeginnerTW File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
rantoniuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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); | ||
} | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.