@@ -81,7 +81,7 @@ impl Facade {
81
81
/// # Errors
82
82
///
83
83
/// Will return a `key::Error` if unable to get any `auth_key`.
84
- async fn verify_auth_key ( & self , key : & Key ) -> Result < ( ) , Error > {
84
+ pub async fn verify_auth_key ( & self , key : & Key ) -> Result < ( ) , Error > {
85
85
match self . keys . read ( ) . await . get ( key) {
86
86
None => Err ( Error :: UnableToReadKey {
87
87
location : Location :: caller ( ) ,
@@ -268,10 +268,17 @@ impl Facade {
268
268
/// Will return a `database::Error` if unable to remove the `key` to the database.
269
269
pub async fn remove_auth_key ( & self , key : & Key ) -> Result < ( ) , databases:: error:: Error > {
270
270
self . database . remove_key_from_keys ( key) ?;
271
- self . keys . write ( ) . await . remove ( key ) ;
271
+ self . remove_in_memory_auth_key ( key ) . await ;
272
272
Ok ( ( ) )
273
273
}
274
274
275
+ /// It removes an authentication key from memory.
276
+ ///
277
+ /// # Context: Authentication
278
+ pub async fn remove_in_memory_auth_key ( & self , key : & Key ) {
279
+ self . keys . write ( ) . await . remove ( key) ;
280
+ }
281
+
275
282
/// The `Tracker` stores the authentication keys in memory and in the database.
276
283
/// In case you need to restart the `Tracker` you can load the keys from the database
277
284
/// into memory with this function. Keys are automatically stored in the database when they
0 commit comments