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

Update v1.11.0 #87

Merged
merged 45 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e5f6bf9
fix: commit scraper now retries on 202 response from GitHub
ewan-escience Nov 4, 2022
8097e27
build: bump version number
ewan-escience Nov 4, 2022
d70e07f
fix: initial import keywords from doi
dmijatovic Nov 5, 2022
8772fd2
fix: rsd_admin role can edit highligted item.
dmijatovic Nov 5, 2022
e99e369
fix: organisation logo svg scaling
dmijatovic Nov 5, 2022
db6b394
Merge pull request #632 from research-software-directory/620-retry-co…
ewan-escience Nov 7, 2022
3489f9b
Merge pull request #633 from research-software-directory/minor-bug-fixes
dmijatovic Nov 7, 2022
c04af7f
fix: show logo on mobile
dmijatovic Oct 26, 2022
8b6587c
refactor: align header breakpoints with main and footer
dmijatovic Oct 30, 2022
982e40a
refactor: minimal page width for mobile
dmijatovic Oct 30, 2022
bc8400b
feat: show project image on small screen
dmijatovic Oct 30, 2022
7a02847
fix: keyword popup on mobile
dmijatovic Oct 30, 2022
998105b
Merge pull request #610 from research-software-directory/369-organisa…
dmijatovic Nov 7, 2022
038e75e
fix: get token endpoint from well known endpoint on every request
ewan-escience Nov 7, 2022
2fbce74
build: bump version numbers
ewan-escience Nov 7, 2022
317166b
Merge pull request #637 from research-software-directory/589-token-url
ewan-escience Nov 8, 2022
be90df7
feat: add button to fetch names for ORCID whitelist
ewan-escience Nov 8, 2022
78347ac
refactor: add list item text component
dmijatovic Nov 8, 2022
8eb9b89
Merge pull request #639 from research-software-directory/whitelist-names
ewan-escience Nov 9, 2022
3a6cb72
feat: use icons in the software card for mention and contributor counts
dmijatovic Nov 9, 2022
a23a383
ci: update set-output in ghcr action
dmijatovic Nov 9, 2022
c5cf40b
Rename NEXT_PUBLIC_ env variables
Lunaris282 Nov 10, 2022
d9615a4
Merge pull request #640 from research-software-directory/software-car…
dmijatovic Nov 10, 2022
31ec142
Merge pull request #641 from research-software-directory/618-github-a…
dmijatovic Nov 11, 2022
bb939a1
feat: enable wild card search for keyword and research domain on soft…
dmijatovic Nov 11, 2022
675389c
chore: add missing license headers
dmijatovic Nov 11, 2022
50f8484
chore: change image contain label
dmijatovic Nov 11, 2022
d98c1ec
feat: include wild card search on keywords and research domains in gl…
dmijatovic Nov 12, 2022
68003b3
Merge pull request #648 from research-software-directory/385-filter-r…
dmijatovic Nov 14, 2022
c79841c
Merge pull request #645 from Lunaris282/638-rename-NEXT_PUBLIC
dmijatovic Nov 14, 2022
ef595e2
Add get started, our goals, about and learn more sections
ctwhome Nov 6, 2022
0e5025e
Sections order
ctwhome Nov 6, 2022
975767f
fix: filename correction for image
dmijatovic Nov 7, 2022
47b14bd
feat: add contributor and software mention counts
dmijatovic Nov 8, 2022
6488dfe
refactor: move edit button out app header to top of the page. Define …
dmijatovic Nov 12, 2022
65605f7
docs: adds info about logging in with admin rights
cmeessen Nov 14, 2022
b6dea83
fix: rounded corners on IOS when input type is search
dmijatovic Nov 14, 2022
0c97357
chore: improve text on homepage
dmijatovic Nov 14, 2022
8049aa1
Merge pull request #652 from research-software-directory/add-admin-lo…
cmeessen Nov 15, 2022
eadf677
Merge pull request #634 from research-software-directory/629-home-pag…
dmijatovic Nov 15, 2022
a7a31d7
#649: add explanation about checkmark icon to organisation card
dmijatovic Nov 15, 2022
3c91754
Merge pull request #650 from research-software-directory/643-app-header
dmijatovic Nov 15, 2022
f2a605f
fix: homepage links
dmijatovic Nov 15, 2022
fe3b648
chore(release): update citation file
jmaassen Nov 15, 2022
1fa8683
Merge tag 'v1.11.0' into 86-update_v1.11.0
cmeessen Nov 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 15 additions & 21 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -73,48 +73,42 @@ RSD_AUTH_PROVIDERS=SURFCONEXT;HELMHOLTZAAI

# SURFCONEXT - TEST ENVIRONMENT
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_SURFCONEXT_CLIENT_ID=www.research-software.nl
SURFCONEXT_CLIENT_ID=www.research-software.nl
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_SURFCONEXT_REDIRECT=http://localhost/auth/login/surfconext
SURFCONEXT_REDIRECT=http://localhost/auth/login/surfconext
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_SURFCONEXT_WELL_KNOWN_URL=https://connect.test.surfconext.nl/.well-known/openid-configuration
SURFCONEXT_WELL_KNOWN_URL=https://connect.test.surfconext.nl/.well-known/openid-configuration
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_SURFCONEXT_SCOPES=openid
SURFCONEXT_SCOPES=openid
# consumed by: frontend/utils/loginHelpers
NEXT_PUBLIC_SURFCONEXT_RESPONSE_MODE=form_post
# consumed by services: authentication
AUTH_SURFCONEXT_TOKEN_URL=https://connect.test.surfconext.nl/oidc/token
SURFCONEXT_RESPONSE_MODE=form_post

# Helmholtz AAI
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_HELMHOLTZAAI_CLIENT_ID=rsd-dev
HELMHOLTZAAI_CLIENT_ID=rsd-dev
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_HELMHOLTZAAI_REDIRECT=http://localhost/auth/login/helmholtzaai
HELMHOLTZAAI_REDIRECT=http://localhost/auth/login/helmholtzaai
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_HELMHOLTZAAI_WELL_KNOWN_URL=https://login-dev.helmholtz.de/oauth2/.well-known/openid-configuration
HELMHOLTZAAI_WELL_KNOWN_URL=https://login-dev.helmholtz.de/oauth2/.well-known/openid-configuration
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_HELMHOLTZAAI_SCOPES=openid+profile+email+eduperson_principal_name
HELMHOLTZAAI_SCOPES=openid+profile+email+eduperson_principal_name
# consumed by: frontend/utils/loginHelpers
NEXT_PUBLIC_HELMHOLTZAAI_RESPONSE_MODE=query
# consumed by services: authentication
AUTH_HELMHOLTZAAI_TOKEN_URL=https://login-dev.helmholtz.de/oauth2/token
HELMHOLTZAAI_RESPONSE_MODE=query
# consumed by: authentication
# uncomment if you want to allow users from non-Helmholtz centres or social IdPs:
#HELMHOLTZAAI_ALLOW_EXTERNAL_USERS=true

# ORCID
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_ORCID_CLIENT_ID=APP-4D4D69ASWTYOI9QI
ORCID_CLIENT_ID=APP-4D4D69ASWTYOI9QI
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_ORCID_REDIRECT=http://localhost/auth/login/orcid
ORCID_REDIRECT=http://localhost/auth/login/orcid
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_ORCID_WELL_KNOWN_URL=https://sandbox.orcid.org/.well-known/openid-configuration
ORCID_WELL_KNOWN_URL=https://sandbox.orcid.org/.well-known/openid-configuration
# consumed by: authentication, frontend/utils/loginHelpers
NEXT_PUBLIC_ORCID_SCOPES=openid
ORCID_SCOPES=openid
# consumed by: frontend/utils/loginHelpers
NEXT_PUBLIC_ORCID_RESPONSE_MODE=query
# consumed by services: authentication
AUTH_ORCID_TOKEN_URL=https://sandbox.orcid.org/oauth/token
ORCID_RESPONSE_MODE=query

# max requests to the GitHub API per run, runs 10 times per hour
# optional, comment out if not available, a default of 6 will be used
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ jobs:
IMAGE_TAG_LASTEST=${{inputs.base_image_name}}:latest
echo image_tag_version $IMAGE_TAG_VERSION
docker build -t $IMAGE_TAG_VERSION -t $IMAGE_TAG_LASTEST -f ${{inputs.dockerfile}} ${{inputs.docker_context}}
echo "::set-output name=image_build::$IMAGE_TAG_VERSION"
echo "{image_build}={$IMAGE_TAG_VERSIONvalue}" >> $GITHUB_OUTPUT
- name: push to ghcr.io
id: push_image
run: |
echo login
echo "${{secrets.token}}" | docker login https://ghcr.io -u ${{inputs.ghcr_user}} --password-stdin
echo push auth image with all tags
docker push ${{inputs.base_image_name}} --all-tags
echo "::set-output name=image_pushed::true"
echo "{image_build}={$IMAGE_TAG_VERSIONvalue}" >> $GITHUB_OUTPUT

4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ keywords:
- Software Impact
- Software Reuse
license: Apache-2.0
version: v1.10.0
date-released: '2022-11-04'
version: v1.11.0
date-released: '2022-11-15'
Original file line number Diff line number Diff line change
Expand Up @@ -65,54 +65,48 @@ public static String backendBaseUrl() {
return System.getenv("POSTGREST_URL");
}


// SURFconext
public static String surfconextRedirect() {
return System.getenv("NEXT_PUBLIC_SURFCONEXT_REDIRECT");
return System.getenv("SURFCONEXT_REDIRECT");
}

public static String surfconextClientId() {
return System.getenv("NEXT_PUBLIC_SURFCONEXT_CLIENT_ID");
return System.getenv("SURFCONEXT_CLIENT_ID");
}

public static String surfconextWellknown() {
return System.getenv("NEXT_PUBLIC_SURFCONEXT_WELL_KNOWN_URL");
return System.getenv("SURFCONEXT_WELL_KNOWN_URL");
}

public static String surfconextClientSecret() {
return System.getenv("AUTH_SURFCONEXT_CLIENT_SECRET");
}

public static String surfconextTokenUrl() {
return System.getenv("AUTH_SURFCONEXT_TOKEN_URL");
}

public static String surfconextScopes() {
return System.getenv("NEXT_PUBLIC_SURFCONEXT_SCOPES");
return System.getenv("SURFCONEXT_SCOPES");
}


// Helmholtz AAI
public static String helmholtzAaiRedirect() {
return System.getenv("NEXT_PUBLIC_HELMHOLTZAAI_REDIRECT");
return System.getenv("HELMHOLTZAAI_REDIRECT");
}

public static String helmholtzAaiClientId() {
return System.getenv("NEXT_PUBLIC_HELMHOLTZAAI_CLIENT_ID");
return System.getenv("HELMHOLTZAAI_CLIENT_ID");
}

public static String helmholtzAaiWellknown() {
return System.getenv("NEXT_PUBLIC_HELMHOLTZAAI_WELL_KNOWN_URL");
return System.getenv("HELMHOLTZAAI_WELL_KNOWN_URL");
}

public static String helmholtzAaiClientSecret() {
return System.getenv("AUTH_HELMHOLTZAAI_CLIENT_SECRET");
}

public static String helmholtzAaiTokenUrl() {
return System.getenv("AUTH_HELMHOLTZAAI_TOKEN_URL");
}

public static String helmholtzAaiScopes() {
return System.getenv("NEXT_PUBLIC_HELMHOLTZAAI_SCOPES");
return System.getenv("HELMHOLTZAAI_SCOPES");
}

public static boolean helmholtzAaiAllowExternalUsers() {
Expand All @@ -121,29 +115,26 @@ public static boolean helmholtzAaiAllowExternalUsers() {
);
}


// ORCID
public static String orcidRedirect() {
return System.getenv("NEXT_PUBLIC_ORCID_REDIRECT");
return System.getenv("ORCID_REDIRECT");
}

public static String orcidClientId() {
return System.getenv("NEXT_PUBLIC_ORCID_CLIENT_ID");
return System.getenv("ORCID_CLIENT_ID");
}

public static String orcidWellknown() {
return System.getenv("NEXT_PUBLIC_ORCID_WELL_KNOWN_URL");
return System.getenv("ORCID_WELL_KNOWN_URL");
}

public static String orcidClientSecret() {
return System.getenv("AUTH_ORCID_CLIENT_SECRET");
}

public static String orcidTokenUrl() {
return System.getenv("AUTH_ORCID_TOKEN_URL");
}

public static String orcidScopes() {
return System.getenv("NEXT_PUBLIC_ORCID_SCOPES");
return System.getenv("ORCID_SCOPES");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public OpenIdInfo openidInfo() {
ClientID clientID = new ClientID(Config.helmholtzAaiClientId());
Secret clientSecret = new Secret(Config.helmholtzAaiClientSecret());
ClientAuthentication clientAuth = new ClientSecretBasic(clientID, clientSecret);
URI tokenEndpoint = new URI(Config.helmholtzAaiTokenUrl());
URI tokenEndpoint = Utils.getTokenUrlFromWellKnownUrl(URI.create(Config.helmholtzAaiWellknown()));

Scope scopes = new Scope();

Expand Down Expand Up @@ -181,7 +181,7 @@ public OpenIdInfo openidInfo() {
if (organisation == null) {
// login denied by missing entitlements
// or external providers are not allowed
throw new RuntimeException("User is not allowed to login");
throw new RsdAuthenticationException("You are not allowed to login");
}

return new OpenIdInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ private Map<String, String> createForm() {

private String getTokensFromOrcidconext(Map<String, String> form) {
String body = formMapToxWwwFormUrlencoded(form);
return postForm(URI.create(Config.orcidTokenUrl()), body);
URI tokenEndpoint = Utils.getTokenUrlFromWellKnownUrl(URI.create(Config.orcidWellknown()));
return postForm(tokenEndpoint, body);
}

private String formMapToxWwwFormUrlencoded(Map<String, String> form) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ private Map<String, String> createForm() {

private String getTokensFromSurfconext(Map<String, String> form) {
String body = formMapToxWwwFormUrlencoded(form);
return postForm(URI.create(Config.surfconextTokenUrl()), body);
URI tokenEndpoint = Utils.getTokenUrlFromWellKnownUrl(URI.create(Config.surfconextWellknown()));
return postForm(tokenEndpoint, body);
}

private String formMapToxWwwFormUrlencoded(Map<String, String> form) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
package nl.esciencecenter.rsd.authentication;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;

public class Utils {

Expand All @@ -14,4 +23,25 @@ public static String jsonElementToString(JsonElement elementToConvert) {
if (!elementToConvert.isJsonPrimitive()) return null;
return elementToConvert.getAsString();
}

public static URI getTokenUrlFromWellKnownUrl(URI wellKnownUrl) {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(wellKnownUrl).build();
HttpResponse<String> response;

try {
response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
} catch (IOException | InterruptedException e) {
throw new RuntimeException(e);
}

return extractTokenUrlFromWellKnownData(response.body());
}

static URI extractTokenUrlFromWellKnownData(String jsonData) {
JsonObject dataAsObject = JsonParser.parseString(jsonData).getAsJsonObject();
String tokenUrl = dataAsObject.getAsJsonPrimitive("token_endpoint").getAsString();
return URI.create(tokenUrl);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) <e.cahen@esciencecenter.nl>
// SPDX-FileCopyrightText: 2022 Netherlands eScience Center
//
// SPDX-License-Identifier: Apache-2.0

package nl.esciencecenter.rsd.authentication;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.net.URI;

public class UtilsTest {

@Test
void givenValidWellKnownData_whenExtractingTokenEndpoint_correctResultReturned() {
String data = """
{
"token_endpoint_auth_signing_alg_values_supported": [
"RS256"
],
"id_token_signing_alg_values_supported": [
"RS256"
],
"userinfo_endpoint": "https://sandbox.orcid.org/oauth/userinfo",
"authorization_endpoint": "https://sandbox.orcid.org/oauth/authorize",
"token_endpoint": "https://sandbox.orcid.org/oauth/token",
"jwks_uri": "https://sandbox.orcid.org/oauth/jwks",
"claims_supported": [
"family_name",
"given_name",
"name",
"auth_time",
"iss",
"sub"
],
"scopes_supported": [
"openid"
],
"subject_types_supported": [
"public"
],
"response_types_supported": [
"code",
"id_token",
"id_token token"
],
"claims_parameter_supported": false,
"token_endpoint_auth_methods_supported": [
"client_secret_post"
],
"grant_types_supported": [
"authorization_code",
"implicit",
"refresh_token"
],
"issuer": "https://sandbox.orcid.org"
}""";

URI tokenEndpoint = Utils.extractTokenUrlFromWellKnownData(data);

Assertions.assertEquals(URI.create("https://sandbox.orcid.org/oauth/token"), tokenEndpoint);
}

@Test
void givenInvalidJson_whenExtractingTokenEndpoint_thenExceptionThrown() {
String data = "{";

Assertions.assertThrows(RuntimeException.class, () -> Utils.extractTokenUrlFromWellKnownData(data));
}

@Test
void givenDataWithoutTokenEndpoint_whenExtractingTokenEndpoint_thenExceptionThrown() {
String data = "{\"token_endpoint\": null}";

Assertions.assertThrows(ClassCastException.class, () -> Utils.extractTokenUrlFromWellKnownData(data));
}

}
Loading