Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to put security when using DDD - domain driven design

As title is suggesting, I am interested in general opinion on where is the best to put all security related code(like code for JWT, standard authentication, etc.)

I am thinking about it quite a while and I do not have a clue what should be suitable place for this.

Does somebody has any experience with this. What is for you correct place for this, according to DDD?

like image 388
nemo_87 Avatar asked Sep 05 '16 13:09

nemo_87


People also ask

What is DDD in security?

Amongst the techniques introduced to manage the complexity of the application development process is Domain-driven design (DDD). DDD prescribes a specific application of separation of concerns to the application model into a domain model and DDD-services.

Why there is a need for domain driven design DDD )?

Domain-Driven Design(DDD) is a collection of principles and patterns that help developers craft elegant object systems. Properly applied it can lead to software abstractions called domain models. These models encapsulate complex business logic, closing the gap between business reality and code.

Is domain driven design still relevant?

Domain-driven design (DDD) is a useful approach that provides excellent guidelines for modeling and building systems, but it is a means to an end, not an end in itself. While the concepts are valid, you lose a lot if you limit yourself to using them only: There actually is a life beyond DDD.

Where is domain driven design used?

Domain-driven design is perfect for applications that have complex business logic. However, it might not be the best solution for applications with minor domain complexity but high technical complexity. Applications with great technical complexity can be very challenging for business-oriented domain experts.


1 Answers

As mentioned by @inf3rno in Access Control in Domain Driven Design, Vaughn Vernon briefly touches upon this in his book Implementing Domain-Driven Design.

Security and permissions should be centralized in its own bounded context, which is then used by other bounded contexts. Have a look at the Identity Access bounded context for inspiration, but I recommend following Schneier's Law, which states that you should not build your own security system.

like image 68
Martin4ndersen Avatar answered Sep 28 '22 06:09

Martin4ndersen