Skip to content

Commit

Permalink
Merge branch 'master' into mde_integration_status
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/config/container.xml
#	src/config/containerImporter.xml
  • Loading branch information
sukunis committed Jun 30, 2021
2 parents 87ca337 + df10828 commit 5dbb0a9
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 14 deletions.
21 changes: 14 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
5.5.19 (June 2021)
------------------

- BugFix: Escape ice special characters for login [#227](https://github.com/ome/omero-insight/pull/227) (regression introduced in [#197](https://github.com/ome/omero-insight/pull/197))
- Bump omero-gateway-java to 5.6.6 [#232](https://github.com/ome/omero-insight/issues/232)


5.5.18 (April 2021)
-------------------

Expand Down Expand Up @@ -37,7 +44,7 @@
---------------------

- Fix bug with null folders [#163](https://github.com/ome/omero-insight/issues/163)
- Bump to omero-gateway-java 5.6.5 [#164](https://github.com/ome/omero-insight/issues/164)
- Bump omero-gateway-java to 5.6.5 [#164](https://github.com/ome/omero-insight/issues/164)

5.5.13 (July 2020)
------------------
Expand All @@ -58,7 +65,7 @@
- Fix bug when no project is selected for a single file import [#149](https://github.com/ome/omero-insight/pull/149)
- Add feature export to csv in mde from @sukunis [#147](https://github.com/ome/omero-insight/pull/147)
- Fix bug in MapAnnotationObject in mde from @sukunis [#140](https://github.com/ome/omero-insight/pull/140)
- Bump to omero-gateway-java 5.6.4
- Bump omero-gateway-java to 5.6.4


5.5.11 (May 2020)
Expand All @@ -77,7 +84,7 @@
- Add CSV to the list of the supported formats for the attachments dialog [#118](https://github.com/ome/omero-insight/pull/118)
- Build Windows executable using Travis [#115](https://github.com/ome/omero-insight/pull/115)
- Fiji plugin, use the Bio-Formats crop option when opening a large image in Fiji [#114](https://github.com/ome/omero-insight/pull/114)
- Bump to omero-gateway-java 5.6.3
- Bump omero-gateway-java to 5.6.3

5.5.9 (January 2020)
--------------------
Expand All @@ -88,14 +95,14 @@
5.5.8 (December 2019)
---------------------

- Bump to omero-gateway-java 5.6.1 with units fix
- Bump tomero-gateway-java to 5.6.1 with units fix

5.5.7 (December 2019)
---------------------

- Major new metadata feature from @sukunis [#69](https://github.com/ome/omero-insight/pull/69)
- Enable login via web sockets [#66](https://github.com/ome/omero-insight/pull/66)
- Bump to omero-gateway-java 5.6.0 with support for OMERO 5.6
- Bump omero-gateway-java to 5.6.0 with support for OMERO 5.6

5.5.6 (September 2019)
----------------------
Expand All @@ -105,7 +112,7 @@
5.5.5 (August 2019)
-------------------

- Bump to omero-gateway-java 5.5.4
- Bump omero-gateway-java to 5.5.4

5.5.4 (August 2019)
-------------------
Expand All @@ -121,7 +128,7 @@

- Fix SSL cipher issue to allow Insight to be used from Fedora 30
- Fix stack overflow exception
- Bump to omero-gateway-java 5.5.3
- Bump omero-gateway-java to 5.5.3

5.5.2 (June 2019)
-----------------
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "org.openmicroscopy"
version = "5.5.19-SNAPSHOT"
version = "5.5.20-SNAPSHOT"

repositories {
mavenLocal()
Expand Down Expand Up @@ -43,7 +43,7 @@ dependencies {
implementation("org.jfree:jfreechart:1.0.19")
implementation("org.swinglabs:swingx:1.6.1")

implementation("org.openmicroscopy:omero-gateway:5.6.5") {
implementation("org.openmicroscopy:omero-gateway:5.6.6") {
// Conflicts with `net.java.dev.jna`
exclude group: "com.sun.jna", module: "jna"
}
Expand Down
2 changes: 2 additions & 0 deletions src/config/container.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@
<entry name="omero.client.import.mde.enabled" type="boolean">true</entry>
<!-- mde config file location (. for in config dir; omero for local user omero dir) -->
<entry name="omero.client.import.mde.path">omero</entry>
<!-- escape ice special characters, see https://doc.zeroc.com/ice/3.6/properties-and-configuration/configuration-file-syntax -->
<entry name="omero.client.login_escape_characters">#=\s\\</entry>
</services>

<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions src/config/containerImporter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@
<entry name="omero.client.import.mde.enabled" type="boolean">true</entry>
<!-- mde config file location (. for in config dir; omero for local user omero dir) -->
<entry name="omero.client.import.mde.path">omero</entry>
<!-- escape ice special characters, see https://doc.zeroc.com/ice/3.6/properties-and-configuration/configuration-file-syntax -->
<entry name="omero.client.login_escape_characters">#=\s\\</entry>
</services>

<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/openmicroscopy/shoola/env/LookupNames.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*------------------------------------------------------------------------------
* Copyright (C) 2006-2017 University of Dundee. All rights reserved.
* Copyright (C) 2006-2021 University of Dundee. All rights reserved.
*
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -444,4 +444,7 @@ public class LookupNames

/** Lookup name for the user mde path **/
public static final String USER_MDE_PATH = "/user/home/mde";

/** Lookup name for characters which need to escaped for the login username / password */
public static final String LOGIN_ESCAPE_CHARACTERS="omero.client.login_escape_characters";
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -82,6 +81,9 @@ public class UserCredentials extends LoginCredentials
/** Additional command line arguments */
private Set<String> cmdLineArgs = new HashSet<>();

/** Characters which need to be escaped for the login username / password */
private String escapeChars = null;

/**
* Controls if the passed speed index is supported.
*
Expand Down Expand Up @@ -328,8 +330,8 @@ public List<String> getArguments() {
// use this argument list for login and additional command
// line arguments can be passed through.
List<String> res = new ArrayList<>();
res.add("--omero.user="+getUser().getUsername());
res.add("--omero.pass="+getUser().getPassword());
res.add("--omero.user="+escape(getUser().getUsername()));
res.add("--omero.pass="+escape(getUser().getPassword()));
res.add("--omero.host="+getServer().getHost());
res.add("--omero.port="+getServer().getPort());
for (String arg : cmdLineArgs) {
Expand All @@ -340,4 +342,24 @@ public List<String> getArguments() {
}
return res;
}

/**
* Set characters which need to escaped for the login username / password
* @param escapeChars See above.
*/
public void setEscapeChars(String escapeChars) {
this.escapeChars = escapeChars;
}

/**
* Escape characters, if escapeChars is set.
* @param arg The string to escape
* @return See above.
*/
private String escape(String arg) {
if (escapeChars != null && escapeChars.length()>0) {
return arg.replaceAll("([" + escapeChars + "])", "\\\\$1");
}
return arg;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;

import org.openmicroscopy.shoola.env.Container;
import org.openmicroscopy.shoola.env.LookupNames;
import org.openmicroscopy.shoola.env.config.OMEROInfo;
import org.openmicroscopy.shoola.env.config.Registry;
import org.openmicroscopy.shoola.env.data.login.UserCredentials;
Expand Down Expand Up @@ -263,6 +263,7 @@ private void login()
setControlsEnabled(false);
try {
UserCredentials lc = new UserCredentials(usr, psw, s, speedIndex);
lc.setEscapeChars((String) registry.lookup(LookupNames.LOGIN_ESCAPE_CHARACTERS));
lc.setEncrypted(encrypted);
lc.addCmdLineArgs(registry.getCmdLineArgs());
setUserName(usr);
Expand Down

0 comments on commit 5dbb0a9

Please sign in to comment.