Building our cache Kernel
For our Cargo.toml file, we add the following dependency:
# nanoservices/auth/kernel/Cargo.toml
[dependencies]
. . .
cache-client = { path = "../../user-session-cache/cache-client" }
Because we are now so used to this pattern, we can rifle through our initial setup. You might even be able to configure this yourself. If you have tried to configure the user session module, you should have the following:
Your lib.rs file:
// nanoservices/auth/kernel/src/lib.rs
pub mod api;
#[cfg(any(feature = "auth-core", feature = "reqwest"))]
pub mod user_session;
The user_session module is public under the features auth-core and reqwest because we are going to rely on getting the user from the database. Getting a user from the database requires either the auth-core or reqwest feature. The mod.rs file of the user session module:
// nanoservices/auth/kernel/src/user_session/mod.rs
pub mod transactions;
pub mod descriptors;
pub mod schema;
The...