Calling the Kernel from our auth server
To call our kernel we now must add the core feature because our cache interface relies on the get user in the core. This means that our auth Cargo.toml
must be updated with the following:
# nanoservices/auth/networking/actix_server/Cargo.toml
. . .
[dependencies]
. . .
auth-kernel = {
path = "../../kernel",
features = ["auth-core"],
default-features = false
}
Now if we had a less structured approach where we combine the HTTP code with the core code in one app, there would be a circular dependency. This circular dependency would arise from the auth kernel pulling from the auth server, and then the auth server requiring the auth kernel for the Redis interface. However, because we have kept our system isolated and concerned with only the scope they are built for. This has led to the layout shown in Figure 12.1.

This is where the value of our structure is strongly demonstrated...