-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jans-auth-server): added status list update on revoke
#8562 Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>
- Loading branch information
Showing
5 changed files
with
87 additions
and
21 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
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
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
34 changes: 34 additions & 0 deletions
34
jans-core/service/src/main/java/io/jans/model/tokenstatus/TokenStatus.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,34 @@ | ||
package io.jans.model.tokenstatus; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author Yuriy Z | ||
*/ | ||
public enum TokenStatus { | ||
CREATED(0), | ||
REVOKED(1); | ||
|
||
private final int value; | ||
|
||
private static Map<Integer, TokenStatus> mapByValues = new HashMap<>(); | ||
|
||
static { | ||
for (TokenStatus enumType : values()) { | ||
mapByValues.put(enumType.getValue(), enumType); | ||
} | ||
} | ||
|
||
TokenStatus(int value) { | ||
this.value = value; | ||
} | ||
|
||
public int getValue() { | ||
return value; | ||
} | ||
|
||
public static TokenStatus fromValue(int value) { | ||
return mapByValues.get(value); | ||
} | ||
} |