diff --git a/Makefile b/Makefile index d458959..557f89c 100644 --- a/Makefile +++ b/Makefile @@ -16,4 +16,7 @@ build: set-version test install: test go install ./cmd/... -.PHONY: install build test format set-version +doc-images: + docker run -v ./:/data plantuml/plantuml "doc" + +.PHONY: install build test format set-version doc-images diff --git a/README.md b/README.md index bc8d66c..7647dde 100644 --- a/README.md +++ b/README.md @@ -239,6 +239,10 @@ curl --cacert cert.pem \ "https://localhost:4443/api/1/vehicles/$VIN/command/flash_lights" ``` +The request's flow through the system: + +![](./doc/request_diagram.png) + ### REST API documentation The HTTP proxy implements the [Tesla Fleet API vehicle command endpoints](https://developer.tesla.com/docs/fleet-api#vehicle-commands). diff --git a/doc/request_diagram.png b/doc/request_diagram.png new file mode 100644 index 0000000..ab6f15f Binary files /dev/null and b/doc/request_diagram.png differ diff --git a/doc/request_diagram.puml b/doc/request_diagram.puml new file mode 100644 index 0000000..c6d153b --- /dev/null +++ b/doc/request_diagram.puml @@ -0,0 +1,23 @@ +@startuml +title Vehicle Commands Proxy + +"Your Backend" -> "Vehicle Commands Proxy": GET /api/1/vehicles/$VIN/command/flash_lights +activate "Vehicle Commands Proxy" +"Vehicle Commands Proxy" -> "Vehicle Commands Proxy": Sign command using private key + +"Vehicle Commands Proxy" -> "Fleet API": Signed command +activate "Fleet API" + +"Fleet API" -> Vehicle: Signed command +activate Vehicle +Vehicle -> Vehicle: Validate signature\nusing public key +Vehicle -> Vehicle: Flash Lights +Vehicle --> "Fleet API": Response +deactivate Vehicle + +"Fleet API" --> "Vehicle Commands Proxy": Response +deactivate "Fleet API" + +"Vehicle Commands Proxy" --> "Your Backend": Response +deactivate "Vehicle Commands Proxy" +@enduml