Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions CHANGES.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2.5.0 (2019-01-09)
=================

- Add support for `$failure_reason` to the `$login` event
- Add support for `$account_types` to the `$login` event
- Add support for `$username` to the `$login` event
- Add support for `$social_sign_on_type` to the `$login` event

2.4.0 (2018-10-24)
=================
- Add support for Rescore User and Get User Score APIs
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Java 1.7 or later.
<dependency>
<groupId>com.siftscience</groupId>
<artifactId>sift-java</artifactId>
<version>2.4.0</version>
<version>2.5.0</version>
</dependency>
```
### Gradle
```
dependencies {
compile 'com.siftscience:sift-java:2.4.0'
compile 'com.siftscience:sift-java:2.5.0'
}
```
### Other
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'signing'
apply plugin: 'java-library-distribution'

group = 'com.siftscience'
version = '2.4.0'
version = '2.5.0'
sourceCompatibility = 1.7
targetCompatibility = 1.7

Expand Down
36 changes: 36 additions & 0 deletions src/main/java/com/siftscience/model/LoginFieldSet.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.siftscience.model;

import java.util.List;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

Expand All @@ -9,6 +11,10 @@ public static LoginFieldSet fromJson(String json) {
}

@Expose @SerializedName("$login_status") private String loginStatus;
@Expose @SerializedName("$failure_reason") private String failureReason;
@Expose @SerializedName("$username") private String username;
@Expose @SerializedName("$social_sign_on_type") private String socialSignOnType;
@Expose @SerializedName("$account_types") private List<String> accountTypes;

@Override
public String getEventType() {
Expand All @@ -23,4 +29,34 @@ public LoginFieldSet setLoginStatus(String loginStatus) {
this.loginStatus = loginStatus;
return this;
}

public String getFailureReason() { return failureReason; }

public LoginFieldSet setFailureReason(String failureReason) {
this.failureReason = failureReason;
return this;
}

public String getUsername() { return username; }

public LoginFieldSet setUsername(String username) {
this.username = username;
return this;
}

public String getSocialSignOnType() { return socialSignOnType; }

public LoginFieldSet setSocialSignOnType(String socialSignOnType) {
this.socialSignOnType = socialSignOnType;
return this;
}

public List<String> getAccountTypes() {
return accountTypes;
}

public LoginFieldSet setAccountTypes(List<String> accountTypes) {
this.accountTypes = accountTypes;
return this;
}
}
15 changes: 13 additions & 2 deletions src/test/java/com/siftscience/LoginEventTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.siftscience;

import java.util.Arrays;
import java.util.List;

import com.siftscience.model.App;
import com.siftscience.model.Browser;
import com.siftscience.model.LoginFieldSet;
Expand Down Expand Up @@ -28,7 +31,11 @@ public void testLoginWithApp() throws Exception {
" \"$app\" : {\n" +
" \"$os\" : \"" + operatingSystem + "\",\n" +
" \"$app_name\" : \"" + appName + "\"\n" +
" }\n" +
" },\n" +
" \"$failure_reason\": \"$account_suspended\",\n" +
" \"$username\" : \"seattle_001\",\n" +
" \"$social_sign_on_type\" : \"$facebook\",\n" +
" \"$account_types\" : [\"merchant\", \"premium\"]\n" +
"}";

// Start a new mock server and enqueue a mock response.
Expand All @@ -55,7 +62,11 @@ public void testLoginWithApp() throws Exception {
.setLoginStatus("$success")
.setApp(new App()
.setOperatingSystem(operatingSystem)
.setAppName(appName)));
.setAppName(appName))
.setFailureReason("$account_suspended")
.setUsername("seattle_001")
.setSocialSignOnType("$facebook")
.setAccountTypes(Arrays.asList("merchant", "premium")));

SiftResponse siftResponse = request.send();

Expand Down