-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/oxTrust/issues/#815'
- Loading branch information
Showing
7 changed files
with
252 additions
and
13 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,50 @@ | ||
package org.gluu.oxtrust.model; | ||
|
||
public class Device { | ||
private String addedOn; | ||
|
||
private String id; | ||
|
||
private String nickName; | ||
|
||
|
||
public String getAddedOn() { | ||
return addedOn; | ||
} | ||
|
||
public void setAddedOn(String addedOn) { | ||
this.addedOn = addedOn; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public String getNickName() { | ||
return nickName; | ||
} | ||
|
||
public void setNickName(String nickName) { | ||
this.nickName = nickName; | ||
updateHash(); | ||
} | ||
|
||
public void updateHash() { | ||
|
||
if (nickName == null) { | ||
id = ""; | ||
} else { | ||
String str = nickName.replaceFirst("hotp:", "").replaceFirst("totp:", ""); | ||
int idx = str.indexOf(";"); | ||
if (idx > 0) { | ||
str = str.substring(0, idx); | ||
} | ||
id = str; | ||
} | ||
} | ||
|
||
} |
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
17 changes: 17 additions & 0 deletions
17
model/src/main/java/org/gluu/oxtrust/model/MobileDevice.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,17 @@ | ||
package org.gluu.oxtrust.model; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class MobileDevice { | ||
|
||
private ArrayList<Phone> phones; | ||
|
||
public ArrayList<Phone> getPhones() { | ||
return phones; | ||
} | ||
|
||
public void setPhones(ArrayList<Phone> phones) { | ||
this.phones = phones; | ||
} | ||
|
||
} |
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,17 @@ | ||
package org.gluu.oxtrust.model; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class OTPDevice { | ||
|
||
private ArrayList<Device> devices; | ||
|
||
public ArrayList<Device> getDevices() { | ||
return this.devices; | ||
} | ||
|
||
public void setDevices(ArrayList<Device> devices) { | ||
this.devices = devices; | ||
} | ||
|
||
} |
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,35 @@ | ||
package org.gluu.oxtrust.model; | ||
|
||
public class Phone { | ||
private String addedOn; | ||
|
||
private String number; | ||
|
||
private String nickName; | ||
|
||
public String getAddedOn() { | ||
return addedOn; | ||
} | ||
|
||
public void setAddedOn(String addedOn) { | ||
this.addedOn = addedOn; | ||
} | ||
|
||
public String getNumber() { | ||
return number; | ||
} | ||
|
||
public void setNumber(String number) { | ||
this.number = number; | ||
} | ||
|
||
public String getNickName() { | ||
return nickName; | ||
} | ||
|
||
public void setNickName(String nickName) { | ||
this.nickName = nickName; | ||
} | ||
|
||
|
||
} |
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