-
Notifications
You must be signed in to change notification settings - Fork 55
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
JBIDE-20719 Updating a token for OpenShift 3 connection via Edit Connection does not update resources #951
Conversation
return false; | ||
} | ||
return true; | ||
} | ||
} |
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.
Having a special #equals for credentials seems legit since we consider 2 connections as identical if they only differ in authentication means (ex. password or token). On the other hand the username is used to persist them and thus is required to identify and #equal 2 connections. I thus dont think that #equals may be true while Objects.equals(getUsername(), other.getUsername()) returns false.
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.
Ok, I moved comparing userName to eduals().
216382d
to
0b235f1
Compare
…ection does not update resources
0b235f1
to
eac1d95
Compare
//It is safe to cast now. | ||
Connection other = (Connection)connection; | ||
//User name is already compared | ||
if(!Objects.equals(password, other.password)) { |
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 assume that a purely token based connection will always have null in the password?
I admit that this part is rather fuzzy in our current Connection implementation, we have the authentication strategies but then we still have the password and username in connection. We should clean this stuff up at some point I think
looks good, I couldnt test it, but if you tested it (in the UI, too - i saw the unit tests :) ) then I'd +1 |
I tested it works, with both username change and token update |
Applied in master / 4.3.x. Thanks @scabanovich ! |
No description provided.