#ddd #ddd-cqrs-framework #hexagonal-arch

dddk_security

Security module of dddk_core. Impl features regarding command_bus pattern and security

5 releases (breaking)

0.6.0 Feb 21, 2024
0.4.0 Feb 3, 2022
0.3.0 Jan 26, 2022
0.2.0 Jan 23, 2022
0.1.1 Jan 22, 2022

#766 in Rust patterns

Download history 117/week @ 2024-02-19 18/week @ 2024-02-26 1/week @ 2024-03-04 11/week @ 2024-03-11 69/week @ 2024-04-01

80 downloads per month

Apache-2.0

165KB
3.5K SLoC

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.

Dependencies

~87KB