Open Charging Technology · Whitepapers

Roles and Rights of Connections: Signatures, Logins and Peers

Version 0.2, Draft, 2026-12-04 CC-BY-SA 4.0 · OpenChargingTechnology/Whitepapers · reference implementations: OpenChargingCloud/WWCP_Core (permissions, signature policy, signer roles), OpenChargingCloud/WWCP_Node (logins, peers, rights profiles), OpenChargingCloud/WWCP_OCPP and OpenChargingCloud/WWCP_OCPI (catalogues, presets, gates)

A node of the Open Charging Cloud - a charging station, a local controller, a CSMS, an EMSP, a roaming hub - talks to others over connections. Some of them come in (a login signs in at a port of the node), some go out (the node dials a peer: a back end, a successor, an energy manager). Over each of them it has to decide, for every single message, whether the other side may ask for it, and whether it may be told it. Where a message is signed, it also has to decide whether the signer may ask for it.

Three papers of this repository each describe one part of that decision:

The fourth part, rights profiles for logins and peers, so far lives only in the design notes of the reference implementation (Node-Connections-Concept.md §3.4 and §3.6 in ChargingStationCLI).

This paper puts the four parts side by side. It says how they work today, in the code, where they meet and where they do not, and where the papers contradict each other. It does not replace the three papers; it refers to them for the details and the reasons.

State of the code described: WWCP_Core 751cdb08, WWCP_Node d916b69, WWCP_OCPP 3b3e7b47, ChargingStation 1befa79, WWCP_OCPI 5bcb09ca, EMSP 8a61aa1 (pinned in ChargingStationCLI 268f67b and EMSPCLI 7fd484e). Section 7.1 of version 0.2: WWCP_OCPP 9ad83a71, pinned in ChargingStationCLI e7e1abd with WWCP_OCPP cf708259.


Contents

  1. Summary
  2. Three kinds of role
  3. One vocabulary: actions, permissions, catalogues
  4. Signed messages and signer roles
  5. Inbound: logins and their groups
  6. Outbound: peers and their roles
  7. How one message is decided today
  8. Gaps in the implementation
  9. Contradictions between the papers
  10. Questions
  11. References

0. Summary

1. Three kinds of role

Kind What it says Where it comes from Examples Paper
Connection role the most a connection may ever carry the role extension of the TLS client certificate, or a pin evqi:operational, evqi:diagnostics, evqi:security-admin, evqi:firmware, evqi:metrology EVQI §6.2, §6.3, RawPublicKeys §5.9
Peer role the position of a back end among several peers.json of the node; assigned by the node (5.2) Primary, Successor, Observer, EnergyManager, Service, Custom EVQI §11.3.3, CSMS Migration §3
Signer role who signed a message, and so what it may ask for a signed role assignment that binds keys to a role systemadmin (the owner), support, viewer, cpo, installer SignedMessages §5.3, §6

A fourth thing is not a role but behaves like one: the rights profile of a login (section 4). A login has no role; it has a profile per protocol (readOnly, support, full, or one of the node's own).

In this paper the three are always qualified: connection role, peer role, signer role.

2. One vocabulary: actions, permissions, catalogues

2.1 Permissions

A permission is resource:operation (SignerPermissions.IsPermission, WWCP_Core, WWCP_CoreData/Signatures/MessagePolicy.cs):

A held permission covers a needed one when the operations are equal and the held resource is * or the same resource (SignerPermissions.Covers). *:read therefore covers reset:read but not reset:run.

2.2 The catalogue of a protocol

A protocol declares once what each of its actions needs: a list of ActionPermissions, its catalogue (MessagePolicy.cs). An entry has

Field Meaning
Action the action as on the wire: Reset, SetChargingProfile, PutClientInfo
Permissions what it needs, as permissions; AdditionalPermissions on top
Where conditions on fields of the payload; all must hold for the entry to apply
RefusedBecause refused whoever asks, with this reason
Qualifier / QualifierOf a fixed variant, or one read off the payload (the vendorId of a DataTransfer)
Condition a delegate (ConnectionId, PeerId, Payload) → reason or null, asked last; it only narrows

The catalogues today:

2.3 Entries of a rights profile

A rights profile (section 4.2, 5.3) has an inbound and an outbound list. Each entry is (RightsProfile.IsEntry, WWCP_Node):

entry := "*"                                   ; everything
       | resource ":" ("read" | "edit" | "run") ; a permission, resource lower case or "*"
       | ActionName                            ; one action, every variant
       | ActionName ":" Qualifier              ; one variant of one action

An action name is [A-Za-z][A-Za-z0-9._-]{0,99} and not all lower case, so that Reset:Hard is an action with a qualifier and reset:run a permission. A qualifier the catalogue does not know is refused when the profile is saved.

2.4 How an entry grants an action

RightsProfile.WhyNot reads the catalogue as the signature policy reads it:

  1. Of the catalogue entries for the action whose Where conditions all hold, the one with the most conditions decides; on a tie, the first.
  2. * in the list allows everything, even what RefusedBecause refuses.
  3. Otherwise RefusedBecause refuses; the bare action name allows every variant; Action:Qualifier allows that variant alone; otherwise every permission the entry needs must be covered by a permission in the list. An action the catalogue does not know is allowed only by its name or by *.
  4. Last, the entry's Condition is asked.

The signature policy (section 3.3) uses the same step 1 and the same Covers, but not steps 2 to 4: a signer either holds the permissions of the entry or does not.

3. Signed messages and signer roles

The details are in SignedMessages. What matters here:

3.1 Two layers in one class

SignaturePolicy (WWCP_Core, WWCP_CoreData/DataStructures/SignaturePolicy.cs) holds two layers.

The OCPP adapters call the policy in every handler: an incoming request is verified and decided before the handler runs, and refused with CALLERROR SecurityError; a response is signed after it. Responses are verified, never decided.

3.2 From a signature to a signer role

3.3 The decision

Decide takes, in this order:

  1. the most specific entry of the policy table (by action, direction, versions, a field condition, or component and variable): it requires Unsigned, AnySigner, or a quorum (anyOf/allOf with a count), and on violation refuses or only records;
  2. otherwise the catalogue: some signer must hold every permission of the entry;
  3. otherwise the default: any signer for CSMS → station, except Heartbeat; unsigned otherwise.

Writing the policy or the roles always needs signatures:edit. The policy runs in one of three modes: Off (the default), Observe, Enforce.

3.4 Where the connection meets the signer

Before deciding, VerifyRequestMessage asks ConnectionAllows: the connection role of EVQI §6, as a ConnectionRights object (a role name, the actions and permissions it may carry). The adapters get it from IN.RightsOfConnection. Nothing outside the tests sets that hook (section 7.3).

4. Inbound: logins and their groups

4.1 The login and its group

Every port of a node has one store of logins (WebSocketLogins, file websocket-logins.json). A login belongs to a group; both carry:

Field Login Group
Protocols which protocols it may come in over the same, for every login of the group
Rights protocol → rights profile id: {"OCPP": "readOnly"} the same
authentication password, TOTP, SSH keys, key pins AuthMethods, ClientAuthentication (the OCPP security profiles), SSHChannels

4.2 Rights profiles and presets

A rights profile is (Id, Name, Protocol, Inbound, Outbound, Description) (RightsProfile, WWCP_Node). For a login, inbound is what it may ask of this node, outbound what this node sends to it.

4.3 At sign-in

The door of the port (WebSocketSignIns, LoginSSHSignIns) lets a login in only

It keeps the login among the custom data of the connection (LoginKey).

4.4 On every message

WWCPNode.WhyMayNotHandle(Connection, Protocol, Action, Payload, Direction) checks the profile of the login and that of its group; both must allow. A change holds from the next message; the connection is not cut.

The protocols call it from their gates:

Every refusal is logged, with the tags auth and rights.

5. Outbound: peers and their roles

5.1 The peer

A peer is a party this node connects to, with one or more endpoints (PeerEntry, peers.json). Its fields that matter here: Role and Rights.

5.2 How a peer gets its role

The node assigns roles (ConnectionStore):

A primary has no rights of its own: it may do everything (full), and its Rights are cleared.

5.3 The rights of a peer

"rights" in peers.json has three forms:

Form Example Means
absent – the preset of its role, peer.<role>
a string "rights": "support" that named profile of peers.json
an object "rights": {"inbound": [...], "outbound": [...]} lists of its own

A Custom peer without rights is refused when saved. Entries the grammar refuses are dropped when the file is read, with a note, and refused when given over the API.

For a peer, inbound is what it may ask of this node, outbound what this node sends to it.

5.4 Presets of the peer roles

A protocol brings presets for its peers, written into peers.json once.

OCPP (OCPPActionPermissions, WWCP_OCPP_Node):

Preset Inbound (may ask) Outbound (is told)
peer.primary * *
peer.successor *:read, TriggerMessage, ExtendedTriggerMessage, CertificateSigned, InstallCertificate *:read, the transaction messages, SignCertificate
peer.observer nothing station:read, state:read, security:read, monitoring:read, the transaction messages
peer.energyManager SetChargingProfile:ChargingStationExternalConstraints, ClearChargingProfile of the same, GetCompositeSchedule station:read, state:read, MeterValues, power:read
peer.service GetLog, GetDiagnostics, GetBaseReport, GetVariables, GetConfiguration station:read, the status of logs and diagnostics, NotifyReport

OCPI (the EMSP, EMSP 8a61aa1): peer.observer and peer.service, both * in both directions, so that a CPO peer may do what it did before rights existed. The message server of a protocol hands its catalogue and its presets to the node (WWCP_Node 5881a02, WWCP_OCPI 12c92aba).

5.5 What stays the primary's

Whatever the lists say, a secondary may never ask for (WhyPrimaryOnly, OCPP only):

Such an entry in a secondary's inbound list is refused when saved. A plain * is not refused; it reads as "everything but the primary's".

5.6 On every message

5.7 Routing that follows from the roles

Who owns a transaction when there are several back ends, seqNo per peer, the transactionId mapping of OCPP 1.6 and the answers of secondaries are not built (EVQI §11.4.2). Until then a secondary allowed the transaction messages gets copies; its answers are logged and ignored.

5.8 Where it is shown

effectiveRights (profile, inbound, outbound, primaryOnly) per peer in the HTTP API of the node, on its peers page, and in its peers command.

6. How one message is decided today

An incoming OCPP request:

flowchart TD
    A[Request comes in] --> B{RequestGate<br/>may this node be asked at all?}
    B -- no --> X[CALLERROR SecurityError]
    B -- yes --> C{Connection has a login?}
    C -- yes --> D{Profile of login<br/>and of its group}
    C -- no --> E{Peer of the connection:<br/>primary-only rule, then profile}
    D -- no --> X
    E -- no --> X
    D -- yes --> F
    E -- yes --> F{Connection role<br/>RightsOfConnection}
    F -- not set --> G
    F -- no --> X
    F -- yes --> G{Signatures verified,<br/>policy table / catalogue / default}
    G -- refused, Enforce --> X
    G -- allowed, or Observe --> H[Handler]

So the effective right is a sequence, not one intersection:

login ∩ group        (or: peer role / peer rights)    -- the gate of the protocol
  then connection role                                 -- only where RightsOfConnection is set
  then signer role                                     -- only where the signature policy is not Off

An outgoing message passes the SendGate (the peer of the next hop, or the login of the connection) and, where the policy says so, is signed.

7. Gaps in the implementation

7.1 Inbound SEND messages are held to rights (closed)

Until version 0.1 of this paper, only requests passed RefusalOf (the request gate and the login gate) in the OCPP adapters. JSON and binary SEND frames addressed to this node passed only SenderRefused, a check of the network path, so a login or peer whose profile did not allow a SEND action could still send it - in 2.1 and in the 1.6 overlay of WWCP_OCPP alike.

Now a SEND frame for this node, JSON or binary, passes the login gate before its handler (SendRefusalOf), as question 3 recommended: in OCPP 2.1 since WWCP_OCPP 92c68e7e, in 1.6 since 9ad83a71. The request gate stays a gate of requests. A refused SEND is dropped and logged; it has no answer. A gate that fails refuses, as it does for requests. With the 1.6 fix came a second one: a binary SEND of a charge point to a central system in the standard networking mode was addressed to CSMS, the name of 2.1, and passed on instead of reaching its handler.

SEND frames forwarded through the node are still checked by the forwarding filter.

7.2 A back end that connects in is held to its login, not to its peer role

When a back end connects in (a CPO to an EMSP, a CSMS to a station port in hosted mode), the door marks the connection both as an inbound connection of a peer and with the login it signed in under. WhyMayNotHandle asks the login first, so the peer's role and rights are never read for requests over it. For OCPP the outbound direction asks the peer of the next hop first, so the two directions differ. For OCPI both directions use the login.

7.3 The connection role is never set

RightsOfConnection (EVQI §6) is a hook of the OCPP adapters that only tests set. No node derives a connection role from a certificate or a pin today.

7.4 No single intersection

SignedMessages §5.1 and EVQI §7.4 define the effective permission as an intersection. The code checks a login or a peer, never both, and the signer afterwards, in each handler. For a request over a connection that is both (7.2), the peer is not asked at all.

7.5 Smaller points

8. Contradictions between the papers

# Topic One paper says The other says Effect
C1 The effective permission SignedMessages §5.1: connection role ∩ peer rights ∩ signer role EVQI §7.4: connection role ∩ signer role; Node-Connections §3.4: login profile ∩ peer role ∩ signer role three formulas for one rule
C2 The successor's take-over CSMS Migration §3.3: the successor writes the ConnectionMode of other peers, runs CloseConnection, GetConnections, TestConnection peer.successor has none of it; the primary-only rule reserves "the configuration of other peers" a take-over as specified cannot be configured: it is refused when saved
C3 Certificates "of its own" EVQI §11.3.3, §11.3.4, Q15: a successor installs only its own client certificate and its own root CA Node-Connections §3.6.2 (2026-12-02): who may install a certificate may install any EVQI is out of date and does not say so
C4 The energy manager peer.energyManager may SetChargingProfile:ChargingStationExternalConstraints SignedMessages §5.3: that purpose is "–", refused whatever the signer role (K01.FR.22) under Enforce an energy manager can never do the one thing it is for
C5 Grammar of the lists EVQI §11.7: message names, also in the Device Model (OCPPPeerController.Inbound/Outbound) Node-Connections, SignedMessages: permissions resource:operation; security is no resource of SignedMessages §5.3, which also defines permissions only for what a node receives lists in the Device Model cannot carry the profiles
C6 The previous primary CSMS Migration: the old primary becomes a Service and still gets the rest of its transactions peer.service is told only of its diagnostics; ownership of transactions is not built (5.7) the old primary does not get its transactions
C7 Qualifiers Node-Connections §3.6.2: SetChargingProfile:<purpose> works in peer rights SignedMessages, status of phase 3: a qualified entry is not understood true of different layers (rights profiles do, ConnectionRights does not), but neither paper says so
C8 Refusal of one entry CSMS Migration §4.1: Rejected with reasonCode SecurityError SignedMessages Q6: NotAuthorized; EVQI and Node-Connections: CALLERROR SecurityError for whole requests two reason codes for one refusal

Smaller ones: the Observer may ask nothing (Node-Connections) or Get* (EVQI §11.3.3); EVQI §6.3 still speaks of "signature policies and user roles", the names SignedMessages replaced.

9. Questions

Each with a recommendation; only question 3 is decided.

  1. One formula (C1). Should all papers say effective = (login ∩ group, or peer rights) ∩ connection role ∩ signer role, and say that a step without data (no connection role, policy Off) is skipped? Recommended: yes, with this paper as the place that says it and the others referring to it.
  2. A back end that connects in (7.2). Should a connection that is both a login and the endpoint of a peer be held to both, the intersection? Recommended: yes, so that a role never gives more than the login and a login never more than the role.
  3. SEND messages (7.1). Should inbound SEND frames pass the same gates as requests, and a refused one be dropped and logged (a SEND has no answer)? Decided and built: yes (7.1).
  4. The successor's take-over (C2). Should peer.successor get GetConnections, TestConnection, CloseConnection and the ConnectionMode of other peers, and the primary-only rule make an exception for exactly these? Recommended: yes, as CSMS Migration §3.3 decided.
  5. The energy manager (C4). Should SignedMessages §5.3 allow ChargingStationExternalConstraints for a signer role energyManager, or should the signature step not apply to a peer that is no CSMS? Recommended: a signer role energyManager, so that the signature policy keeps one rule for every way in.
  6. The previous primary (C6). Until transactions have owners, should peer.service be told the transaction messages of a peer that was primary before? Recommended: no; instead the previous primary becomes an Observer until its last transaction has ended, then a Service.
  7. The Device Model (C5). Should OCPPPeerController carry the id of a profile instead of lists of message names? Recommended: yes, with the lists read-only, as effectiveRights.
  8. The refusal of one entry (C8). Recommended: NotAuthorized, as SignedMessages Q6, and CSMS Migration §4.1 changed to it.
  9. EVQI §11.3.4 (C3). Recommended: EVQI says that "of its own" was dropped, and why.

10. References

Tests that pin the behaviour described:

License

© 2026 GraphDefined GmbH

This document is published under the Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA 4.0). You are free to share, adapt, and build upon it, even for commercial purposes, as long as you give appropriate credit and distribute your work and contributions under the same license.