Skip to content

Self-improving AI Employees for everyone

14.0 KB
Raw Blame
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080" width="100%" role="img" aria-labelledby="title desc">
<title id="title">Credentials Architecture</title>
<desc id="desc">Credential configuration flows from the server-owned provider catalogue through modular client panels and registered WebSocket handlers. AuthService is the only plaintext access boundary; CredentialsDatabase encrypts separate API-key and OAuth-token records with the process-held Fernet service, while status events invalidate every connected client&#x27;s catalogue. Sources: client/src/components/credentials/CredentialsModal.tsx; client/src/components/credentials/useCredentialPanel.ts; server/services/credentials/handlers.py; server/services/plugin/credential.py; server/services/auth.py; server/core/credentials_database.py; server/core/encryption.py; server/services/status_broadcaster.py</desc>
<defs>
  <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="#e8eaed"/></marker>
  <style>
    .title { fill:#e8eaed; font:700 30px Geist,system-ui,sans-serif; }
    .subtitle { fill:#9aa1ac; font:400 18px Geist,system-ui,sans-serif; }
    .group-label { fill:#9aa1ac; font:600 16px 'JetBrains Mono',ui-monospace,monospace; letter-spacing:1.2px; }
    .type-label { fill:#9aa1ac; font:600 16px 'JetBrains Mono',ui-monospace,monospace; letter-spacing:.8px; }
    .node-label { fill:#e8eaed; font:650 20px Geist,system-ui,sans-serif; }
    .node-detail { fill:#9aa1ac; font:400 16px Geist,system-ui,sans-serif; }
    .edge-label { fill:#e8eaed; font:500 16px Geist,system-ui,sans-serif; }
    .edge-protocol { fill:#9aa1ac; font:500 16px 'JetBrains Mono',ui-monospace,monospace; }
    .callout-title { fill:#e8eaed; font:650 18px Geist,system-ui,sans-serif; }
    .callout-text { fill:#9aa1ac; font:400 16px Geist,system-ui,sans-serif; }
    .legend { fill:#9aa1ac; font:500 16px Geist,system-ui,sans-serif; }
  </style>
</defs>
<rect width="1920" height="1080" fill="#0d0f13"/>
<text x="72" y="58" class="title">Credentials Architecture</text>
<text x="72" y="91" class="subtitle">Server-owned catalogue, WebSocket orchestration, and encrypted storage</text>
<g data-group-id="client-plane"><rect x="72" y="150" width="650" height="780" rx="18" fill="#15171c" stroke="#8be9fd" stroke-width="2"/><text x="92" y="182" class="group-label">CLIENT CONTROL PLANE</text></g><g data-group-id="server-plane"><rect x="760" y="150" width="1088" height="780" rx="18" fill="#15171c" stroke="#bd93f9" stroke-width="2"/><text x="780" y="182" class="group-label">SERVER SECURITY PLANE</text></g><g data-relationship-id="modal-uses-client-state"><title>panel actions + cached status · via React Query</title><path d="M 380 315.0 L 420 315.0" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 400.0 205.0 L 490 151" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="367.8" y="127.0" width="244.39999999999998" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="490" y="148" class="edge-label" text-anchor="middle" textLength="226.4" lengthAdjust="spacingAndGlyphs">panel actions + cached status</text><text x="490" y="168" class="edge-protocol" text-anchor="middle">via React Query</text></g><g data-relationship-id="client-calls-handlers"><title>catalogue + credential RPC · via WebSocket</title><path d="M 680 315.0 L 800 315.0" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 740.0 315.0 L 740 477" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="629.2" y="453.0" width="221.6" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="740" y="474" class="edge-label" text-anchor="middle" textLength="203.6" lengthAdjust="spacingAndGlyphs">catalogue + credential RPC</text><text x="740" y="494" class="edge-protocol" text-anchor="middle">via WebSocket</text></g><g data-relationship-id="handlers-dispatch-registry"><title>dispatch validation</title><path d="M 1070 315.0 L 1130 315.0" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 1100.0 205.0 L 1190 205" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1105.8" y="190.0" width="168.4" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1190" y="208" class="edge-label" text-anchor="middle" textLength="150.4" lengthAdjust="spacingAndGlyphs">dispatch validation</text></g><g data-relationship-id="handlers-use-auth-service"><title>get · save · delete</title><path d="M 935.0 400 L 935 450 L 1215 450 L 1215.0 500" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="990.8" y="435.0" width="168.4" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1075" y="453" class="edge-label" text-anchor="middle" textLength="150.4" lengthAdjust="spacingAndGlyphs">get · save · delete</text></g><g data-relationship-id="registry-stores-valid-result"><title>store valid probe result</title><path d="M 1280.0 400 L 1215.0 500" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 1280.0 480.0 L 1280 426" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1176.8" y="411.0" width="206.39999999999998" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1280" y="429" class="edge-label" text-anchor="middle" textLength="188.4" lengthAdjust="spacingAndGlyphs">store valid probe result</text></g><g data-relationship-id="registry-publishes-status"><title>publish validation status</title><path d="M 1430 315.0 L 1500 315.0" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="1358.0" y="190.0" width="214.0" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1465" y="208" class="edge-label" text-anchor="middle" textLength="196.0" lengthAdjust="spacingAndGlyphs">publish validation status</text></g><g data-relationship-id="auth-publishes-mutation"><title>catalogue version + mutation event</title><path d="M 1400 595.0 L 1450 595 L 1450 440 L 1650 440 L 1650.0 400" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="1418.8" y="425.0" width="282.4" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1560" y="443" class="edge-label" text-anchor="middle" textLength="264.4" lengthAdjust="spacingAndGlyphs">catalogue version + mutation event</text></g><g data-relationship-id="auth-canonical-crud"><title>canonical encrypted CRUD</title><path d="M 1215.0 690 L 1415.0 760" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><rect x="1156.8" y="700.0" width="206.39999999999998" height="30" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1260" y="718" class="edge-label" text-anchor="middle" textLength="188.4" lengthAdjust="spacingAndGlyphs">canonical encrypted CRUD</text></g><g data-relationship-id="db-uses-encryption"><title>encrypt / decrypt payloads · via Fernet</title><path d="M 1415.0 760 L 1415 720 L 1645 720 L 1645.0 690" fill="none" stroke="#e8eaed" stroke-width="2" marker-end="url(#arrow)"/><path d="M 1580.0 720.0 L 1580 966.0" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1469.2" y="942.0" width="221.6" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1580" y="963.0" class="edge-label" text-anchor="middle" textLength="203.6" lengthAdjust="spacingAndGlyphs">encrypt / decrypt payloads</text><text x="1580" y="983.0" class="edge-protocol" text-anchor="middle">via Fernet</text></g><g data-relationship-id="broadcast-invalidates-client"><title>push status + invalidate catalogue · via WebSocket</title><path d="M 1650.0 230 L 1650 115 L 550 115 L 550.0 230" fill="none" stroke="#e8eaed" stroke-width="2" stroke-dasharray="10 8" marker-end="url(#arrow)"/><path d="M 1100.0 115.0 L 1190 148.0" fill="none" stroke="#9aa1ac" stroke-width="1" stroke-dasharray="3 4" opacity=".7"/><rect x="1048.8" y="124.0" width="282.4" height="48" rx="7" fill="#15171c" stroke="#2b2f37"/><text x="1190" y="145.0" class="edge-label" text-anchor="middle" textLength="264.4" lengthAdjust="spacingAndGlyphs">push status + invalidate catalogue</text><text x="1190" y="165.0" class="edge-protocol" text-anchor="middle">via WebSocket</text></g><g data-component-id="credentials-modal"><title>Credentials Modal</title><rect x="110" y="230" width="270" height="170" rx="12" fill="#1b1e25" stroke="#8be9fd" stroke-width="2"/><rect x="110" y="230" width="270" height="7" rx="4" fill="#8be9fd"/><text x="128" y="256" class="type-label">UI</text><text x="128" y="282" class="node-label">Credentials Modal</text><text x="128" y="308" class="node-detail" textLength="234.0" lengthAdjust="spacingAndGlyphs">server catalogue + IDB warm-start</text><text x="128" y="328" class="node-detail" textLength="234.0" lengthAdjust="spacingAndGlyphs">search palette + lazy panels</text></g><g data-component-id="client-state"><title>WebSocket + Query State</title><rect x="420" y="230" width="260" height="170" rx="12" fill="#1b1e25" stroke="#8be9fd" stroke-width="2"/><rect x="420" y="230" width="260" height="7" rx="4" fill="#8be9fd"/><text x="438" y="256" class="type-label">CLIENT</text><text x="438" y="282" class="node-label">WebSocket +</text><text x="438" y="304" class="node-label">Query State</text><text x="438" y="330" class="node-detail">request / response RPC</text><text x="438" y="350" class="node-detail">catalogue invalidation</text></g><g data-component-id="ws-handlers"><title>Credential WS Handlers</title><rect x="800" y="230" width="270" height="170" rx="12" fill="#1b1e25" stroke="#ffb86c" stroke-width="2"/><rect x="800" y="230" width="270" height="7" rx="4" fill="#ffb86c"/><text x="818" y="256" class="type-label">ROUTER</text><text x="818" y="282" class="node-label">Credential WS</text><text x="818" y="304" class="node-label">Handlers</text><text x="818" y="330" class="node-detail" textLength="234.0" lengthAdjust="spacingAndGlyphs">validate · get · save · delete</text><text x="818" y="350" class="node-detail" textLength="234.0" lengthAdjust="spacingAndGlyphs">idempotent mutation envelope</text></g><g data-component-id="credential-registries"><title>Credential Registries</title><rect x="1130" y="230" width="300" height="170" rx="12" fill="#1b1e25" stroke="#ffb86c" stroke-width="2"/><rect x="1130" y="230" width="300" height="7" rx="4" fill="#ffb86c"/><text x="1148" y="256" class="type-label">REGISTRY</text><text x="1148" y="282" class="node-label">Credential Registries</text><text x="1148" y="308" class="node-detail" textLength="264.0" lengthAdjust="spacingAndGlyphs">catalogue metadata + stored flags</text><text x="1148" y="328" class="node-detail">credential classes + probes</text></g><g data-component-id="status-broadcaster"><title>Status Broadcaster</title><rect x="1500" y="230" width="300" height="170" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="1500" y="230" width="300" height="7" rx="4" fill="#ff79c6"/><text x="1518" y="256" class="type-label">EVENTS</text><text x="1518" y="282" class="node-label">Status Broadcaster</text><text x="1518" y="308" class="node-detail">api_key_status</text><text x="1518" y="328" class="node-detail">credential_catalogue_updated</text></g><g data-component-id="auth-service"><title>AuthService</title><rect x="1030" y="500" width="370" height="190" rx="12" fill="#1b1e25" stroke="#f1fa8c" stroke-width="2"/><rect x="1030" y="500" width="370" height="7" rx="4" fill="#f1fa8c"/><text x="1048" y="526" class="type-label">SECURITY SERVICE</text><text x="1048" y="552" class="node-label">AuthService</text><text x="1048" y="578" class="node-detail">only credential access point</text><text x="1048" y="598" class="node-detail">separate API-key + OAuth caches</text><text x="1048" y="618" class="node-detail">refresh tokens never cached</text></g><g data-component-id="encryption-service"><title>Encryption Service</title><rect x="1490" y="500" width="310" height="190" rx="12" fill="#1b1e25" stroke="#f1fa8c" stroke-width="2"/><rect x="1490" y="500" width="310" height="7" rx="4" fill="#f1fa8c"/><text x="1508" y="526" class="type-label">CRYPTO</text><text x="1508" y="552" class="node-label">Encryption Service</text><text x="1508" y="578" class="node-detail">PBKDF2-SHA256 · 600k</text><text x="1508" y="598" class="node-detail">Fernet key held in process</text><text x="1508" y="618" class="node-detail">server key + install salt</text></g><g data-component-id="credentials-db"><title>credentials.db</title><rect x="1180" y="760" width="470" height="150" rx="12" fill="#1b1e25" stroke="#ff79c6" stroke-width="2"/><rect x="1180" y="760" width="470" height="7" rx="4" fill="#ff79c6"/><text x="1198" y="786" class="type-label">ENCRYPTED SQLITE</text><text x="1198" y="812" class="node-label">credentials.db</text><text x="1198" y="838" class="node-detail">EncryptedAPIKey · EncryptedOAuthToken</text><text x="1198" y="858" class="node-detail">credentials_metadata encryption salt</text></g><g data-callout-id="storage-split"><rect x="800" y="735" width="330" height="175" rx="10" fill="#1b1e25" stroke="#f1fa8c" stroke-width="2" stroke-dasharray="7 6"/><text x="816" y="765" class="callout-title">Two non-interchangeable stores</text><text x="816" y="791" class="callout-text">API keys: session + provider</text><text x="816" y="813" class="callout-text">OAuth tokens: provider + customer</text><text x="816" y="835" class="callout-text" textLength="298.0" lengthAdjust="spacingAndGlyphs">Access tokens may cache; refresh tokens do not</text></g>
<g aria-label="Legend"><circle cx="72" cy="1038" r="7" fill="#bd93f9"/><text x="86" y="1044" class="legend">Agents / system</text><circle cx="317" cy="1038" r="7" fill="#8be9fd"/><text x="331" y="1044" class="legend">Models / interfaces</text><circle cx="562" cy="1038" r="7" fill="#50fa7b"/><text x="576" y="1044" class="legend">Tools / results</text><circle cx="807" cy="1038" r="7" fill="#ff79c6"/><text x="821" y="1044" class="legend">Triggers / events</text><circle cx="1052" cy="1038" r="7" fill="#ffb86c"/><text x="1066" y="1044" class="legend">Workflow / runtime</text><circle cx="1297" cy="1038" r="7" fill="#f1fa8c"/><text x="1311" y="1044" class="legend">Security note</text></g>
</svg>