-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from RADAR-base/release-1.2.0
Release 1.2.0
- Loading branch information
Showing
26 changed files
with
735 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
*.iml | ||
*.ipr | ||
/out/ | ||
local.properties | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 39 additions & 10 deletions
49
...r-app/src/app/components/rest-source-authorization/update-rest-source-user.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,74 @@ | ||
<ngb-alert *ngIf="errorMessage" type="danger" (close)="errorMessage = null">{{ errorMessage}}</ngb-alert> | ||
<ngb-alert *ngIf="errorMessage" type="danger" | ||
(close)="errorMessage = null">{{ errorMessage}}</ngb-alert> | ||
<div *ngIf="restSourceUser" class="container col-md-3"> | ||
<h3> Enter details for User with External User Id: {{restSourceUser.externalUserId}}</h3> | ||
<form> | ||
<form #userForm="ngForm"> | ||
<div class="form-group"> | ||
<label for="projectId">Project Id: </label> | ||
<input class="form-control" name="projectId" type="text" [(ngModel)]="restSourceUser.projectId" id="projectId" placement="top" ngbTooltip="Project name from ManagementPortal"> | ||
<input class="form-control" name="projectId" type="text" | ||
[(ngModel)]="restSourceUser.projectId" #projectId="ngModel" | ||
id="projectId" placement="top" ngbTooltip="Project name from ManagementPortal" | ||
required minlength="4"> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="userId">User Id: </label> | ||
<input class="form-control" name="userId" [disabled]="isEditing" type="text" [(ngModel)]="restSourceUser.userId" id="userId" placement="top" ngbTooltip="Subject Id from ManagementPortal"> | ||
<input class="form-control" name="userId" [disabled]="isEditing" type="text" | ||
[(ngModel)]="restSourceUser.userId" #userId="ngModel" | ||
id="userId" placement="top" ngbTooltip="Subject Id from ManagementPortal" | ||
required minlength="4" | ||
pattern="[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}"> | ||
</div> | ||
|
||
<div | ||
*ngIf="(userId.invalid && (userId.dirty || userId.touched)) || (projectId.invalid && (projectId.dirty || projectId.touched))" | ||
class="alert alert-danger"> | ||
|
||
<div *ngIf="userId.errors?.required || projectId.errors?.required"> | ||
Project and User Id is required. | ||
</div> | ||
<div *ngIf="userId.errors?.minlength || projectId.errors?.minlength"> | ||
Project and User Id must be at least 4 characters long. | ||
</div> | ||
<div *ngIf="userId.errors?.pattern"> | ||
The pattern of the entered User Id is not correct. | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="sourceId">Source Id: </label> | ||
<input class="form-control" name="sourceId" disabled type="text" [(ngModel)]="restSourceUser.sourceId" id="sourceId"> | ||
<input class="form-control" name="sourceId" disabled type="text" | ||
[(ngModel)]="restSourceUser.sourceId" id="sourceId"> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="startDate">Start Date: </label> | ||
<div class="input-group" placement="top" ngbTooltip="Start date to collect data from this source"> | ||
<div class="input-group" placement="top" | ||
ngbTooltip="Start date to collect data from this source"> | ||
<input id="startDate" class="form-control" placeholder="yyyy-mm-dd" | ||
name="startDate" [(ngModel)]="startDate" ngbDatepicker #e="ngbDatepicker"> | ||
<div class="input-group-append"> | ||
<button class="btn btn-outline-secondary calendar" (click)="e.toggle()" type="button" ></button> | ||
<button class="btn btn-outline-secondary calendar" (click)="e.toggle()" | ||
type="button"></button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="endDate">End Date: </label> | ||
<div class="input-group" placement="top" ngbTooltip="End date to collect data from this source"> | ||
<div class="input-group" placement="top" | ||
ngbTooltip="End date to collect data from this source"> | ||
<input id="endDate" class="form-control" placeholder="yyyy-mm-dd" | ||
name="endDate" [(ngModel)]="endDate" ngbDatepicker #d="ngbDatepicker"> | ||
<div class="input-group-append"> | ||
<button class="btn btn-outline-secondary calendar" (click)="d.toggle()" type="button"></button> | ||
<button class="btn btn-outline-secondary calendar" (click)="d.toggle()" | ||
type="button"></button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<button type="button" (click)="updateRestSourceUser()" class="btn btn-success">Submit</button> | ||
<button [disabled]="!userForm.valid" type="button" (click)="updateRestSourceUser()" | ||
class="btn btn-success">Submit | ||
</button> | ||
</form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export const environment = { | ||
production: true, | ||
BACKEND_BASE_URL: '/rest-sources/backend' | ||
BACKEND_BASE_URL: '/rest-sources/backend', | ||
VALIDATE: true | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#Fri Oct 04 00:13:17 BST 2019 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |
Binary file not shown.
8 changes: 8 additions & 0 deletions
8
src/main/docker/etc/managementportal/oauth_client_details.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
client_id;resource_ids;client_secret;scope;authorized_grant_types;redirect_uri;authorities;access_token_validity;refresh_token_validity;additional_information;autoapprove | ||
pRMT;res_ManagementPortal,res_gateway,res_AppServer;;MEASUREMENT.CREATE,SUBJECT.UPDATE,SUBJECT.READ,PROJECT.READ,SOURCETYPE.READ,SOURCE.READ,SOURCETYPE.READ,SOURCEDATA.READ,USER.READ,ROLE.READ;refresh_token,authorization_code;;;43200;7948800;{"dynamic_registration": true}; | ||
aRMT;res_ManagementPortal,res_gateway;;MEASUREMENT.CREATE,SUBJECT.UPDATE,SUBJECT.READ,PROJECT.READ,SOURCETYPE.READ,SOURCE.READ,SOURCETYPE.READ,SOURCEDATA.READ,USER.READ,ROLE.READ;refresh_token,authorization_code;;;43200;7948800;{"dynamic_registration": true}; | ||
THINC-IT;res_ManagementPortal,res_gateway;secret;MEASUREMENT.CREATE,SUBJECT.UPDATE,SUBJECT.READ,PROJECT.READ,SOURCETYPE.READ,SOURCE.READ,SOURCETYPE.READ,SOURCEDATA.READ,USER.READ,ROLE.READ;refresh_token,authorization_code;;;43200;7948800;{"dynamic_registration": true}; | ||
radar_restapi;res_ManagementPortal;secret;SUBJECT.READ,PROJECT.READ,SOURCE.READ,SOURCETYPE.READ;password,client_credentials;;;43200;259200;{}; | ||
radar_redcap_integrator;res_ManagementPortal;secret;PROJECT.READ,SUBJECT.CREATE,SUBJECT.READ,SUBJECT.UPDATE;client_credentials;;;43200;259200;{}; | ||
radar_dashboard;res_ManagementPortal,res_RestApi;secret;SUBJECT.READ,PROJECT.READ,SOURCE.READ,SOURCETYPE.READ,MEASUREMENT.READ;client_credentials;;;43200;259200;{}; | ||
radar_rest_sources_auth;res_ManagementPortal;secret;SUBJECT.READ,PROJECT.READ;client_credentials;;;43200;259200;{}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: '2.1' | ||
|
||
services: | ||
#---------------------------------------------------------------------------# | ||
# Management Portal # | ||
#---------------------------------------------------------------------------# | ||
managementportal: | ||
image: radarbase/management-portal:0.5.8 | ||
ports: | ||
- "8081:8081" | ||
environment: | ||
SPRING_PROFILES_ACTIVE: dev | ||
SERVER_PORT: 8081 | ||
MANAGEMENTPORTAL_FRONTEND_CLIENT_SECRET: "" | ||
MANAGEMENTPORTAL_COMMON_BASE_URL: http://localhost:8081 | ||
MANAGEMENTPORTAL_COMMON_MANAGEMENT_PORTAL_BASE_URL: http://localhost:8081 | ||
MANAGEMENTPORTAL_OAUTH_CLIENTS_FILE: /mp-includes/config/oauth_client_details.csv | ||
MANAGEMENTPORTAL_CATALOGUE_SERVER_ENABLE_AUTO_IMPORT: 'false' | ||
JAVA_OPTS: -Xmx256m # maximum heap size for the JVM running ManagementPortal, increase this as necessary | ||
volumes: | ||
- ./etc/managementportal/:/mp-includes/config/ |
44 changes: 44 additions & 0 deletions
44
src/main/java/org/radarbase/authorizer/config/ConfigHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.radarbase.authorizer.config; | ||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import com.fasterxml.jackson.databind.DeserializationFeature; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.PropertyNamingStrategy; | ||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; | ||
import com.fasterxml.jackson.dataformat.yaml.YAMLParser; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import javax.naming.ConfigurationException; | ||
import javax.validation.constraints.NotNull; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class ConfigHelper { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigHelper.class); | ||
|
||
public static <T> T loadPropertiesFromFile(@NotNull String path, | ||
@NotNull TypeReference<T> typeReference) | ||
throws ConfigurationException { | ||
LOGGER.info("Loading config from {}", path); | ||
YAMLFactory yamlFactory = new YAMLFactory(); | ||
try { | ||
YAMLParser yamlParser = yamlFactory.createParser(new File(path)); | ||
T properties = new ObjectMapper(yamlFactory) | ||
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) | ||
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE) | ||
.readValue(yamlParser, typeReference); | ||
|
||
if (properties == null) { | ||
LOGGER.error("No valid configurations available on configured path. Please " | ||
+ "check the syntax and file name"); | ||
throw new ConfigurationException( | ||
"No valid configs are provided" + "."); | ||
} | ||
return properties; | ||
} catch (IOException e) { | ||
LOGGER.error("Could not successfully read config file at {}", path); | ||
throw new ConfigurationException("Could not successfully read config file at " + path); | ||
} | ||
} | ||
} |
Oops, something went wrong.