-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4654 from planetf1/backport_pr4651
Release 2.6 - Backport pr4651
- Loading branch information
Showing
8 changed files
with
108 additions
and
34 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
70 changes: 70 additions & 0 deletions
70
.../main/java/org/odpi/openmetadata/userinterface/uichassis/springboot/auth/TokenClient.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,70 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 */ | ||
/* Copyright Contributors to the ODPi Egeria project. */ | ||
package org.odpi.openmetadata.userinterface.uichassis.springboot.auth; | ||
|
||
/** | ||
* TokenOption is used to have statefull webtoken by using persistence and expiration validation | ||
*/ | ||
public interface TokenClient { | ||
|
||
/** | ||
* shut down client connection | ||
*/ | ||
default void shutdownClient(){}; | ||
|
||
/** | ||
* | ||
* @param token the token | ||
* @param seconds for absolute timeout | ||
* @param expiration representation of expiration | ||
* @return the persistence response | ||
*/ | ||
default String set(String token, long seconds, String expiration){ | ||
return null; | ||
}; | ||
|
||
/** | ||
* | ||
* @param token the token | ||
* @param expiration representation of expiration | ||
* @return the persistence response | ||
*/ | ||
default String set(String token, String expiration){ | ||
return null; | ||
}; | ||
|
||
/** | ||
* Used to postpone expiration but keep existing absolute timeout | ||
* @param token the token | ||
* @param expiration representation of expiration | ||
* @return the persistence response | ||
*/ | ||
default String setKeepTTL(String token, String expiration){ | ||
return null; | ||
}; | ||
|
||
|
||
/** | ||
* retrieve expiration from persistence | ||
* @param token the token | ||
* @return expiration or null if token doesn't exist | ||
*/ | ||
default String get(String token){ | ||
return null; | ||
}; | ||
|
||
/** | ||
* retrieve the absolute timeout of token in seconds | ||
* @param token the token to determine ttl for | ||
* @return the ttl for the token | ||
*/ | ||
default Long ttl(String token){ | ||
return null; | ||
}; | ||
|
||
/** | ||
* | ||
* @param tokens the tokens to be removed from persistence | ||
*/ | ||
default void del(String... tokens){ }; | ||
} |
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