Skip to content

Commit dbb97ba

Browse files
authored
Merge pull request #400 from RADAR-base/additional_oura_schemas
Added Additional Oura schemas
2 parents 3db3171 + 5d81c3a commit dbb97ba

File tree

13 files changed

+191
-82
lines changed

13 files changed

+191
-82
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Snyk scheduled Docker base image scan
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * 1'
6+
workflow_dispatch:
7+
8+
env:
9+
DOCKER_IMAGE: radarbase/radar-schemas-tools
10+
11+
jobs:
12+
security:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Run Snyk to check for vulnerabilities
19+
continue-on-error: true # To make sure that SARIF upload gets called
20+
uses: snyk/actions/docker@master
21+
env:
22+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
23+
with:
24+
image: ${{ env.DOCKER_IMAGE }}
25+
# 'exclude-app-vulns' only tests vulnerabilities in the base image.
26+
# Code base vulnerabilities are tested the scheduled-snyk.yaml action.
27+
args: >-
28+
--file=Dockerfile
29+
--fail-on=upgradable
30+
--severity-threshold=high
31+
--policy-path=.snyk
32+
--exclude-app-vulns
33+
--org=radar-base
34+
--sarif-file-output=snyk.sarif
35+
36+
# Detected vulnerabilities will appear on Github in Security->Code_scanning_alerts tab
37+
- name: Upload result to GitHub Code Scanning
38+
uses: github/codeql-action/upload-sarif@v3
39+
with:
40+
sarif_file: snyk.sarif

.github/workflows/scheduled-snyk.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Snyk scheduled code base scan
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * 1'
6+
workflow_dispatch:
7+
8+
jobs:
9+
security:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Run Snyk to check for vulnerabilities
16+
uses: snyk/actions/gradle-jdk17@master
17+
continue-on-error: true # To make sure that SARIF upload gets called
18+
env:
19+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
20+
with:
21+
args: >-
22+
--all-projects
23+
--configuration-matching='^runtimeClasspath$'
24+
--fail-on=upgradable
25+
--severity-threshold=high
26+
--policy-path=.snyk
27+
--org=radar-base
28+
--sarif-file-output=snyk.sarif
29+
30+
# Detected vulnerabilities will appear on Github in Security->Code_scanning_alerts tab
31+
- name: Upload result to GitHub Code Scanning
32+
uses: github/codeql-action/upload-sarif@v3
33+
with:
34+
sarif_file: snyk.sarif

.github/workflows/scheduled_snyk.yaml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/snyk.yaml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
1-
name: Snyk test
1+
name: Snyk test on PR commits
2+
23
on:
34
pull_request:
45
branches:
5-
- master
6+
- main
7+
- dev
8+
- release-*
69

710
jobs:
811
security:
912
runs-on: ubuntu-latest
10-
11-
defaults:
12-
run:
13-
working-directory: java-sdk
14-
1513
steps:
1614
- uses: actions/checkout@v3
17-
- uses: snyk/actions/setup@master
18-
with:
19-
snyk-version: v1.1032.0
20-
21-
- uses: actions/setup-java@v3
22-
with:
23-
distribution: temurin
24-
java-version: 17
25-
26-
- name: Setup Gradle
27-
uses: gradle/gradle-build-action@v2
2815

2916
- name: Run Snyk to check for vulnerabilities
17+
uses: snyk/actions/gradle-jdk17@master
3018
env:
3119
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
32-
run: >
33-
snyk test
34-
--all-sub-projects
35-
--configuration-matching='^runtimeClasspath$'
36-
--org=radar-base
37-
--policy-path=.snyk
38-
--json-file-output=snyk.json
39-
--severity-threshold=high
20+
with:
21+
args: >-
22+
--all-projects
23+
--configuration-matching="^runtimeClasspath$"
24+
--severity-threshold=high
25+
--fail-on=upgradable
26+
--org=radar-base
27+
--policy-path=.snyk

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ out/
88
exchange.properties
99
*.class
1010
/doc/
11+
.vscode/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"namespace": "org.radarcns.connector.oura",
3+
"name": "OuraDailyCardiovascularAge",
4+
"type": "record",
5+
"doc": "This includes the daily cardiovascular age data from Oura. Cardiovascular age represents the estimated age of your cardiovascular system based on various health metrics.",
6+
"fields": [
7+
{"name": "time", "type": "double", "doc": "Time the cardiovascular age record belongs to in seconds since January 1, 1970, 00:00:00 UTC (Unix timestamp)."},
8+
{"name": "timeReceived", "type": "double", "doc": "Time that this record was collected by a service in seconds since the Unix Epoch (s)."},
9+
{"name": "id", "type": ["null", "string"], "doc": "Unique identifier of the cardiovascular age data from Oura.", "default": null},
10+
{"name": "day", "type": ["null", "string"], "doc": "Day that the cardiovascular age data belongs to in YYYY-MM-DD format. Null if unknown.", "default": null},
11+
{"name": "vascularAge", "type": ["null", "int"], "doc": "The estimated cardiovascular/vascular age in years. Null if unknown.", "default": null}
12+
]
13+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"namespace": "org.radarcns.connector.oura",
3+
"name": "OuraDailyResilience",
4+
"type": "record",
5+
"doc": "This includes the daily resilience data from Oura. Resilience is a measure of how well your body is managing stress and recovering from challenges, based on sleep recovery, daytime recovery, and stress levels.",
6+
"fields": [
7+
{"name": "time", "type": "double", "doc": "Time the resilience record belongs to in seconds since January 1, 1970, 00:00:00 UTC (Unix timestamp)."},
8+
{"name": "timeReceived", "type": "double", "doc": "Time that this record was collected by a service in seconds since the Unix Epoch (s)."},
9+
{"name": "id", "type": ["null", "string"], "doc": "Unique identifier of the resilience data from Oura.", "default": null},
10+
{"name": "day", "type": ["null", "string"], "doc": "Day that the resilience data belongs to in YYYY-MM-DD format. Null if unknown.", "default": null},
11+
{"name": "contributorSleepRecovery", "type": ["null", "float"], "doc": "Sleep recovery contribution to resilience score. Null if unknown.", "default": null},
12+
{"name": "contributorDaytimeRecovery", "type": ["null", "float"], "doc": "Daytime recovery contribution to resilience score. Null if unknown.", "default": null},
13+
{"name": "contributorStress", "type": ["null", "float"], "doc": "Stress contribution to resilience score. Null if unknown.", "default": null},
14+
{"name": "level", "type": {
15+
"name": "OuraResilienceLevel",
16+
"type": "enum",
17+
"symbols": ["LIMITED", "ADEQUATE", "SOLID", "STRONG", "EXCEPTIONAL", "UNKNOWN"],
18+
"doc": "Resilience level categories as computed by Oura."
19+
}, "doc": "Overall resilience level for the day. UNKNOWN when this data is not provided.", "default": "UNKNOWN"}
20+
]
21+
}

commons/connector/oura/oura_daily_spo2.avsc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
{"name": "timeReceived", "type": "double", "doc": "Time that this record was collected by a service in seconds since the Unix Epoch (s)."},
99
{"name": "id", "type": ["null", "string"], "doc": "Unique identifier of the spO2 data from Oura.", "default": null},
1010
{"name": "spo2AveragePercentage", "type": ["null", "float"], "doc": "The average oxygen saturation percentage value over a single day.", "default": null},
11-
{"name": "day", "type": ["null", "string"], "doc": "Day that the daily oxygen saturation data belongs to. Null if unknown.", "default": null}
11+
{"name": "day", "type": ["null", "string"], "doc": "Day that the daily oxygen saturation data belongs to. Null if unknown.", "default": null},
12+
{"name": "breathingDisturbanceIndex", "type": ["null", "int"], "doc": "The breathing disturbance index which indicates sleep breathing disturbances. Null if unknown.", "default": null}
1213
]
1314
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"namespace": "org.radarcns.connector.oura",
3+
"name": "OuraDailyStress",
4+
"type": "record",
5+
"doc": "This includes the daily stress summary values includes a summary of the number of minutes the user spends in high stress and high recovery each day.",
6+
"fields": [
7+
{"name": "time", "type": "double", "doc": "Start time of the stress period in seconds since January 1, 1970, 00:00:00 UTC (Unix timestamp)."},
8+
{"name": "timeReceived", "type": "double", "doc": "Time that this record was collected by a service in seconds since the Unix Epoch (s)."},
9+
{"name": "id", "type": ["null", "string"], "doc": "Unique identifier of the stress data from Oura.", "default": null},
10+
{"name": "day", "type": ["null", "string"], "doc": "Day that the daily stress data belongs to in YYYY-MM-DD format. Null if unknown.", "default": null},
11+
{"name": "stressHigh", "type": ["null", "int"], "doc": "The number of minutes the user spends in high stress each day. Null if unknown.", "default": null},
12+
{"name": "recoveryHigh", "type": ["null", "int"], "doc": "The number of minutes the user spends in high recovery each day. Null if unknown.", "default": null},
13+
{"name": "daySummary", "type": ["null", {
14+
"name": "OuraDaySummaryType",
15+
"type": "enum",
16+
"symbols": ["NORMAL", "STRESSFUL", "RESTORED", "UNKNOWN"],
17+
"doc": "Summary of the daily stress levels."
18+
}], "doc": "Summary of the daily stress levels. Null if unknown.", "default": null}
19+
]
20+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"namespace": "org.radarcns.connector.oura",
3+
"name": "OuraEnhancedTag",
4+
"type": "record",
5+
"doc": "This describes the tags with added metadata that are added for any lifestyle choice, habit, mood change, or environmental factor an Oura user wants to monitor the effects of.",
6+
"fields": [
7+
{"name": "time", "type": "double", "doc": "Start time of the enhanced tag in seconds since January 1, 1970, 00:00:00 UTC (Unix timestamp)."},
8+
{"name": "timeReceived", "type": "double", "doc": "Time that this record was collected by a service in seconds since the Unix Epoch (s)."},
9+
{"name": "id", "type": ["null", "string"], "doc": "Unique identifier of the enhanced tag from Oura.", "default": null},
10+
{"name": "tagTypeCode", "type": ["null", "string"], "doc": "The tag type code that categorizes the enhanced tag (e.g., 'tag_generic_nocaffeine', 'tag_generic_outdoors', 'tag_generic_relaxed').", "default": null},
11+
{"name": "tagStartTime", "type": ["null", "double"], "doc": "Start time of the enhanced tag in seconds since January 1, 1970, 00:00:00 UTC (Unix timestamp). Null if the tag doesn't have a start time.", "default": null},
12+
{"name": "tagEndTime", "type": ["null", "double"], "doc": "End time of the enhanced tag in seconds since January 1, 1970, 00:00:00 UTC (Unix timestamp). Null if the tag doesn't have an end time.", "default": null},
13+
{"name": "startDay", "type": ["null", "string"], "doc": "Start date of the enhanced tag in YYYY-MM-DD format. Null if unknown.", "default": null},
14+
{"name": "endDay", "type": ["null", "string"], "doc": "End date of the enhanced tag in YYYY-MM-DD format. Null if the tag doesn't have an end date.", "default": null},
15+
{"name": "comment", "type": ["null", "string"], "doc": "User comment or note associated with the enhanced tag. Null if no comment provided.", "default": null},
16+
{"name": "customName", "type": ["null", "string"], "doc": "Custom name assigned by the user to the enhanced tag. Null if no custom name provided.", "default": null}
17+
]
18+
}

0 commit comments

Comments
 (0)