better line up of pipes

This commit is contained in:
2025-12-11 06:15:26 -05:00
parent 48aeff92a2
commit 65345c895c

100
README.md
View File

@@ -291,25 +291,25 @@ go build -o webhook main.go
## The Full Flow with Both Tokens ## The Full Flow with Both Tokens
``` ```
┌──────────────────────────────────────────────────────────────────────────────┐ ┌──────────────────────────────────────────────────────────────────────────────┐
│ YOUR CLUSTER │ │ YOUR CLUSTER
│ │
│ Kubernetes API Server (configured with your issuer) │ │ Kubernetes API Server (configured with your issuer)
│ ├─ Generates TOKEN #1 (ServiceAccount JWT) │ │ ├─ Generates TOKEN #1 (ServiceAccount JWT)
│ │ Signed with: cluster's private key │ │ │ Signed with: cluster's private key
│ │ Claims: │ │ │ Claims:
│ │ iss: "https://api.vultr.com/v2/oidc" │ │ │ iss: "https://api.vultr.com/v2/oidc"
│ │ aud: "vultr" │ │ │ aud: "vultr"
│ │ sub: "system:serviceaccount:default:test-sa" │ │ │ sub: "system:serviceaccount:default:test-sa"
│ └─ Mounts TOKEN #1 in pod at: │ │ └─ Mounts TOKEN #1 in pod at:
│ /var/run/secrets/kubernetes.io/serviceaccount/token │ │ /var/run/secrets/kubernetes.io/serviceaccount/token
│ │
│ ┌────────────────────────────────────────────────────────────────────────┐ │ │ ┌────────────────────────────────────────────────────────────────────────┐
│ │ Pod: my-app │ │ │ │ Pod: my-app │
│ │ │ │ │ │ │
│ │ 1. Application starts │ │ │ │ 1. Application starts │
│ │ 2. SDK reads TOKEN #1 from file │ │ │ │ 2. SDK reads TOKEN #1 from file │
│ │ 3. SDK calls Vultr STS with TOKEN #1 │ │ │ │ 3. SDK calls Vultr STS with TOKEN #1 │
│ └────────────────────────────────────────────────────────────────────────┘ │ │ └────────────────────────────────────────────────────────────────────────┘
└──────────────────────────────────────────────────────────────────────────────┘ └──────────────────────────────────────────────────────────────────────────────┘
@@ -317,20 +317,20 @@ TOKEN #1 (K8s JWT) sent to Vultr platform ────────────
┌──────────────────────────────────────────────────────────────────────────────┐ ┌──────────────────────────────────────────────────────────────────────────────┐
│ VULTR PLATFORM (api.vultr.com) │ │ VULTR PLATFORM (api.vultr.com)
│ │
│ STS Service │ │ STS Service
│ ├─ Receives TOKEN #1 from pod │ │ ├─ Receives TOKEN #1 from pod
│ ├─ Validates TOKEN #1: │ │ ├─ Validates TOKEN #1:
│ │ └─ Fetches public key from /v2/oidc/jwks │ │ │ └─ Fetches public key from /v2/oidc/jwks
│ │ └─ Verifies signature │ │ │ └─ Verifies signature
│ │ └─ Checks issuer, audience, expiration │ │ │ └─ Checks issuer, audience, expiration
│ │ └─ Checks role trust policy │ │ │ └─ Checks role trust policy
│ ├─ Generates TOKEN #2 (Temporary Credentials) │ │ ├─ Generates TOKEN #2 (Temporary Credentials)
│ │ └─ AccessKeyId: VKAEXAMPLE123ABC │ │ │ └─ AccessKeyId: VKAEXAMPLE123ABC
│ │ └─ SecretAccessKey: secretKEY789XYZ │ │ │ └─ SecretAccessKey: secretKEY789XYZ
│ │ └─ SessionToken: sessionTOKEN456DEF │ │ │ └─ SessionToken: sessionTOKEN456DEF
│ └─ Returns TOKEN #2 to pod │ │ └─ Returns TOKEN #2 to pod
└──────────────────────────────────────────────────────────────────────────────┘ └──────────────────────────────────────────────────────────────────────────────┘
@@ -338,17 +338,17 @@ TOKEN #2 (Temporary credentials) sent back to pod ──────────
┌──────────────────────────────────────────────────────────────────────────────┐ ┌──────────────────────────────────────────────────────────────────────────────┐
│ YOUR CLUSTER │ │ YOUR CLUSTER
│ │
│ ┌────────────────────────────────────────────────────────────────────────┐ │ │ ┌────────────────────────────────────────────────────────────────────────┐ │
│ │ Pod: my-app │ │ │ │ Pod: my-app │
│ │ │ │ │ │ │
│ │ 4. SDK receives TOKEN #2 (credentials) │ │ │ │ 4. SDK receives TOKEN #2 (credentials) │
│ │ 5. SDK caches TOKEN #2 │ │ │ │ 5. SDK caches TOKEN #2 │
│ │ 6. SDK uses TOKEN #2 for all API calls: │ │ │ │ 6. SDK uses TOKEN #2 for all API calls: │
│ │ - List buckets │ │ │ │ - List buckets │
│ │ - Upload objects │ │ │ │ - Upload objects │
│ │ - etc. │ │ │ │ - etc. │
│ └────────────────────────────────────────────────────────────────────────┘ │ │ └────────────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────────┘ └──────────────────────────────────────────────────────────────────────────────┘
@@ -357,13 +357,13 @@ All API calls use TOKEN #2 (credentials) ─────────────
┌──────────────────────────────────────────────────────────────────────────────┐ ┌──────────────────────────────────────────────────────────────────────────────┐
│ VULTR PLATFORM APIs (api.vultr.com/v2/*) │ │ VULTR PLATFORM APIs (api.vultr.com/v2/*)
│ │
│ Object Storage API, Compute API, etc. │ │ Object Storage API, Compute API, etc.
│ ├─ Receives request with TOKEN #2 (SessionToken) │ │ ├─ Receives request with TOKEN #2 (SessionToken)
│ ├─ Validates TOKEN #2 against session database │ │ ├─ Validates TOKEN #2 against session database
│ ├─ Checks permissions from role │ │ ├─ Checks permissions from role
│ └─ Executes API operation │ │ └─ Executes API operation
└──────────────────────────────────────────────────────────────────────────────┘ └──────────────────────────────────────────────────────────────────────────────┘
``` ```