@@ -2323,7 +2323,7 @@ class VaultClient:
23232323
23242324** Token Expiry Timeline** :
23252325
2326- ```
2326+ ``` text
23272327Time: 0min 55min 60min 24hr 7d
23282328 | | | | |
23292329Access: [========= JWT valid =========][expired]
@@ -2368,7 +2368,7 @@ This method provides the best user experience for interactive CLI usage by lever
23682368
23692369** Detailed Implementation** :
23702370
2371- ** Step 1: CLI initiates auth flow**
2371+ #### Step 1: CLI initiates auth flow
23722372
23732373``` bash
23742374inferadb login
@@ -2402,7 +2402,7 @@ open_browser(&auth_url);
24022402start_callback_server (callback_port ). await ;
24032403```
24042404
2405- ** Step 2: Dashboard authenticates user and redirects**
2405+ #### Step 2: Dashboard authenticates user and redirects
24062406
24072407Dashboard UI (` https://app.inferadb.com/cli-login ` ):
24082408
@@ -2444,18 +2444,18 @@ Dashboard UI (`https://app.inferadb.com/cli-login`):
24442444 - ` expires_at ` (5 minutes from now)
244524454 . Return authorization code to Dashboard
24462446
2447- ** Step 3: Dashboard redirects to CLI callback**
2447+ #### Step 3: Dashboard redirects to CLI callback
24482448
2449- ```
2449+ ``` http
24502450HTTP/1.1 302 Found
24512451Location: http://localhost:8432/callback?code=<authorization_code>&state=<state>
24522452```
24532453
2454- ** Step 4: CLI receives callback and exchanges code for token**
2454+ #### Step 4: CLI receives callback and exchanges code for token
24552455
24562456CLI callback handler receives:
24572457
2458- ```
2458+ ``` http
24592459GET /callback?code=<authorization_code>&state=<state>
24602460```
24612461
@@ -2491,15 +2491,15 @@ CLI calls Management API to exchange code for session token:
249124914 . Return the session token associated with the authorization code
249224925 . CLI stores session token in secure storage
24932493
2494- ** Step 5: CLI uses session token for API requests**
2494+ #### Step 5: CLI uses session token for API requests
24952495
24962496``` bash
24972497inferadb vaults list
24982498```
24992499
25002500CLI includes session token in requests:
25012501
2502- ```
2502+ ``` http
25032503GET /v1/organizations
25042504Authorization: Bearer <session_token>
25052505```
@@ -2611,7 +2611,7 @@ fn generate_client_assertion(client_id: &str, private_key_pem: &str) -> Result<S
26112611
26122612CLI/SDK exchanges client assertion for vault-scoped JWT:
26132613
2614- ```
2614+ ``` http
26152615POST /v1/token
26162616Content-Type: application/x-www-form-urlencoded
26172617
@@ -2682,7 +2682,7 @@ $ inferadb vaults list
26822682
26832683** Management API Request** :
26842684
2685- ```
2685+ ``` http
26862686GET /v1/organizations
26872687Authorization: Bearer <session_token>
26882688```
@@ -3176,7 +3176,7 @@ pub struct SystemApiKey {
31763176
31773177### JWT Client Assertion Flow
31783178
3179- ** Step 1: Management API generates client assertion JWT**
3179+ #### Step 1: Management API generates client assertion JWT
31803180
31813181When the Management API needs to call the Server API, it generates a short-lived JWT (client assertion) signed with its System API Key:
31823182
@@ -3223,7 +3223,7 @@ async fn generate_client_assertion(system_key: &SystemApiKey) -> Result<String>
32233223}
32243224```
32253225
3226- ** Step 2: Include JWT in gRPC metadata**
3226+ #### Step 2: Include JWT in gRPC metadata
32273227
32283228``` rust
32293229use tonic :: {metadata :: MetadataValue , Request };
@@ -3252,7 +3252,7 @@ async fn create_server_client() -> Result<VaultManagementServiceClient<Channel>>
32523252}
32533253```
32543254
3255- ** Step 3: Server validates JWT using JWKS**
3255+ #### Step 3: Server validates JWT using JWKS
32563256
32573257The Server API fetches the Management API's JWKS endpoint to retrieve public keys:
32583258
@@ -3514,7 +3514,7 @@ This section focuses on **tenant requests** and how the Server enforces VaultRol
35143514
35153515VaultRoles define what operations are permitted within a vault :
35163516
3517- ` ` `
3517+ ` ` ` text
35183518READER < WRITER < MANAGER < ADMIN
35193519` ` `
35203520
@@ -3705,7 +3705,7 @@ The Server API enforces tenant isolation by prefixing all storage operations wit
37053705
37063706**FoundationDB Keyspace** (Server side):
37073707
3708- ```
3708+ ` ` ` text
37093709vault_<vault_id>/
37103710 tuples/
37113711 <namespace>/<object>/<relation>/<subject>
@@ -4504,7 +4504,7 @@ async fn main() -> Result<()> {
45044504
45054505All data is isolated by entity type and organization to ensure security :
45064506
4507- ` ` `
4507+ ` ` ` text
45084508mgmt/ # Namespace prefix
45094509 users/
45104510 <user_id>/ # User data
0 commit comments