From a90f396bd89e331b9fcc822288022034e86cff0e Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Sun, 7 Jun 2020 20:06:36 +0100 Subject: [PATCH] Add mermaid request flow diagram --- docs/assets/images/request-flow.mmd | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/assets/images/request-flow.mmd diff --git a/docs/assets/images/request-flow.mmd b/docs/assets/images/request-flow.mmd new file mode 100644 index 00000000..5b3b8593 --- /dev/null +++ b/docs/assets/images/request-flow.mmd @@ -0,0 +1,41 @@ +graph TD + req(Request Initiated) + resp(Response closed) + + subgraph RedirectToHTTPS + isRDHTTPs{Is redirect to HTTPs Enabled?} + requestNeedsRedirect{Request is HTTP or X-Forwarded-Proto not HTTPS} + redirectToHTTPS(Send redirect to HTTPs) + rdHTTPSNext(Send to next server) + end + + isGCPHealthCheck{Is GCP HealthCheck enabled?} + + subgraph GCPHealthCheck + livenessCheck{Request path is /liveness_check} + readinessCheck{Request path is /readiness_check} + gcpUserAgent{Path is / and user agent is 'GoogleHC/1.0'} + gcpOk(Send OK response) + gcpNext(Send to next server) + end + + req --> isRDHTTPs + + %% RedirectToHTTPS + isRDHTTPs -- yes --> requestNeedsRedirect + isRDHTTPs -- no --> rdHTTPSNext + requestNeedsRedirect -- yes --> redirectToHTTPS + requestNeedsRedirect -- no --> rdHTTPSNext + redirectToHTTPS --> resp + + rdHTTPSNext --> isGCPHealthCheck + + %% GCPHealthCheck + livenessCheck -- yes --> gcpOk + livenessCheck -- no --> readinessCheck + readinessCheck -- yes --> gcpOk + readinessCheck -- no --> gcpUserAgent + gcpUserAgent -- yes --> gcpOk + gcpUserAgent -- no --> gcpNext + gcpOk --> resp + isGCPHealthCheck -- yes --> livenessCheck