[JBoss JIRA] (JBIDE-22426) Connection: authorization strategy is always overwritten (in the client) upon #isConnected
by Andre Dietisheim (JIRA)
[ https://issues.jboss.org/browse/JBIDE-22426?page=com.atlassian.jira.plugi... ]
Andre Dietisheim updated JBIDE-22426:
-------------------------------------
Description:
The current implementation of Connection#isConnected() will always overwrite the authorization strategy in the client that it is using. This seems wrong given that #getResources, #createResource, #updateResource (and other methods) also set it but check if it already exists beforehand. Making sure that they dont overwrite an existing strategy.
{code:title=Connection#isConnected}
public boolean isConnected(IProgressMonitor monitor) {
client.setAuthorizationStrategy(getAuthorizationStrategy());
try {
{code}
{code:title=Connection#createResource}
public <T extends IResource> T createResource(T resource) {
try {
if(client.getAuthorizationStrategy() == null) {
client.setAuthorizationStrategy(getAuthorizationStrategy());
}
return client.create(resource);
{code}
A very likely side-effect of this is in Connection#ownsResource which compares clients (the one in the connection and the one attached to the given resource. The 2 clients are compared with the authorization strategy:
{code:title=com.openshift.internal.restclient.DefaultClient#equals}
@Override
public boolean equals(Object obj) {
...
return ObjectUtils.equals(strategy, other.strategy);
{code}
the lookup for a connection for a given resource in ConnectionRegistryUtils#safeGetConnectionFor will therefore fail after a Connection#isConnected:
{code:title=ConnectionsRegistryUtil#safeGetConnectionFor(IResource)}
public static Connection safeGetConnectionFor(IResource resource) {
Collection<Connection> all = ConnectionsRegistrySingleton.getInstance().getAll(Connection.class);
for (Connection connection : all) {
if(connection.ownsResource(resource)) {
return connection;
}
}
return null;
}
{code}
was:
The current implementation of Connection#isConnected() will always overwrite the authorization strategy in the client that it is using. This seems wrong given that #getResources, #createResource, #updateResource (and other methods) also set it but check if it already exists beforehand. Making sure that they dont overwrite an existing strategy.
{code:title=Connection#isConnected}
public boolean isConnected(IProgressMonitor monitor) {
client.setAuthorizationStrategy(getAuthorizationStrategy());
try {
{code}
{code:title=Connection#createResource}
public <T extends IResource> T createResource(T resource) {
try {
if(client.getAuthorizationStrategy() == null) {
client.setAuthorizationStrategy(getAuthorizationStrategy());
}
return client.create(resource);
{code}
A very likely side-effect of this is in Connection#ownsResource which compares clients (the one in the connection and the one attached to the given resource. The 2 clients are compared even with the authorization strategy:
{code:title=com.openshift.internal.restclient.DefaultClient#equals}
@Override
public boolean equals(Object obj) {
...
return ObjectUtils.equals(strategy, other.strategy);
{code}
> Connection: authorization strategy is always overwritten (in the client) upon #isConnected
> -------------------------------------------------------------------------------------------
>
> Key: JBIDE-22426
> URL: https://issues.jboss.org/browse/JBIDE-22426
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.0.Alpha3
> Reporter: Andre Dietisheim
> Labels: connection, openshift_v3
> Fix For: 4.4.0.Alpha3
>
>
> The current implementation of Connection#isConnected() will always overwrite the authorization strategy in the client that it is using. This seems wrong given that #getResources, #createResource, #updateResource (and other methods) also set it but check if it already exists beforehand. Making sure that they dont overwrite an existing strategy.
> {code:title=Connection#isConnected}
> public boolean isConnected(IProgressMonitor monitor) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> try {
> {code}
> {code:title=Connection#createResource}
> public <T extends IResource> T createResource(T resource) {
> try {
> if(client.getAuthorizationStrategy() == null) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> }
> return client.create(resource);
> {code}
> A very likely side-effect of this is in Connection#ownsResource which compares clients (the one in the connection and the one attached to the given resource. The 2 clients are compared with the authorization strategy:
> {code:title=com.openshift.internal.restclient.DefaultClient#equals}
> @Override
> public boolean equals(Object obj) {
> ...
> return ObjectUtils.equals(strategy, other.strategy);
> {code}
> the lookup for a connection for a given resource in ConnectionRegistryUtils#safeGetConnectionFor will therefore fail after a Connection#isConnected:
> {code:title=ConnectionsRegistryUtil#safeGetConnectionFor(IResource)}
> public static Connection safeGetConnectionFor(IResource resource) {
> Collection<Connection> all = ConnectionsRegistrySingleton.getInstance().getAll(Connection.class);
> for (Connection connection : all) {
> if(connection.ownsResource(resource)) {
> return connection;
> }
> }
> return null;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (JBIDE-22426) Connection: authorization strategy is always overwritten (in the client) upon #isConnected
by Andre Dietisheim (JIRA)
[ https://issues.jboss.org/browse/JBIDE-22426?page=com.atlassian.jira.plugi... ]
Andre Dietisheim updated JBIDE-22426:
-------------------------------------
Description:
The current implementation of Connection#isConnected() will always overwrite the authorization strategy in the client that it is using. This seems wrong given that #getResources, #createResource, #updateResource (and other methods) also set it but check if it already exists beforehand. Making sure that they dont overwrite an existing strategy.
{code:title=Connection#isConnected}
public boolean isConnected(IProgressMonitor monitor) {
client.setAuthorizationStrategy(getAuthorizationStrategy());
try {
{code}
{code:title=Connection#createResource}
public <T extends IResource> T createResource(T resource) {
try {
if(client.getAuthorizationStrategy() == null) {
client.setAuthorizationStrategy(getAuthorizationStrategy());
}
return client.create(resource);
{code}
A very likely side-effect of this is in Connection#ownsResource which compares clients (the one in the connection and the one attached to the given resource. The 2 clients are compared even with the authorization strategy:
{code:title=com.openshift.internal.restclient.DefaultClient#equals}
@Override
public boolean equals(Object obj) {
...
return ObjectUtils.equals(strategy, other.strategy);
{code}
was:
The current implementation of Connection#isConnected() will always overwrite the authorization strategy in the client that it is using. This seems wrong given that #getResources, #createResource, #updateResource (and other methods) also set it but check if it already exists beforehand. Making sure that they dont overwrite an existing strategy.
{code:title=Connection#isConnected}
public boolean isConnected(IProgressMonitor monitor) {
client.setAuthorizationStrategy(getAuthorizationStrategy());
try {
{code}
{code:title=Connection#createResource}
public <T extends IResource> T createResource(T resource) {
try {
if(client.getAuthorizationStrategy() == null) {
client.setAuthorizationStrategy(getAuthorizationStrategy());
}
return client.create(resource);
{code}
> Connection: authorization strategy is always overwritten (in the client) upon #isConnected
> -------------------------------------------------------------------------------------------
>
> Key: JBIDE-22426
> URL: https://issues.jboss.org/browse/JBIDE-22426
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.0.Alpha3
> Reporter: Andre Dietisheim
> Labels: connection, openshift_v3
> Fix For: 4.4.0.Alpha3
>
>
> The current implementation of Connection#isConnected() will always overwrite the authorization strategy in the client that it is using. This seems wrong given that #getResources, #createResource, #updateResource (and other methods) also set it but check if it already exists beforehand. Making sure that they dont overwrite an existing strategy.
> {code:title=Connection#isConnected}
> public boolean isConnected(IProgressMonitor monitor) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> try {
> {code}
> {code:title=Connection#createResource}
> public <T extends IResource> T createResource(T resource) {
> try {
> if(client.getAuthorizationStrategy() == null) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> }
> return client.create(resource);
> {code}
> A very likely side-effect of this is in Connection#ownsResource which compares clients (the one in the connection and the one attached to the given resource. The 2 clients are compared even with the authorization strategy:
> {code:title=com.openshift.internal.restclient.DefaultClient#equals}
> @Override
> public boolean equals(Object obj) {
> ...
> return ObjectUtils.equals(strategy, other.strategy);
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (JBIDE-22426) Connection: authorization strategy is always overwritten (in the client) upon #isConnected
by Andre Dietisheim (JIRA)
[ https://issues.jboss.org/browse/JBIDE-22426?page=com.atlassian.jira.plugi... ]
Andre Dietisheim updated JBIDE-22426:
-------------------------------------
Labels: connection openshift_v3 (was: )
> Connection: authorization strategy is always overwritten (in the client) upon #isConnected
> -------------------------------------------------------------------------------------------
>
> Key: JBIDE-22426
> URL: https://issues.jboss.org/browse/JBIDE-22426
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.0.Alpha3
> Reporter: Andre Dietisheim
> Labels: connection, openshift_v3
> Fix For: 4.4.0.Alpha3
>
>
> The current implementation of Connection#isConnected() will always overwrite the authorization strategy in the client that it is using. This seems wrong given that #getResources, #createResource, #updateResource (and other methods) also set it but check if it already exists beforehand. Making sure that they dont overwrite an existing strategy.
> {code:title=Connection#isConnected}
> public boolean isConnected(IProgressMonitor monitor) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> try {
> {code}
> {code:title=Connection#createResource}
> public <T extends IResource> T createResource(T resource) {
> try {
> if(client.getAuthorizationStrategy() == null) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> }
> return client.create(resource);
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (JBIDE-22426) Connection: authorization strategy is always overwritten (in the client) upon #isConnected
by Andre Dietisheim (JIRA)
[ https://issues.jboss.org/browse/JBIDE-22426?page=com.atlassian.jira.plugi... ]
Andre Dietisheim updated JBIDE-22426:
-------------------------------------
Fix Version/s: 4.4.0.Alpha3
> Connection: authorization strategy is always overwritten (in the client) upon #isConnected
> -------------------------------------------------------------------------------------------
>
> Key: JBIDE-22426
> URL: https://issues.jboss.org/browse/JBIDE-22426
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.0.Alpha3
> Reporter: Andre Dietisheim
> Fix For: 4.4.0.Alpha3
>
>
> The current implementation of Connection#isConnected() will always overwrite the authorization strategy in the client that it is using. This seems wrong given that #getResources, #createResource, #updateResource (and other methods) also set it but check if it already exists beforehand. Making sure that they dont overwrite an existing strategy.
> {code:title=Connection#isConnected}
> public boolean isConnected(IProgressMonitor monitor) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> try {
> {code}
> {code:title=Connection#createResource}
> public <T extends IResource> T createResource(T resource) {
> try {
> if(client.getAuthorizationStrategy() == null) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> }
> return client.create(resource);
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (JBIDE-22426) Connection: authorization strategy is always overwritten (in the client) upon #isConnected
by Andre Dietisheim (JIRA)
Andre Dietisheim created JBIDE-22426:
----------------------------------------
Summary: Connection: authorization strategy is always overwritten (in the client) upon #isConnected
Key: JBIDE-22426
URL: https://issues.jboss.org/browse/JBIDE-22426
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: openshift
Affects Versions: 4.4.0.Alpha3
Reporter: Andre Dietisheim
The current implementation of Connection#isConnected() will always overwrite the authorization strategy in the client that it is using. This seems wrong given that #getResources, #createResource, #updateResource (and other methods) also set it but check if it already exists beforehand. Making sure that they dont overwrite an existing strategy.
{code:title=Connection#isConnected}
public boolean isConnected(IProgressMonitor monitor) {
client.setAuthorizationStrategy(getAuthorizationStrategy());
try {
{code}
{code:title=Connection#createResource}
public <T extends IResource> T createResource(T resource) {
try {
if(client.getAuthorizationStrategy() == null) {
client.setAuthorizationStrategy(getAuthorizationStrategy());
}
return client.create(resource);
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (JBIDE-22419) Deploy Docker Wizard: Connection info looks weird
by Viacheslav Kabanovich (JIRA)
[ https://issues.jboss.org/browse/JBIDE-22419?page=com.atlassian.jira.plugi... ]
Viacheslav Kabanovich commented on JBIDE-22419:
-----------------------------------------------
It is supposed to be uneditable here because when connection is not set, we have the Sign in page. If connection is found, this page is only displaying info and lets user to see clearly what data is needed. I do not see anything weird in the opportunity to put cursor and copy text from it. Compare to Properties dialog for a folder on Ubuntu. Label 'Location:' is completely disabled, but you can put cursor in the location value, select it and copy. The same is true for Details view in Openshift wizards.
> Deploy Docker Wizard: Connection info looks weird
> -------------------------------------------------
>
> Key: JBIDE-22419
> URL: https://issues.jboss.org/browse/JBIDE-22419
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.0.Alpha2
> Reporter: Marián Labuda
> Priority: Minor
> Labels: docker, openshift_v3
> Fix For: 4.4.x
>
> Attachments: docker_wizard.png
>
>
> Connection info in Deploy Image to OpenShift wizard looks weird. It is a text widget but it looks like it is text area where it is supposed to be text typed, but it is disabled. It is also possible to put cursor there. This apply both for wizard opened via context menu of a docker image as well as for wizard opened from context menu of an OpenShift project.
> !docker_wizard.png!
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months