Mediator operating modes
You can configure your DIDComm Mediator to operate in different modes based on how you want it to handle messages and interactions between participants.
An Affinidi-hosted mediator lets you choose only its Mediator ACL mode, when you create it on Affinidi Portal. The full set of options on this page needs a self-hosted mediator.
To configure the mediator-level Access Control Lists (ACLs), edit the [security] section of conf/mediator.toml on the server hosting the mediator, then restart the mediator. You can also set each value with an environment variable, which overrides the file: MEDIATOR_ACL_MODE, GLOBAL_DEFAULT_ACL, and LOCAL_DIRECT_DELIVERY_ALLOWED.
The mediator ships with mediator_acl_mode = "explicit_deny", global_acl_default = "DENY_ALL,LOCAL,SEND_MESSAGES,RECEIVE_MESSAGES", and local_direct_delivery_allowed = "true".
Private mediator – closed network
The strictest and most controlled mediator configuration.
It creates a private messaging network where users can only communicate with authorised contacts defined by the administrator. The mediator rejects any DID it does not know, so an administrator registers each user’s DID with the messaging/account/add Trust Task and sets who may message whom with messaging/access-list/update.
Example: A business running a private network for staff working on a confidential merger. With access lists set by the administrator, Alice and Bob can message their manager but cannot message each other.
[security]
mediator_acl_mode = "explicit_allow"
global_acl_default = "DENY_ALL,LOCAL,SEND_MESSAGES,RECEIVE_MESSAGES"
local_direct_delivery_allowed = "true"Private mediator – open network
An internal network where users can freely communicate within the company. Each user’s DID must still be registered by the administrator with the messaging/account/add Trust Task.
[security]
mediator_acl_mode = "explicit_allow"
global_acl_default = "ALLOW_ALL"
local_direct_delivery_allowed = "true"Public mediator – closed network
This mode allows any user to connect unless the administrator explicitly denies access. However, for a user to send messages to another user, the recipient must explicitly permit the sender’s DID for message delivery. In other words, the recipient’s consent is required before messages can be received.
This mode helps protect users from unknown senders spamming or sending unsolicited messages.
It also relies on the forwarding mechanism for all message delivery, adding an extra layer of abstraction to routing and destination handling across the network.
[security]
mediator_acl_mode = "explicit_deny"
global_acl_default = "ALLOW_ALL,MODE_EXPLICIT_ALLOW"
local_direct_delivery_allowed = "false"Public mediator – open network
The most open configuration.
Any user can connect, send, and receive messages without restrictions. A user may update their own ACLs if the administrator has permitted this.
Spam and unsolicited message handling must be managed by the client app or DIDComm agent, as the mediator only relays messages.
[security]
mediator_acl_mode = "explicit_deny"
global_acl_default = "ALLOW_ALL"
local_direct_delivery_allowed = "false"Public mediator – mixed mode
The mixed mode allows the mediator to operate across both open and closed networks.
It allows the mediator to accept unknown messages to enable discovery and initiate connections between users using an ephemeral DID. Once the connection is established, users switch to private DIDs to start communicating with each other. The private DIDs are added to the Access Control Lists (ACLs), which will allow message delivery between users.
[security]
mediator_acl_mode = "explicit_deny"
global_acl_default = "ALLOW_ALL,MODE_EXPLICIT_ALLOW"
local_direct_delivery_allowed = "false"In the case of Out-Of-Band (OOB) discovery, it uses two different DIDs to facilitate discovery:
An ephemeral DID that is published in the OOB Invitation. It must be open to the world.
A private channel DID that is closed to the world, except for the DID discovered through the OOB discovery protocol.
The ephemeral DID changes its own ACL flags with the messaging/account/update Trust Task, which it can do for each flag whose _CHANGE flag is set. It changes them to the following:
- acl_flags: ALLOW_ALL (which also forces MODE_EXPLICIT_DENY)
The private channel DID follow the existing global_acl_default.
What’s next
Glad to hear it. Thanks for letting us know.
Sorry to hear that. Thanks for letting us know.
Still stuck? Ask the community on Discord or contact us.