go-http-peering/doc/sequence-diagram/update.plantuml

20 lines
651 B
Plaintext

@startuml
Client -> Server: POST /update\nX-Server-Token: <JWT_TOKEN>\nX-Client-Token: <JWT_TOKEN>\n\n{"Attributes": <PEER_ATTRIBUTES>}
Server -> Server: Validate client/server tokens
alt Success
Server -> Server: Save attributes
Server -> Server: Update last contact for peer ID
Server -> Client: 200 OK {""}
else Invalid client or server token
Server -> Client: 400 Bad request
else Malformed update request
Server -> Client: 400 Bad request
else Peer not found
Server -> Client: 401 Unauthorized
else Peer rejected
Server -> Client: 403 Forbidden
else Unexpected error
Server -> Client: 500 Server error
end
@enduml