Commit d77743c1 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '172-session-expiry-notification' into 'master'

Resolve "Session expiry notification"

Closes #172

See merge request !421
parents 1bdd52fc 5204e860
Pipeline #6565 failed with stage
in 9 minutes and 26 seconds
[{"id":"hsa-miR-125a-3p","name":"hsa-miR-125a-3p","targets":[{"name":"FYN","references":[{"annotatorClassName":"","article":{"title":"microRNA-125a-3p reduces cell proliferation and migration by targeting Fyn.","authors":["Ninio-Many L"," Grossman H"," Shomron N"," Chuderland D"," Shalgi R."],"journal":"Journal of cell science","year":2013,"link":"http://www.ncbi.nlm.nih.gov/pubmed/23606749","id":"23606749","citationCount":25,"stringAuthors":"Ninio-Many L, Grossman H, Shomron N, Chuderland D, Shalgi R."},"descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"http://www.ncbi.nlm.nih.gov/pubmed/23606749","resource":"23606749","type":"PUBMED"}],"targetElements":[],"targetParticipants":[{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"https://www.genenames.org/cgi-bin/gene_symbol_report?match=FYN","resource":"FYN","type":"HGNC_SYMBOL"}]},{"name":"GPC4","references":[{"annotatorClassName":"","article":{"title":"MicroRNA-125a inhibits cell growth by targeting glypican-4.","authors":["Feng C"," Li J"," Ruan J"," Ding K."],"journal":"Glycoconjugate journal","year":2012,"link":"http://www.ncbi.nlm.nih.gov/pubmed/22644326","id":"22644326","citationCount":8,"stringAuthors":"Feng C, Li J, Ruan J, Ding K."},"descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"http://www.ncbi.nlm.nih.gov/pubmed/22644326","resource":"22644326","type":"PUBMED"}],"targetElements":[],"targetParticipants":[{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"http://www.genenames.org/cgi-bin/gene_symbol_report?match=GPC4","resource":"GPC4","type":"HGNC_SYMBOL"}]},{"name":"RHOA","references":[{"annotatorClassName":"","article":{"title":"MiRNA-125a-3p is a negative regulator of the RhoA-actomyosin pathway in A549 cells.","authors":["Huang B"," Luo W"," Sun L"," Zhang Q"," Jiang L"," Chang J"," Qiu X"," Wang E."],"journal":"International journal of oncology","year":2013,"link":"http://www.ncbi.nlm.nih.gov/pubmed/23525486","id":"23525486","citationCount":14,"stringAuthors":"Huang B, Luo W, Sun L, Zhang Q, Jiang L, Chang J, Qiu X, Wang E."},"descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"http://www.ncbi.nlm.nih.gov/pubmed/23525486","resource":"23525486","type":"PUBMED"}],"targetElements":[],"targetParticipants":[{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"https://www.genenames.org/cgi-bin/gene_symbol_report?match=RHOA","resource":"RHOA","type":"HGNC_SYMBOL"}]}]}]
\ No newline at end of file
[{"id":"hsa-miR-125a-3p","name":"hsa-miR-125a-3p","targets":[{"name":"FYN","references":[{"annotatorClassName":"","article":{"title":"microRNA-125a-3p reduces cell proliferation and migration by targeting Fyn.","authors":["Ninio-Many L"," Grossman H"," Shomron N"," Chuderland D"," Shalgi R."],"journal":"Journal of cell science","year":2013,"link":"http://www.ncbi.nlm.nih.gov/pubmed/23606749","id":"23606749","citationCount":25,"stringAuthors":"Ninio-Many L, Grossman H, Shomron N, Chuderland D, Shalgi R."},"descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"http://www.ncbi.nlm.nih.gov/pubmed/23606749","resource":"23606749","type":"PUBMED"}],"targetElements":[],"targetParticipants":[{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"https://www.genenames.org/cgi-bin/gene_symbol_report?match=FYN","resource":"FYN","type":"HGNC_SYMBOL"}]},{"name":"GPC4","references":[{"annotatorClassName":"","article":{"title":"MicroRNA-125a inhibits cell growth by targeting glypican-4.","authors":["Feng C"," Li J"," Ruan J"," Ding K."],"journal":"Glycoconjugate journal","year":2012,"link":"http://www.ncbi.nlm.nih.gov/pubmed/22644326","id":"22644326","citationCount":8,"stringAuthors":"Feng C, Li J, Ruan J, Ding K."},"descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"http://www.ncbi.nlm.nih.gov/pubmed/22644326","resource":"22644326","type":"PUBMED"}],"targetElements":[],"targetParticipants":[{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"http://www.genenames.org/cgi-bin/gene_symbol_report?match=GPC4","resource":"GPC4","type":"HGNC_SYMBOL"}]},{"name":"RHOA","references":[{"annotatorClassName":"","article":{"title":"MiRNA-125a-3p is a negative regulator of the RhoA-actomyosin pathway in A549 cells.","authors":["Huang B"," Luo W"," Sun L"," Zhang Q"," Jiang L"," Chang J"," Qiu X"," Wang E."],"journal":"International journal of oncology","year":2013,"link":"http://www.ncbi.nlm.nih.gov/pubmed/23525486","id":"23525486","citationCount":8,"stringAuthors":"Huang B, Luo W, Sun L, Zhang Q, Jiang L, Chang J, Qiu X, Wang E."},"descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"http://www.ncbi.nlm.nih.gov/pubmed/23525486","resource":"23525486","type":"PUBMED"}],"targetElements":[],"targetParticipants":[{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":0,"link":"https://www.genenames.org/cgi-bin/gene_symbol_report?match=RHOA","resource":"RHOA","type":"HGNC_SYMBOL"}]}]}]
\ No newline at end of file
{"overlayContent":{"modelId":15781,"idObject":"329163","value":null,"color":{"alpha":255,"rgb":-7602176},"description":"upstream","type":"GENETIC_VARIANT","geneVariations":[{"position":100,"originalDna":"AC","modifiedDna":"A","contig":"chr1","allelFrequency":null,"variantIdentifier":null,"referenceGenomeType":"UCSC","referenceGenomeVersion":"eboVir3","references":[]}],"uniqueId":"329163"},"type":"ALIAS"}
\ No newline at end of file
{"overlayContent":{"modelId":15781,"idObject":"329163","value":null,"color":{"alpha":255,"rgb":-7602176},"description":"upstream","type":"GENETIC_VARIANT","geneVariations":[{"position":100,"originalDna":"AC","modifiedDna":"A","contig":"chr1","allelFrequency":null,"aminoAcidChange":null,"variantIdentifier":null,"referenceGenomeType":"UCSC","referenceGenomeVersion":"eboVir3","references":[]}],"uniqueId":"329163"},"type":"ALIAS"}
\ No newline at end of file
{"elementAnnotations":{"BiGG_COMPARTMENT":0,"BiGG_METABOLITE":0,"BiGG_REACTIONS":0,"BRENDA":0,"CAS":0,"CAZY":0,"CCDS":0,"CHEBI":0,"CHEMSPIDER":0,"CHEMBL_COMPOUND":0,"CHEMBL_TARGET":0,"COG":0,"DOI":0,"DRUGBANK":0,"DRUGBANK_TARGET_V4":0,"EC":0,"ENSEMBL":0,"ENSEMBL_PLANTS":0,"ENTREZ":2,"GO":0,"HGNC":1,"HGNC_SYMBOL":0,"HMDB":0,"INTERPRO":0,"KEGG_COMPOUND":0,"KEGG_GENES":1,"KEGG_ORTHOLOGY":0,"KEGG_PATHWAY":0,"KEGG_REACTION":0,"MESH_2012":0,"MI_R_BASE_SEQUENCE":0,"MI_R_BASE_MATURE_SEQUENCE":0,"MIR_TAR_BASE_MATURE_SEQUENCE":0,"MGD":0,"OMIM":0,"PANTHER":0,"PDB":0,"PFAM":0,"PHARM":1,"PUBCHEM":0,"PUBCHEM_SUBSTANCE":0,"PUBMED":0,"REACTOME":4,"REFSEQ":5,"RHEA":0,"SGD":0,"STITCH":0,"STRING":0,"TAIR_LOCUS":0,"TAXONOMY":0,"TOXICOGENOMIC_CHEMICAL":0,"UNIGENE":0,"UNIPROT":0,"UNIPROT_ISOFORM":0,"UNKNOWN":0,"WIKIDATA":0,"WIKIPATHWAYS":0,"WIKIPEDIA":0,"WORM_BASE":0},"publications":12,"reactionAnnotations":{"BiGG_COMPARTMENT":0,"BiGG_METABOLITE":0,"BiGG_REACTIONS":0,"BRENDA":0,"CAS":0,"CAZY":0,"CCDS":0,"CHEBI":0,"CHEMSPIDER":0,"CHEMBL_COMPOUND":0,"CHEMBL_TARGET":0,"COG":0,"DOI":0,"DRUGBANK":0,"DRUGBANK_TARGET_V4":0,"EC":0,"ENSEMBL":0,"ENSEMBL_PLANTS":0,"ENTREZ":0,"GO":0,"HGNC":0,"HGNC_SYMBOL":0,"HMDB":0,"INTERPRO":0,"KEGG_COMPOUND":0,"KEGG_GENES":0,"KEGG_ORTHOLOGY":0,"KEGG_PATHWAY":0,"KEGG_REACTION":0,"MESH_2012":0,"MI_R_BASE_SEQUENCE":0,"MI_R_BASE_MATURE_SEQUENCE":0,"MIR_TAR_BASE_MATURE_SEQUENCE":0,"MGD":0,"OMIM":0,"PANTHER":0,"PDB":0,"PFAM":0,"PHARM":0,"PUBCHEM":0,"PUBCHEM_SUBSTANCE":0,"PUBMED":12,"REACTOME":2,"REFSEQ":0,"RHEA":0,"SGD":0,"STITCH":0,"STRING":0,"TAIR_LOCUS":0,"TAXONOMY":0,"TOXICOGENOMIC_CHEMICAL":0,"UNIGENE":0,"UNIPROT":0,"UNIPROT_ISOFORM":0,"UNKNOWN":0,"WIKIDATA":0,"WIKIPATHWAYS":0,"WIKIPEDIA":0,"WORM_BASE":0}}
\ No newline at end of file
{"elementAnnotations":{"BiGG_COMPARTMENT":0,"BiGG_METABOLITE":0,"BiGG_REACTIONS":0,"BRENDA":0,"CAS":0,"CAZY":0,"CCDS":0,"CHEBI":0,"CHEMSPIDER":0,"CHEMBL_COMPOUND":0,"CHEMBL_TARGET":0,"COG":0,"DOI":0,"DRUGBANK":0,"DRUGBANK_TARGET_V4":0,"EC":0,"ENSEMBL":0,"ENSEMBL_PLANTS":0,"ENTREZ":2,"GO":0,"HGNC":1,"HGNC_SYMBOL":0,"HMDB":0,"INTERPRO":0,"KEGG_COMPOUND":0,"KEGG_GENES":1,"KEGG_ORTHOLOGY":0,"KEGG_PATHWAY":0,"KEGG_REACTION":0,"MESH_2012":0,"MI_R_BASE_SEQUENCE":0,"MI_R_BASE_MATURE_SEQUENCE":0,"MIR_TAR_BASE_MATURE_SEQUENCE":0,"MGD":0,"OMIM":0,"PANTHER":0,"PDB":0,"PFAM":0,"PHARM":1,"PUBCHEM":0,"PUBCHEM_SUBSTANCE":0,"PUBMED":0,"REACTOME":4,"REFSEQ":5,"RHEA":0,"SGD":0,"STITCH":0,"STRING":0,"TAIR_LOCUS":0,"TAXONOMY":0,"TOXICOGENOMIC_CHEMICAL":0,"UNIGENE":0,"UNIPROT":0,"UNIPROT_ISOFORM":0,"UNKNOWN":0,"VMH_REACTION":0,"VMH_METABOLITE":0,"WIKIDATA":0,"WIKIPATHWAYS":0,"WIKIPEDIA":0,"WORM_BASE":0},"publications":12,"reactionAnnotations":{"BiGG_COMPARTMENT":0,"BiGG_METABOLITE":0,"BiGG_REACTIONS":0,"BRENDA":0,"CAS":0,"CAZY":0,"CCDS":0,"CHEBI":0,"CHEMSPIDER":0,"CHEMBL_COMPOUND":0,"CHEMBL_TARGET":0,"COG":0,"DOI":0,"DRUGBANK":0,"DRUGBANK_TARGET_V4":0,"EC":0,"ENSEMBL":0,"ENSEMBL_PLANTS":0,"ENTREZ":0,"GO":0,"HGNC":0,"HGNC_SYMBOL":0,"HMDB":0,"INTERPRO":0,"KEGG_COMPOUND":0,"KEGG_GENES":0,"KEGG_ORTHOLOGY":0,"KEGG_PATHWAY":0,"KEGG_REACTION":0,"MESH_2012":0,"MI_R_BASE_SEQUENCE":0,"MI_R_BASE_MATURE_SEQUENCE":0,"MIR_TAR_BASE_MATURE_SEQUENCE":0,"MGD":0,"OMIM":0,"PANTHER":0,"PDB":0,"PFAM":0,"PHARM":0,"PUBCHEM":0,"PUBCHEM_SUBSTANCE":0,"PUBMED":12,"REACTOME":2,"REFSEQ":0,"RHEA":0,"SGD":0,"STITCH":0,"STRING":0,"TAIR_LOCUS":0,"TAXONOMY":0,"TOXICOGENOMIC_CHEMICAL":0,"UNIGENE":0,"UNIPROT":0,"UNIPROT_ISOFORM":0,"UNKNOWN":0,"VMH_REACTION":0,"VMH_METABOLITE":0,"WIKIDATA":0,"WIKIPATHWAYS":0,"WIKIPEDIA":0,"WORM_BASE":0}}
\ No newline at end of file
{"version":"0","disease":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104479,"link":"http://bioportal.bioontology.org/ontologies/1351?p=terms&conceptid=D010300","resource":"D010300","type":"MESH_2012"},"organism":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104480,"link":"http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=9606","resource":"9606","type":"TAXONOMY"},"idObject":14898,"status":"Ok","directory":"5e8ff9bf55ba3508199d22e984129be6","progress":100.0,"notifyEmail":"","warnings":true,"errors":false,"name":"UNKNOWN DISEASE MAP","projectId":"sample","mapCanvasType":"OPEN_LAYERS","overviewImageViews":[],"topOverviewImage":null}
\ No newline at end of file
{"version":"0","disease":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104479,"link":"https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=8822","resource":"D010300","type":"MESH_2012"},"organism":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104480,"link":"http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=9606","resource":"9606","type":"TAXONOMY"},"idObject":14898,"status":"Ok","directory":"5e8ff9bf55ba3508199d22e984129be6","progress":100.0,"notifyEmail":"","warnings":true,"errors":false,"name":"UNKNOWN DISEASE MAP","projectId":"sample","mapCanvasType":"OPEN_LAYERS","overviewImageViews":[],"topOverviewImage":null}
\ No newline at end of file
{"version":"0","disease":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104479,"link":"http://bioportal.bioontology.org/ontologies/1351?p=terms&conceptid=D010300","resource":"D010300","type":"MESH_2012"},"organism":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104480,"link":"http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=9606","resource":"9606","type":"TAXONOMY"},"idObject":14898,"status":"Ok","directory":"5e8ff9bf55ba3508199d22e984129be6","progress":100.0,"notifyEmail":"","warnings":true,"errors":false,"name":"UNKNOWN DISEASE MAP","projectId":"sample","mapCanvasType":"OPEN_LAYERS","overviewImageViews":[],"topOverviewImage":null}
\ No newline at end of file
{"version":"0","disease":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104479,"link":"https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=8822","resource":"D010300","type":"MESH_2012"},"organism":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104480,"link":"http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=9606","resource":"9606","type":"TAXONOMY"},"idObject":14898,"status":"Ok","directory":"5e8ff9bf55ba3508199d22e984129be6","progress":100.0,"notifyEmail":"","warnings":true,"errors":false,"name":"UNKNOWN DISEASE MAP","projectId":"sample","mapCanvasType":"OPEN_LAYERS","overviewImageViews":[],"topOverviewImage":null}
\ No newline at end of file
......@@ -285,6 +285,9 @@ public enum ConfigurationElementType {
SHOW_ELEMENT_ANNOTATIONS("Show element annotations", "true", ConfigurationElementEditType.BOOLEAN, false,
ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS),
SESSION_LENGTH("Max session inactivity time (in seconds)", "7200", ConfigurationElementEditType.INTEGER, false,
ConfigurationElementTypeGroup.SERVER_CONFIGURATION), //
;
......
......@@ -70,6 +70,8 @@ public class UserController extends BaseController {
Authentication authentication = this.authenticationProvider.authenticate(springToken);
SecurityContextHolder.getContext().setAuthentication(authentication);
request.getSession().setMaxInactiveInterval(Configuration.getSessionLength());
userService.login(login, password, request.getSession().getId());
Map<String, Object> result = new TreeMap<>();
......
......@@ -4,12 +4,15 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.EnumUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import lcsb.mapviewer.common.Configuration;
import lcsb.mapviewer.common.FrameworkVersion;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.user.ConfigurationElementEditType;
import lcsb.mapviewer.model.user.ConfigurationElementType;
import lcsb.mapviewer.model.user.ConfigurationOption;
import lcsb.mapviewer.model.user.PrivilegeType;
......@@ -62,6 +65,11 @@ public class ConfigurationService implements IConfigurationService {
configuration = new ConfigurationOption();
configuration.setType(type);
}
if (type.getEditType().equals(ConfigurationElementEditType.INTEGER)) {
if (!StringUtils.isNumeric(value)) {
throw new InvalidArgumentException(type + " must be an integer");
}
}
configuration.setValue(value);
configurationDao.add(configuration);
......@@ -70,6 +78,8 @@ public class ConfigurationService implements IConfigurationService {
for (String domain : getConfigurationValue(ConfigurationElementType.X_FRAME_DOMAIN).split(";")) {
Configuration.getxFrameDomain().add(domain);
}
} else if (type.equals(ConfigurationElementType.SESSION_LENGTH)) {
Configuration.setSessionLength(Integer.valueOf(value));
}
}
......
......@@ -76,10 +76,21 @@ public class StartupBean {
setInterruptedProjectsStatuses();
modifyXFrameDomain();
setSessionLength();
removeInterruptedReferenceGenomeDownloads();
logger.debug("Application startup script ends");
}
private void setSessionLength() {
try {
String sessionLength = configurationService.getConfigurationValue(ConfigurationElementType.SESSION_LENGTH);
Integer value = Integer.valueOf(sessionLength);
Configuration.setSessionLength(value);
} catch (Exception e) {
logger.error("Problem with setting default session length.", e);
}
}
private void modifyXFrameDomain() {
try {
for (String domain : configurationService.getConfigurationValue(ConfigurationElementType.X_FRAME_DOMAIN)
......
......@@ -45,7 +45,7 @@ public class XFrameAccessControlFilter implements Filter {
value += domain + " ";
}
}
if (!value.equals("frame-ancestors ")) {
response.addHeader("Content-Security-Policy", value);
} else {
......
......@@ -6,13 +6,13 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lcsb.mapviewer.common.Configuration;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import org.springframework.security.web.savedrequest.HttpSessionRequestCache;
import org.springframework.security.web.savedrequest.SavedRequest;
import lcsb.mapviewer.common.Configuration;
/**
* Implementation of Spring Authentication Success Handler. When authentication
* is success, it will redirect user to the web page that had accessed before
......@@ -22,27 +22,20 @@ import org.springframework.security.web.savedrequest.SavedRequest;
*/
public class MvAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {
/**
* Default session expire time in seconds (120 minutes).
*/
private static final Integer MAX_INACTIVE_INTERVAL = 120 * 60;
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException,
ServletException {
request.getSession().setMaxInactiveInterval(MAX_INACTIVE_INTERVAL);
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) throws IOException, ServletException {
SavedRequest savedRequest = new HttpSessionRequestCache().getRequest(request, response);
String url = request.getParameter("from");
// if we are not redirecting from somewhere then
if ((url != null && !url.isEmpty())) {
logger.debug("Found redirect URL");
} else if (savedRequest == null) {
logger.debug(request.getRequestURL());
//redirect to the main page
// redirect to the main page
url = request.getRequestURL().toString().replace(request.getServletPath(), "") + Configuration.MAIN_PAGE;
String queryString = request.getQueryString();
......
......@@ -959,8 +959,6 @@ ui-overlay-visible *{visibility:visible !important;}
.ui-wizard-nav-next{float:right;}
.ui-wizard-step-title{font-size:18px;margin:0 3px 0 0;padding:0.4em;float:left;}
.rightHeaderMenu{height:36px; line-height:35px; font-size:13px; font-weight:900; color:#ffffff; display:inline; width:auto; float:right}
.ui-galleria-filmstrip {background-color:#21BDF1; padding:2px; height:68px; margin-top:0;}
.ui-galleria-frame {border:1px solid #cccccc; height:34px !important;}
.ui-galleria-frame-image {height:34px !important;}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment