Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
fix for multirequest problem for locator and finder (#192)
Browse files Browse the repository at this point in the history
* should fix the problem with multirequest for locator and finder

* Hotfix: autologin from the directory (#170)

* added attempt to "login" without prompt if fails redirect to login page

* bugfix only overwrite redirect is no error is in QueryString

Co-authored-by: Emilian Jungwirth <emilian.jung+github@gmail.com>

* feature: acceptance test (#169)

* Documentation cleanup (#172)

* updated documentation

* Update development.md

* fix: not reachable collection status message (#173)

* Publishing to GitHub packages (#174)

* feat: GitHub packages

* fix: maven settings

* fix: pom version

* fix: docker registries

* feat: deploy workflow

* feat: deploy workflow on dispatch

* Fix: trivy image scan

* fix: trivy image scan

* fix: deployment url

* fix: jackson media to 2.35 (#175)

* fix: jackson media to 2.35

* fix: commons-configuration to 1.10

* fix: trivy scan

* fix: acceptance test

* Throttling the requests by waiting for x seconds in the range [0,3] before requesting the next batch. (#176)

* hotfix: not reachable typo

* Fix to add userID for selected queries; add queries for owners without queryID to allow acting on behalf of Biobank; (#179)

for details see RT #7426: AW: [ext] AW: Negotiator requests

* Update build.yml

* Update build.yml

* Update build.yml

* fix: wording for stepaway texts on UI (#181)

* Throttling the requests by waiting for x seconds in the range [0,3] before requesting the next batch.

* changed text for step away reasons  - #163 (#163)

* Change the wording for texts according to suggestions - #162 - (#162)

* feat: dynamic step away view

* feat: dynamic step away view

---------

Co-authored-by: Radovan Tomášik <tomasik@mail.muni.cz>

* feat: mail notifications toggle

Co-authored-by: Konrad Lang <110096044+konradlang@users.noreply.github.com>

* Feat: no basic auth (#183)

* feat: removed auth check

* feat: removed auth check
* fix: tests mocks

* feat: favicon and tag title (#184)

* feat: favicon and tag title

* feat: favicon and tag title for admin

* Revert "Feat: no basic auth (#183)" (#185)

This reverts commit 3546897.

* chore: new favicon

* chore: new favicon (#186)

* chore: new favicon

* chore: workflow hardening

* chore: production deployment workflow

* chore: production deployment workflow

* hotfix: surefire config

* fix: dockerhub credentials

* hotfix: maven settings (#189)

* hotfix: maven settings

* chore: workflow cleanup

* Hotfix/performace owner query load (#188)

* getQuery by ID for owner directly from DB

* redirect to researcher query detail page if not an owner

* only use query_paarm_for redirect

* fix: dockerhub credentials

* removed old commented code

* added check for query_param

---------

Co-authored-by: Emilian Jungwirth <emilian.jung+github@gmail.com>

* Feat/swagger (#187)

* feat: swagger json

* fix: git properties

* chore: workflow java version 11

* feat: swagger-ui

* Update pom.xml to 2.7.6

* update unit tests

---------

Co-authored-by: Radovan Tomášik <tomasik@mail.muni.cz>
Co-authored-by: Konrad Lang <110096044+konradlang@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 27, 2023
1 parent 77a4d13 commit 249ea4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private String getAppandNewQueryToRequestUrlForLocator(NToken token) {
if(url.endsWith("/")) {
urlEnd = "";
}
url = url + urlEnd + "?" + token.getNTokenForUrl("nToken");
url = url + urlEnd + "?" + token.getRequestTokenForUrl("nToken");
return url;
}

Expand All @@ -43,7 +43,7 @@ private String getAppandNewQueryToRequestUrlForFinder(NToken token) {
if(url.endsWith("/")) {
urlEnd = "";
}
url = url + urlEnd + "?" + token.getNTokenForUrl("nToken");
url = url + urlEnd + "?" + token.getRequestTokenForUrl("nToken");
return url;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,41 @@ class RedirectUrlGeneratorToExistingRequestTest {
@Test
@DisplayName("Test creating locator redirect url to append a query to existing request with url ending in /")
void testGetAppandNewQueryToRequestUrl_LocatorUrl_WithEndingChr() {
Mockito.doReturn("ntoken=d349331e-437a-4773-b9db-5577b80504c9__search__c3a9645a-9cec-490b-932d-a6358db42e99").when(nToken).getNTokenForUrl("nToken");
Mockito.doReturn("ntoken=d349331e-437a-4773-b9db-5577b80504c9__search__").when(nToken).getRequestTokenForUrl("nToken");
RedirectUrlGenerator redirectUrlGenerator = new RedirectUrlGenerator();
redirectUrlGenerator.setUrl("https://locator.bbmri-eric.eu/");
String url = redirectUrlGenerator.getAppandNewQueryToRequestUrl(nToken);
assertEquals("https://locator.bbmri-eric.eu/?ntoken=d349331e-437a-4773-b9db-5577b80504c9__search__c3a9645a-9cec-490b-932d-a6358db42e99", url);
assertEquals("https://locator.bbmri-eric.eu/?ntoken=d349331e-437a-4773-b9db-5577b80504c9__search__", url);
}

@Test
@DisplayName("Test creating locator redirect url to append a query to existing request with url not ending in /")
void testGetAppandNewQueryToRequestUrl_LocatorUrl_WithoutEndingChr() {
Mockito.doReturn("ntoken=d349331e-437a-4773-b9db-5577b80504c9__search__c3a9645a-9cec-490b-932d-a6358db42e99").when(nToken).getNTokenForUrl("nToken");
Mockito.doReturn("ntoken=d349331e-437a-4773-b9db-5577b80504c9__search__").when(nToken).getRequestTokenForUrl("nToken");
RedirectUrlGenerator redirectUrlGenerator = new RedirectUrlGenerator();
redirectUrlGenerator.setUrl("https://locator.bbmri-eric.eu");
String url = redirectUrlGenerator.getAppandNewQueryToRequestUrl(nToken);
assertEquals("https://locator.bbmri-eric.eu/?ntoken=d349331e-437a-4773-b9db-5577b80504c9__search__c3a9645a-9cec-490b-932d-a6358db42e99", url);
assertEquals("https://locator.bbmri-eric.eu/?ntoken=d349331e-437a-4773-b9db-5577b80504c9__search__", url);
}

@Test
@DisplayName("Test creating finder redirect url to append a query to existing request with url ending in /")
void testGetAppandNewQueryToRequestUrl_FinderUrl_WithEndingChr() {
Mockito.doReturn("nToken=d349331e-437a-4773-b9db-5577b80504c9__search__c3a9645a-9cec-490b-932d-a6358db42e99").when(nToken).getNTokenForUrl("nToken");
Mockito.doReturn("nToken=d349331e-437a-4773-b9db-5577b80504c9__search__").when(nToken).getRequestTokenForUrl("nToken");
RedirectUrlGenerator redirectUrlGenerator = new RedirectUrlGenerator();
redirectUrlGenerator.setUrl("https://finder.bbmri-eric.eu/");
String url = redirectUrlGenerator.getAppandNewQueryToRequestUrl(nToken);
assertEquals("https://finder.bbmri-eric.eu/?nToken=d349331e-437a-4773-b9db-5577b80504c9__search__c3a9645a-9cec-490b-932d-a6358db42e99", url);
assertEquals("https://finder.bbmri-eric.eu/?nToken=d349331e-437a-4773-b9db-5577b80504c9__search__", url);
}

@Test
@DisplayName("Test creating finder redirect url to append a query to existing request with url not ending in /")
void testGetAppandNewQueryToRequestUrl_FinderUrl_WithoutEndingChr() {
Mockito.doReturn("nToken=d349331e-437a-4773-b9db-5577b80504c9__search__c3a9645a-9cec-490b-932d-a6358db42e99").when(nToken).getNTokenForUrl("nToken");
Mockito.doReturn("nToken=d349331e-437a-4773-b9db-5577b80504c9__search__").when(nToken).getRequestTokenForUrl("nToken");
RedirectUrlGenerator redirectUrlGenerator = new RedirectUrlGenerator();
redirectUrlGenerator.setUrl("https://finder.bbmri-eric.eu");
String url = redirectUrlGenerator.getAppandNewQueryToRequestUrl(nToken);
assertEquals("https://finder.bbmri-eric.eu/?nToken=d349331e-437a-4773-b9db-5577b80504c9__search__c3a9645a-9cec-490b-932d-a6358db42e99", url);
assertEquals("https://finder.bbmri-eric.eu/?nToken=d349331e-437a-4773-b9db-5577b80504c9__search__", url);
}

@Test
Expand Down

0 comments on commit 249ea4b

Please sign in to comment.