Decree.Middleware.CommandId (decree v0.1.0)

Copy Markdown View Source

An internal Decree.Middleware that refuses a command whose command_id is not a lowercase canonical UUID.

It is a default middleware, like Decree.Middleware.ExtractAggregateIdentity: it runs after every middleware a router registers and before the identity is extracted, on an aggregate route and a decision route alike. It answers Decree.Command.check_id/1 on the command's :command_id field, a missing field being nil, and halts on a refusal, so no aggregate is opened and no decision runs. It never reads the dispatch's command_uuid, and never writes the command.

Summary

Functions

after_dispatch(pipeline)

Callback implementation for Decree.Middleware.after_dispatch/1.

after_failure(pipeline)

Callback implementation for Decree.Middleware.after_failure/1.

before_dispatch(pipeline)

Callback implementation for Decree.Middleware.before_dispatch/1.