'How to handle authentication to adapters on a Hexagonal Architecture
I'm building an application for work using a hexagonal architecture and I have an entity (in the core layer) called CompanySetup. When my system receives a request I call my business service which calls a CompanySetupRepository (interface defined in the core layer). In the adapters layers, I've defined the CompanySetupRepository which calls the setup microservice to get the setup and returns to the caller (it's an external data repository). My question is that the setup microservice requires authentication to generate a token, I've decided to put the authentication in every method of my repository implementation (adapters layer). But, since I'm using inversion of control, in which layer should I put the SetupAuthentication - interface - in the core or in the adapters layer?
The same problem I face with encryption code, where should It live? in the Core or adapter layer?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
