<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="eli.ai" agent="eli.ai diagram exporter" version="1">
  <diagram id="authentication-and-workspace-selection-98a7c4ef" name="Authentication and workspace selection">
    <mxGraphModel dx="1600" dy="1200" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1600" pageHeight="1200" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <object id="1" label="Authentication and workspace selection" schemaVersion="1" diagramId="authentication-and-workspace-selection-98a7c4ef" canonicalAppearanceKey="md:docs/architecture/modular-third-party-sdk.md#2" sourceSha256="98a7c4ef3d615415859cc8dcf653054d74f987a5330c6378a96a3d9d16e748a5" metadataPayloadSha256="f3da0a752b2c76bbc3fa23ea5325acfb107651d060d76b4dcfd8e8b4ec00ec67" generationKey="17000ad74735b04f08759c1018c293f08cb4f97b81ce143f304bb6cc00b4da85" concepts="[&quot;Modular third party SDK&quot;,&quot;Authentication and workspace selection&quot;]" keywords="[&quot;FORCE RLS&quot;,&quot;eli_sk_ or eli_uk_&quot;,&quot;resolve apiKey&quot;,&quot;Authorization: Bearer …&quot;,&quot;required scope?&quot;,&quot;live role capability?&quot;,&quot;client capability method&quot;,&quot;resolve optional workspaceId&quot;,&quot;X-Workspace-Id when configured&quot;,&quot;/api/v1&quot;,&quot;narrowed/revoked&quot;,&quot;resolveAnyApiKey&quot;,&quot;withWorkspace()&quot;,&quot;handler&quot;,&quot;missing&quot;,&quot;granted&quot;,&quot;allowed&quot;]" application="{&quot;name&quot;:&quot;eli-ai&quot;,&quot;version&quot;:&quot;0.1.0&quot;}" packages="{&quot;mermaid&quot;:&quot;11.16.0&quot;,&quot;mermaidCli&quot;:&quot;11.16.0&quot;,&quot;playwright&quot;:&quot;1.62.1&quot;,&quot;playwrightCore&quot;:&quot;1.62.1&quot;,&quot;puppeteer&quot;:&quot;25.6.0&quot;,&quot;puppeteerCore&quot;:&quot;25.6.0&quot;}" environment="{&quot;architecture&quot;:&quot;x64&quot;,&quot;containerImage&quot;:&quot;playwright:v1.62.1-noble@sha256:c091b21d9fae78c76e85cd4356431e9b018402f172a214fc7d7a5e9a7e29d8ac+node:26.3.1-bookworm-slim@sha256:209558c3e5e40e8adff68959d3c2ba7cd73723e716d89196878a0c362fa1e109&quot;,&quot;node&quot;:&quot;v26.3.1&quot;,&quot;platform&quot;:&quot;linux&quot;,&quot;yarn&quot;:&quot;4.17.1&quot;}" renderer="{&quot;browser&quot;:{&quot;executableSha256&quot;:&quot;0b20b130e7edd9dd51873be867761295fe0cfad490c2b9a64f95bd3cfc08fa71&quot;,&quot;name&quot;:&quot;chromium&quot;,&quot;revision&quot;:&quot;1234&quot;,&quot;version&quot;:&quot;151.0.7922.34&quot;},&quot;font&quot;:{&quot;family&quot;:&quot;Eli Diagram Inter Variable&quot;,&quot;fileSha256&quot;:&quot;3100e775e8616cd2611beecfa23a4263d7037586789b43f035236a2e6fbd4c62&quot;,&quot;licenseSha256&quot;:&quot;3b0a5fca3d17942cde889069889dedbbbd075e9b599968c82a95f4d944e9b345&quot;},&quot;mermaidConfigSha256&quot;:&quot;68c10966fe84406ee626034d58bfabd555df9f65f691204b7c46db24038da101&quot;,&quot;themeCssSha256&quot;:&quot;c80287a78d80ad63d27bd5ca348b2ef9a7e2f44da289e436be6484ea28a1b033&quot;}" adapterVersions="{&quot;diagramGenerator&quot;:&quot;2&quot;,&quot;drawioFlowchart&quot;:&quot;1&quot;,&quot;drawioGantt&quot;:&quot;1&quot;,&quot;drawioSequence&quot;:&quot;1&quot;,&quot;drawioState&quot;:&quot;1&quot;}" mermaidType="flowchart" direction="LR" generatedAt="2026-08-12T23:36:54.944Z" mermaidSource="flowchart LR&#10;  Call[&quot;client capability method&quot;]&#10;  Key[&quot;resolve apiKey&lt;br/&gt;eli_sk_ or eli_uk_&quot;]&#10;  Ws[&quot;resolve optional workspaceId&quot;]&#10;  Headers[&quot;Authorization: Bearer …&lt;br/&gt;X-Workspace-Id when configured&quot;]&#10;  Resolve[&quot;resolveAnyApiKey&quot;]&#10;  Scope{&quot;required scope?&quot;}&#10;  Capability{&quot;live role capability?&quot;}&#10;  RLS[&quot;withWorkspace()&lt;br/&gt;FORCE RLS&quot;]&#10;  Handler[&quot;/api/v1 handler&quot;]&#10;&#10;  Call --&gt; Key --&gt; Ws --&gt; Headers --&gt; Resolve&#10;  Resolve --&gt; Scope&#10;  Scope --&gt;|&quot;missing&quot;| E403[&quot;403 insufficient_scope&quot;]&#10;  Scope --&gt;|&quot;granted&quot;| Capability&#10;  Capability --&gt;|&quot;narrowed/revoked&quot;| C403[&quot;403 insufficient_capability&quot;]&#10;  Capability --&gt;|&quot;allowed&quot;| RLS --&gt; Handler">
          <mxCell parent="0"/>
        </object>
        <object id="n:Call" label="client capability method" mermaidId="Call" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="8" y="167.503906" width="236.515625" height="52" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Key" label="resolve apiKeyeli_sk_ or eli_uk_" mermaidId="Key" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="294.515625" y="155.503906" width="179.4375" height="76" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Ws" label="resolve optional workspaceId" mermaidId="Ws" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="523.953125" y="155.503906" width="256" height="76" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Headers" label="Authorization: Bearer …X-Workspace-Id when configured" mermaidId="Headers" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="829.953125" y="143.503906" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Resolve" label="resolveAnyApiKey" mermaidId="Resolve" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="1135.953125" y="167.503906" width="191.546875" height="52" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Scope" label="required scope?" mermaidId="Scope" mermaidShape="diamond">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;perimeter=rhombusPerimeter;shape=rhombus;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="1378" y="106.457031" width="174.09375" height="174.09375" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Capability" label="live role capability?" mermaidId="Capability" mermaidShape="diamond">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;perimeter=rhombusPerimeter;shape=rhombus;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="1676.132813" y="8" width="196.671875" height="196.671875" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:RLS" label="withWorkspace()FORCE RLS" mermaidId="RLS" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="2111.257813" y="11.335938" width="183.984375" height="76" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Handler" label="/api/v1 handler" mermaidId="Handler" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="2380.578125" y="23.335938" width="167.109375" height="52" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:E403" label="403 insufficient_scope" mermaidId="E403" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="1660.078125" y="254.671875" width="227.78125" height="52" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:C403" label="403 insufficient_capability" mermaidId="C403" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="2075.921875" y="137.335938" width="254.65625" height="52" as="geometry"/>
          </mxCell>
        </object>
        <object id="e:L_Call_Key_0" label="" mermaidId="L_Call_Key_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Call" target="n:Key" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="244.515625" y="193.503906" as="sourcePoint"/>
              <mxPoint x="294.515625" y="193.503906" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="269.515625" y="193.503906"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Key_Ws_0" label="" mermaidId="L_Key_Ws_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Key" target="n:Ws" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="473.953125" y="193.503906" as="sourcePoint"/>
              <mxPoint x="523.953125" y="193.503906" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="498.953125" y="193.503906"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Ws_Headers_0" label="" mermaidId="L_Ws_Headers_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Ws" target="n:Headers" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="779.953125" y="193.503906" as="sourcePoint"/>
              <mxPoint x="829.953125" y="193.503906" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="804.953125" y="193.503906"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Headers_Resolve_0" label="" mermaidId="L_Headers_Resolve_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Headers" target="n:Resolve" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1085.953125" y="193.503906" as="sourcePoint"/>
              <mxPoint x="1135.953125" y="193.503906" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1110.953125" y="193.503906"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Resolve_Scope_0" label="" mermaidId="L_Resolve_Scope_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Resolve" target="n:Scope" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1327.5" y="193.503906" as="sourcePoint"/>
              <mxPoint x="1377.5" y="193.503906" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1352.5" y="193.503906"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Scope_E403_0" label="missing" mermaidId="L_Scope_E403_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Scope" target="n:E403" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1518.380943" y="226.716713" as="sourcePoint"/>
              <mxPoint x="1660.078125" y="280.671875" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1605.835938" y="280.671875"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Scope_Capability_0" label="granted" mermaidId="L_Scope_Capability_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Scope" target="n:Capability" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1518.380943" y="160.291099" as="sourcePoint"/>
              <mxPoint x="1675.632813" y="106.335938" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1605.835938" y="106.335938"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Capability_C403_0" label="narrowed/revoked" mermaidId="L_Capability_C403_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Capability" target="n:C403" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1851.146946" y="127.493679" as="sourcePoint"/>
              <mxPoint x="2075.921875" y="163.335938" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1981.890625" y="163.335938"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_Capability_RLS_0" label="allowed" mermaidId="L_Capability_RLS_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:Capability" target="n:RLS" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1851.146946" y="85.178196" as="sourcePoint"/>
              <mxPoint x="2111.257813" y="49.335938" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="1981.890625" y="49.335938"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_RLS_Handler_0" label="" mermaidId="L_RLS_Handler_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:RLS" target="n:Handler" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="2295.242188" y="49.335938" as="sourcePoint"/>
              <mxPoint x="2380.578125" y="49.335938" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="2355.578125" y="49.335938"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
