-
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 #91 from RADAR-base/release-2.0
Release 2.0
- Loading branch information
Showing
103 changed files
with
2,436 additions
and
3,476 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
# Change these settings to your own preference | ||
indent_style = space | ||
indent_size = 4 | ||
continuation_indent_size = 8 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{json,yaml,yml}] | ||
indent_style = space | ||
indent_size = 2 | ||
continuation_indent_size = 4 |
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 was deleted.
Oops, something went wrong.
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
File renamed without changes.
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,49 @@ | ||
#API Documentation | ||
|
||
## API documentation | ||
|
||
1. Request for authorized projects | ||
|
||
```bash | ||
GET /projects | ||
``` | ||
Response format | ||
```json | ||
{ | ||
"projects": [ | ||
{ | ||
"id": "test", | ||
"location": "test", | ||
"description": "test" | ||
} | ||
] | ||
} | ||
``` | ||
2. Request for project details by id | ||
```bash | ||
GET /projects/test | ||
``` | ||
Response format | ||
```json | ||
{ | ||
"id": "test", | ||
"location": "test", | ||
"description": "test" | ||
} | ||
``` | ||
3. Requests for subjects/participants of a project | ||
```bash | ||
GET /projects/test/users | ||
``` | ||
Response format | ||
```json | ||
{ | ||
"users": [ | ||
{ | ||
"id": "628277bb-239e-4137-9d15-9d8f6bb05618", | ||
"projectId": "test", | ||
"status": "ACTIVATED" | ||
} | ||
] | ||
} | ||
``` |
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,43 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM gradle:6.6.1-jdk11 as builder | ||
|
||
RUN mkdir /code | ||
WORKDIR /code | ||
ENV GRADLE_USER_HOME=/code/.gradlecache | ||
|
||
COPY ./build.gradle.kts ./settings.gradle.kts ./gradle.properties /code/ | ||
COPY authorizer-app-backend/build.gradle.kts /code/authorizer-app-backend/ | ||
RUN gradle :authorizer-app-backend:downloadDependencies | ||
|
||
COPY authorizer-app-backend/src /code/authorizer-app-backend/src | ||
|
||
RUN gradle -Dkotlin.compiler.execution.strategy="in-process" -Dorg.gradle.parallel=false -Pkotlin.incremental=false :authorizer-app-backend:distTar \ | ||
&& cd authorizer-app-backend/build/distributions \ | ||
&& tar xf *.tar \ | ||
&& rm *.tar authorizer-app-backend-*/lib/authorizer-app-backend-*.jar | ||
|
||
FROM openjdk:11-jre-slim | ||
|
||
MAINTAINER @nivemaham @blootsvoets | ||
|
||
LABEL description="RADAR-base rest sources authorizer backend application" | ||
|
||
COPY --from=builder /code/authorizer-app-backend/build/distributions/authorizer-app-backend-*/bin/* /usr/bin/ | ||
COPY --from=builder /code/authorizer-app-backend/build/distributions/authorizer-app-backend-*/lib/* /usr/lib/ | ||
COPY --from=builder /code/authorizer-app-backend/build/libs/authorizer-app-backend-*.jar /usr/lib/ | ||
|
||
EXPOSE 8085 | ||
|
||
CMD ["authorizer-app-backend"] | ||
|
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,28 @@ | ||
service: | ||
# Interval time in minutes for syncing projects and subjects. | ||
baseUri: http://0.0.0.0:8085/rest-sources/backend/ | ||
advertisedBaseUri: http://0.0.0.0:8080/rest-sources/backend/ | ||
enableCors: true | ||
|
||
auth: | ||
# Management Portal URL | ||
managementPortalUrl: https://radar-test.thehyve.net/managementportal/ | ||
# OAuth2 Client id of rest source auth application | ||
clientId: radar_rest_sources_auth | ||
# OAuth2 Client Secret of rest source auth client | ||
clientSecret: <MP_CLIENT_SECRET> | ||
|
||
database: | ||
driver: org.postgresql.Driver | ||
url: jdbc:postgresql://localhost:5432/managementportal | ||
user: radar | ||
password: radar_test | ||
dialect: org.hibernate.dialect.PostgreSQLDialect | ||
|
||
restSourceClients: | ||
- sourceType: FitBit | ||
authorizationEndpoint: https://www.fitbit.com/oauth2/authorize | ||
tokenEndpoint: https://api.fitbit.com/oauth2/token | ||
clientId: <CLIENT_ID> | ||
clientSecret: <CLIENT_SECRET> | ||
scope: activity heartrate sleep profile |
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,94 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
application | ||
kotlin("jvm") | ||
id("org.jetbrains.kotlin.plugin.noarg") | ||
id("org.jetbrains.kotlin.plugin.jpa") | ||
id("org.jetbrains.kotlin.plugin.allopen") | ||
} | ||
|
||
|
||
application { | ||
mainClassName = "org.radarbase.authorizer.MainKt" | ||
} | ||
|
||
project.extra.apply { | ||
set("okhttpVersion", "4.9.0") | ||
set("radarJerseyVersion", "0.4.2.1") | ||
set("jacksonVersion", "2.11.3") | ||
set("slf4jVersion", "1.7.30") | ||
set("logbackVersion", "1.2.3") | ||
set("jerseyVersion", "2.32") | ||
set("liquibaseVersion", "3.10.2") | ||
set("junitVersion", "5.7.0") | ||
set("mockitoKotlinVersion", "2.2.0") | ||
set("githubRepoName", "RADAR-base/RADAR-Rest-Source-Auth") | ||
set("githubUrl", "https://github.com/RADAR-base/RADAR-Rest-Source-Auth.git") | ||
set("issueUrl", "https://github.com/RADAR-base/RADAR-Rest-Source-Auth/issues") | ||
set("website", "http://radar-base.org") | ||
set("description", "RADAR Rest Source Authorizer handles authorization for data access from third party APIs for wearable devices or other connected sources.") | ||
} | ||
|
||
|
||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
maven(url = "https://dl.bintray.com/radar-base/org.radarbase") | ||
maven(url = "https://dl.bintray.com/radar-cns/org.radarcns") | ||
maven(url = "https://repo.thehyve.nl/content/repositories/snapshots") | ||
maven(url = "https://oss.jfrog.org/artifactory/libs-snapshot/") | ||
} | ||
|
||
dependencies { | ||
api(kotlin("stdlib-jdk8")) | ||
implementation(kotlin("reflect")) | ||
|
||
implementation("org.radarbase:radar-jersey:${project.extra["radarJerseyVersion"]}") | ||
implementation("org.radarbase:radar-jersey-hibernate:${project.extra["radarJerseyVersion"]}") | ||
|
||
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${project.extra["jacksonVersion"]}") | ||
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${project.extra["jacksonVersion"]}") | ||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:${project.extra["jacksonVersion"]}") | ||
|
||
implementation("org.slf4j:slf4j-api:${project.extra["slf4jVersion"]}") | ||
|
||
implementation("com.squareup.okhttp3:okhttp:${project.extra["okhttpVersion"]}") | ||
|
||
runtimeOnly("ch.qos.logback:logback-classic:${project.extra["logbackVersion"]}") | ||
|
||
testImplementation("org.junit.jupiter:junit-jupiter:${project.extra["junitVersion"]}") | ||
testImplementation("org.hamcrest:hamcrest-all:1.3") | ||
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:${project.extra["mockitoKotlinVersion"]}") | ||
|
||
testImplementation("org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:${project.extra["jerseyVersion"]}") | ||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
apiVersion = "1.4" | ||
languageVersion = "1.4" | ||
} | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
testLogging { | ||
events("passed", "skipped", "failed") | ||
} | ||
} | ||
|
||
allOpen { | ||
annotation("javax.persistence.Entity") | ||
annotation("javax.persistence.MappedSuperclass") | ||
annotation("javax.persistence.Embeddable") | ||
} | ||
|
||
tasks.register("downloadDependencies") { | ||
doLast { | ||
configurations["runtimeClasspath"].files | ||
configurations["compileClasspath"].files | ||
println("Downloaded all dependencies") | ||
} | ||
} |
Oops, something went wrong.