The backend server of MlmAccess
backend | ||
mock-clients | ||
.gitignore | ||
docker-compose.yml | ||
README.md | ||
runBackend.sh |
server
The backend server of MlmAccess
Workflows
Pairing
Actor
A new actor can pair like this:
- Connect to the broker using
pair
as username and the pair secret as password - Subscribe to
mlmAccess/pair/response/actor
- Publish its desired ID to
mlmAccess/pair/request/actor
- The backend will publish the password for the actor to
mlmAccess/pair/response/actor
in case of success - In case of an error, the backend will publish an empty string to
mlmAccess/pair/response/actor
- The actor may now connect using
actor-{id}
as username and the password it got in 4
Panel
A new panel can pair in the same way as a new actor. Every occurence of actor
as to be replaced by panel
, though.
Actor
The actor should subscribe to:
mlmAccess/actor/{id}/action
The actor can publish to:mlmAccess/actor/{id}/status
Action execution
If the backend requests an action to be executed, the actor follows this workflow:
- The backend will publish a requested action to
mlmAccess/actor/{id}/action
- The actor will publish its state to
mlmAccess/actor/{id}/status
to let the backend know that the action was executed successfully. This will also happen when the state of the actor is unchanged.
Status change
If the status of the actor changes it follows this workflow:
- The actor publishes its status to
mlmAccess/actor/{id}/status
Panel
Authentication workflow
The authentication workflow looks like this:
- The user presents their RFID Chip to the reader
- The panel publishes the id to
mlmAccess/panel/{id}/authentication/request
- The backend pulishes a JSON object to
mlmAccess/panel/{id}/authentication/response
which looks like this:{"status": 200, "data": {"fullName": "Max Mustermann", ...}}
the status is an int which can be either 200(success) or 404(id not found) - If the status is 200, the panel continues with the normal operation workflow
- If the status is 404, the panel continues with the initial user registration workflow
Initial user registration
The initial user registration could work like this:
- The user inputs its member ID
- The user inputs its birthdate
- The panel publishes a JSON object to
mlmAccess/panel/{id}/registration/request
which looks like this:{"memberId": "1234", "rfidId": "abcde"}
- The backend pulishes a JSON object to
mlmAccess/panel/{id}/registration/response
which looks like this:{"status": 200, "data": {"fullName": "Max Mustermann", ...}}
the status is an int which can be either 200(success), 404(memberId not found) or 401(authentication failed / rfidId not found) - If the status is 200, the panel continues with the normal operation workflow
- Otherwise, the panel shows an error and goes back to idle.
Normal operation
The normal operation after authentication looks like this:
- The user enters the id of the actor they want to unlock
- The panel publishes a JSON object to
mlmAccess/panel/{id}/actor/request
which looks like this:{"rfidId": "abcde", "actorId": "101"}
- The backend pulishes a JSON object to
mlmAccess/panel/{id}/registration/response
which looks like this:{"status": 200}
the status is an int which can be either 200(success), 404(actor id not found) or 401(authentication failed / rfidID not found), 403(forbidden) - The panel gives Feedback to the user and goes back to idle