Skip to content

Commit 44e6f1b

Browse files
Merge pull request #76 from RADAR-base/release-0.3.3
Release 0.3.3
2 parents 9cb55d8 + 278edc2 commit 44e6f1b

File tree

13 files changed

+36
-47
lines changed

13 files changed

+36
-47
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ COPY ./kafka-connect-fitbit-source/src/ /code/kafka-connect-fitbit-source/src
4040

4141
RUN ./gradlew jar
4242

43-
FROM confluentinc/cp-kafka-connect-base:5.5.0
43+
FROM confluentinc/cp-kafka-connect-base:5.5.2
4444

4545
MAINTAINER Joris Borgdorff <[email protected]>
4646

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ If the ManagementPortal is used to authenticate against the user repository, ple
9393
```
9494
Client ID: fitbit.user.repository.client.id
9595
Client Secret: fitbit.user.repository.client.secret
96-
Scope: SUBJECT.READ
96+
Scope: SUBJECT.READ MEASUREMENT.CREATE
9797
Resources: res_restAuthorizer
9898
Grant types: client_credentials
9999
Access Token validity: 600

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ description = 'kafka-connect-rest-source'
22

33
subprojects {
44
ext {
5-
kafkaVersion = '2.5.0'
6-
confluentVersion = '5.5.0'
7-
jacksonVersion = '2.11.0'
5+
kafkaVersion = '2.5.1'
6+
confluentVersion = '5.5.2'
7+
jacksonVersion = '2.11.3'
88
}
99

1010
apply plugin: 'java'
1111
apply plugin: 'java-library'
1212

1313
group = 'org.radarbase'
14-
version = '0.3.2'
14+
version = '0.3.3'
1515

1616
sourceCompatibility = 1.8
1717
targetCompatibility = 1.8
@@ -27,7 +27,7 @@ subprojects {
2727
}
2828

2929
wrapper {
30-
gradleVersion '6.4.1'
30+
gradleVersion '6.6.1'
3131
}
3232

3333
evaluationDependsOnChildren()

gradle/wrapper/gradle-wrapper.jar

293 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fi
130130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133-
133+
134134
JAVACMD=`cygpath --unix "$JAVACMD"`
135135

136136
# We build the pattern for arguments to be converted via cygpath

gradlew.bat

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4040

4141
set JAVA_EXE=java.exe
4242
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4444

4545
echo.
4646
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
5454
set JAVA_HOME=%JAVA_HOME:"=%
5555
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5656

57-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5858

5959
echo.
6060
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,29 +64,14 @@ echo location of your Java installation.
6464

6565
goto fail
6666

67-
:init
68-
@rem Get command-line arguments, handling Windows variants
69-
70-
if not "%OS%" == "Windows_NT" goto win9xME_args
71-
72-
:win9xME_args
73-
@rem Slurp the command line arguments.
74-
set CMD_LINE_ARGS=
75-
set _SKIP=2
76-
77-
:win9xME_args_slurp
78-
if "x%~1" == "x" goto execute
79-
80-
set CMD_LINE_ARGS=%*
81-
8267
:execute
8368
@rem Setup the command line
8469

8570
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8671

8772

8873
@rem Execute Gradle
89-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
9075

9176
:end
9277
@rem End local scope for the variables with windows NT shell

kafka-connect-fitbit-source/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
dependencies {
22
api project(':kafka-connect-rest-source')
33
api group: 'io.confluent', name: 'kafka-connect-avro-converter', version: confluentVersion
4-
api group: 'org.radarcns', name: 'radar-schemas-commons', version: '0.5.3'
4+
api group: 'org.radarcns', name: 'radar-schemas-commons', version: '0.5.14'
55

6-
implementation group: 'org.radarcns', name: 'oauth-client-util', version: '0.5.8'
6+
implementation group: 'org.radarcns', name: 'oauth-client-util', version: '0.6.0'
77

88
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: jacksonVersion
99
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: jacksonVersion
10-
implementation 'com.google.firebase:firebase-admin:6.12.2'
10+
implementation 'com.google.firebase:firebase-admin:6.16.0'
1111

1212
// Included in connector runtime
1313
compileOnly group: 'org.apache.kafka', name: 'connect-api', version: kafkaVersion
1414
compileOnly group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonVersion
1515

16-
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.4.2'
17-
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.4.2'
18-
testRuntimeOnly group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.26'
16+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.6.2'
17+
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.6.2'
18+
testRuntimeOnly group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.30'
1919
testImplementation group: 'org.apache.kafka', name: 'connect-api', version: kafkaVersion
2020
}
2121

kafka-connect-fitbit-source/src/main/java/org/radarbase/connect/rest/fitbit/user/LocalUser.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,19 @@ public class LocalUser implements User {
3535
private static final Pattern ILLEGAL_CHARACTERS_PATTERN = Pattern.compile("[^a-zA-Z0-9_-]");
3636
private String id;
3737
private String version;
38-
private String externalUserId;
3938
private String projectId;
4039
private String userId;
4140
private String sourceId;
4241
private Instant startDate = Instant.parse("2017-01-01T00:00:00Z");
4342
private Instant endDate = Instant.parse("9999-12-31T23:59:59.999Z");
4443

44+
@JsonProperty("serviceUserId")
45+
private String serviceUserId;
46+
4547
@JsonProperty("oauth2")
4648
private OAuth2UserCredentials oauth2Credentials = new OAuth2UserCredentials();
4749

48-
@JsonProperty("authorized")
50+
@JsonProperty("isAuthorized")
4951
private Boolean isAuthorized;
5052

5153
@JsonIgnore
@@ -62,7 +64,7 @@ public void setId(String id) {
6264
}
6365

6466
public String getExternalUserId() {
65-
return externalUserId;
67+
return serviceUserId;
6668
}
6769

6870
public String getProjectId() {
@@ -95,7 +97,7 @@ public void setOauth2Credentials(OAuth2UserCredentials oauth2Credentials) {
9597

9698
@JsonSetter("fitbitUserId")
9799
public void setFitbitUserId(String id) {
98-
this.externalUserId = id;
100+
this.serviceUserId = id;
99101
}
100102

101103
@Override
@@ -120,7 +122,7 @@ public LocalUser copy() {
120122
LocalUser copy = new LocalUser();
121123
copy.id = id;
122124
copy.version = version;
123-
copy.externalUserId = externalUserId;
125+
copy.serviceUserId = serviceUserId;
124126
copy.projectId = projectId;
125127
copy.userId = userId;
126128
copy.startDate = startDate;
@@ -142,7 +144,7 @@ public synchronized SchemaAndValue getObservationKey(AvroData avroData) {
142144
public String toString() {
143145
return "LocalUser{id='" + id + '\''
144146
+ ", version='" + version + '\''
145-
+ ", externalUserId='" + externalUserId + '\''
147+
+ ", externalUserId='" + serviceUserId + '\''
146148
+ ", projectId='" + projectId + '\''
147149
+ ", userId='" + userId + '\''
148150
+ ", sourceId='" + sourceId + '\''
@@ -161,7 +163,7 @@ public boolean equals(Object o) {
161163
LocalUser localUser = (LocalUser) o;
162164
return Objects.equals(id, localUser.id)
163165
&& Objects.equals(version, localUser.version)
164-
&& Objects.equals(externalUserId, localUser.externalUserId)
166+
&& Objects.equals(serviceUserId, localUser.serviceUserId)
165167
&& Objects.equals(projectId, localUser.projectId)
166168
&& Objects.equals(userId, localUser.userId)
167169
&& Objects.equals(sourceId, localUser.sourceId)

kafka-connect-fitbit-source/src/main/java/org/radarbase/connect/rest/fitbit/user/ServiceUserRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class ServiceUserRepository implements UserRepository {
5959
private static final ObjectReader USER_READER = JSON_READER.forType(User.class);
6060
private static final ObjectReader OAUTH_READER = JSON_READER.forType(OAuth2UserCredentials.class);
6161
private static final RequestBody EMPTY_BODY =
62-
RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "");
62+
RequestBody.create("", MediaType.parse("application/json; charset=utf-8"));
6363
private static final Duration FETCH_THRESHOLD = Duration.ofMinutes(1L);
6464

6565
private final OkHttpClient client;
@@ -101,7 +101,7 @@ public void initialize(RestSourceConnectorConfig config) {
101101
this.repositoryClient = new OAuth2Client.Builder()
102102
.credentials(clientId, clientSecret)
103103
.endpoint(tokenUrl)
104-
.scopes("SUBJECT.READ")
104+
.scopes("SUBJECT.READ MEASUREMENT.CREATE")
105105
.httpClient(client)
106106
.build();
107107
} else if (clientId != null) {

0 commit comments

Comments
 (0)