TF-886 Add encryption cipher for token oidc in hive database
This commit is contained in:
@@ -98,10 +98,14 @@ class TokenOidcCacheClient extends HiveCacheClient<TokenOidcCache> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Box<TokenOidcCache>> openBox() async {
|
Future<Box<TokenOidcCache>> openBox() async {
|
||||||
if (Hive.isBoxOpen(tableName)) {
|
return Future.sync(() async {
|
||||||
return Hive.box<TokenOidcCache>(tableName);
|
final encryptionKey = await getEncryptionKey();
|
||||||
}
|
return Hive.openBox<TokenOidcCache>(
|
||||||
return Hive.openBox<TokenOidcCache>(tableName);
|
tableName,
|
||||||
|
encryptionCipher: HiveAesCipher(encryptionKey!));
|
||||||
|
}).catchError((error) {
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user