dddk_security

Crates.iodddk_security
lib.rsdddk_security
version0.6.0
sourcesrc
created_at2022-01-22 13:26:34.511327
updated_at2024-02-21 22:27:54.184069
descriptionSecurity module of dddk_core. Impl features regarding command_bus pattern and security
homepagehttps://github.com/jultabary/4dk-core
repository
max_upload_size
id519148
size70,866
Julien Tabary (jultabary)

documentation

https://github.com/jultabary/4dk-core/tree/main/rust/project/core-rust

README

4dk-security

The lib extends core behaviour with security features.
It implements the entites : SecuredCommand, SecuredQuery, SecuredCommandHandler, SecuredQueryHandler, SecuredCommandDispatcher, SecuredQueryDispatcher.

Command

SecuredCommand

Extends Command by decoration. SecuredCommand has to be constructed with user roles.

SecuredCommandHandler

Extends CommandHandler by decoration. SecuredHandler is defined with a permission.

SecuredCommandDispatcher

Replace the CommandDispatcher implementation from core-rust.
When a command is dispatch to the CommandBus, it will replaces (with RoleReadRepository impl) user roles by its permissions. Then it will check if user command has the permission to call the handler.

Query

SecuredQuery

Extends Query by decoration. SecuredQuery has to be constructed with user roles.

SecuredQueryHandler

Extends QueryHandler by decoration. SecuredHandler is defined with a permission.

SecuredQueryDispatcher

Replace the QueryDispatcher implementation from core-rust.
When a query is dispatch to the QueryBus, it will replaces (with RoleReadRepository impl) user roles by its permissions. Then it will check if user query has the permission to call the handler.



You can find in samples different bus composition.

Commit count: 0

cargo fmt