Skip to content
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

JENKINS-55718 #218

Merged
merged 7 commits into from
Jan 23, 2019
Merged

JENKINS-55718 #218

merged 7 commits into from
Jan 23, 2019

Conversation

Roy-Lu
Copy link

@Roy-Lu Roy-Lu commented Jan 22, 2019

  • Change authentication tool to a singelton.
  • Add ApiKeyAuthenticator to login to ALM through a new api. This is for ALM15SSO and ALM1260SSO.
  • Enhance the RestAuthenticator to avoid be blocked by some problematic ALM env which generates wrong authenticate point.

Add ApiKeyAuthenticator to login to ALM through a new api. This is for ALM15SSO and ALM1260SSO.
Enhance the RestAuthenticator to avoid be blocked by some problematic ALM env which generates wrong authenticate point.
@@ -34,59 +34,117 @@
import com.microfocus.application.automation.tools.sse.sdk.Logger;
import com.microfocus.application.automation.tools.sse.sdk.ResourceAccessLevel;
import com.microfocus.application.automation.tools.sse.sdk.Response;
import sun.rmi.runtime.Log;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes from the Java API instead of Sun classes.

}

private boolean isAlreadyAuthenticated(Response response, String authUser) {
private boolean checkAuthResponse(Response response, String authUser, Logger logger) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method checkAuthResponse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.

@@ -111,44 +168,58 @@ public boolean logout(Client client, String username) {
* @param logger logger
* @return null or authenticate point
*/
private String isAuthenticated(Client client, Logger logger) {
private boolean isAuthenticated(Client client, Logger logger) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method isAuthenticated has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.


public boolean login(Client client, String username, String password, Logger logger) {
public boolean login(Client client, String username, String password, String clientType, Logger logger) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method login has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.

@grount grount added this to the 5.7.1 milestone Jan 22, 2019
@AppVeyorBot
Copy link

client.getServerUrl(),
response.getStatusCode()));
ret = false;
if (!isAuthenticatePointRight(authenticationPoint, client.getServerUrl(), logger)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge this if statement with the enclosing one.

client.getServerUrl(),
response.getStatusCode()));
ret = false;
if (!isAuthenticatePointRight(authenticationPoint, client.getServerUrl(), logger)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These nested if statements could be combined

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@Roy-Lu
Copy link
Author

Roy-Lu commented Jan 23, 2019

Please merge this PR using 'Squash and merge'.

@codeclimate
Copy link

codeclimate bot commented Jan 23, 2019

Code Climate has analyzed commit 572ab27 and detected 0 issues on this pull request.

View more on Code Climate.

@AppVeyorBot
Copy link

@grount grount modified the milestones: 5.7.1, 5.6.6-beta Jan 23, 2019
@grount grount merged commit d2565cb into jenkinsci:latest Jan 23, 2019
@Roy-Lu Roy-Lu deleted the JENKINS-55718 branch January 24, 2019 02:53
@grount grount modified the milestones: 5.6.6-beta, 5.6.5-beta Feb 12, 2019
grount pushed a commit that referenced this pull request Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants