garrison 0.9.0

Garrison - 面向 Rust 生态的一站式身份认证鉴权框架
Documentation
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>API Structure</title>
  <link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&family=Noto+Sans+TC:wght@400;500;600&display=swap" rel="stylesheet">
  <style>
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --color-paper:   #f5f5f5;
      --color-ink:     #1a2332;
      --color-muted:   #4a5568;
      --color-accent:  #c0392b;
      --color-link:    #2c5282;
      --font-sans:     'Geist', system-ui, sans-serif;
      --font-serif:    'Instrument Serif', serif;
      --font-mono:     'Geist Mono', ui-monospace, monospace;
    }
    body {
      font-family: var(--font-sans);
      background: var(--color-paper);
      color: var(--color-ink);
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 3rem 2rem;
    }
    .frame { max-width: 1000px; width: 100%; }
    .diagram-container { width: 100%; overflow-x: auto; }
    .eyebrow {
      font-family: var(--font-mono);
      font-size: 0.66rem;
      font-weight: 500;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--color-muted);
      margin-bottom: 0.5rem;
    }
    h1 {
      font-family: var(--font-serif);
      font-size: clamp(1.5rem, 2.4vw + 0.75rem, 2rem);
      font-weight: 400;
      letter-spacing: -0.02em;
      line-height: 1.15;
      color: var(--color-ink);
      margin-bottom: 1.5rem;
    }
    svg { width: 100%; min-width: 860px; display: block; }
    @media print {
      .diagram-container { overflow-x: visible; }
      svg { min-width: 0; }
    }
  </style>
</head>
<body>
  <div class="frame">
    <p class="eyebrow">Tree · API Structure</p>
    <h1>Garrison Public API Overview</h1>

    <div class="diagram-container">
      <svg viewBox="0 0 920 560" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="api-structure-title api-structure-desc">
        <title id="api-structure-title">Garrison Public API Overview</title>
        <desc id="api-structure-desc">Tree diagram showing Garrison root branching to eight top-level API modules: GarrisonManager, GarrisonUtil, GarrisonInterface, GarrisonDao, GarrisonContext, Annotations, Plugin, and Listener.</desc>

        <rect width="100%" height="100%" fill="#f5f5f5"/>

        <!-- Connectors (drawn first) -->
        <!-- Root → GarrisonManager -->
        <path d="M 460 100 V 128 H 112 V 160" fill="none" stroke="#4a5568" stroke-width="1"/>
        <!-- Root → GarrisonUtil -->
        <path d="M 460 100 V 160" fill="none" stroke="#4a5568" stroke-width="1"/>
        <!-- Root → GarrisonInterface -->
        <path d="M 460 100 V 128 H 400 V 160" fill="none" stroke="#4a5568" stroke-width="1"/>
        <!-- Root → GarrisonDao -->
        <path d="M 460 100 V 128 H 540 V 160" fill="none" stroke="#4a5568" stroke-width="1"/>
        <!-- Root → GarrisonContext -->
        <path d="M 460 100 V 128 H 700 V 160" fill="none" stroke="#4a5568" stroke-width="1"/>
        <!-- Root → Annotations -->
        <path d="M 460 100 V 128 H 860 V 160" fill="none" stroke="#4a5568" stroke-width="1"/>
        <!-- GarrisonUtil → Plugin -->
        <path d="M 400 200 V 228 H 240 V 260" fill="none" stroke="#4a5568" stroke-width="1"/>
        <!-- GarrisonUtil → Listener -->
        <path d="M 460 200 V 260" fill="none" stroke="#4a5568" stroke-width="1"/>

        <!-- Root node -->
        <rect x="396" y="64" width="128" height="36" rx="6" fill="#1a2332"/>
        <text x="460" y="86" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Garrison</text>

        <!-- Tier 1: GarrisonManager -->
        <rect x="48" y="160" width="128" height="40" rx="6" fill="#ffffff" stroke="#1a2332" stroke-width="1"/>
        <text x="112" y="184" fill="#1a2332" font-size="11" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">GarrisonManager</text>

        <!-- Tier 1: GarrisonUtil (focal) -->
        <rect x="400" y="160" width="120" height="40" rx="6" fill="rgba(192,57,43,0.08)" stroke="#c0392b" stroke-width="1.4"/>
        <text x="460" y="184" fill="#1a2332" font-size="11" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">GarrisonUtil</text>

        <!-- Tier 1: GarrisonInterface -->
        <rect x="336" y="160" width="128" height="40" rx="6" fill="#ffffff" stroke="#1a2332" stroke-width="1"/>
        <text x="400" y="184" fill="#1a2332" font-size="11" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Interface</text>

        <!-- Tier 1: GarrisonDao -->
        <rect x="480" y="160" width="120" height="40" rx="6" fill="#ffffff" stroke="#1a2332" stroke-width="1"/>
        <text x="540" y="184" fill="#1a2332" font-size="11" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">GarrisonDao</text>

        <!-- Tier 1: GarrisonContext -->
        <rect x="640" y="160" width="120" height="40" rx="6" fill="#ffffff" stroke="#1a2332" stroke-width="1"/>
        <text x="700" y="184" fill="#1a2332" font-size="11" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Context</text>

        <!-- Tier 1: Annotations -->
        <rect x="808" y="160" width="104" height="40" rx="6" fill="#ffffff" stroke="#1a2332" stroke-width="1"/>
        <text x="860" y="184" fill="#1a2332" font-size="11" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Annotations</text>

        <!-- Tier 2: Plugin -->
        <rect x="180" y="260" width="120" height="40" rx="6" fill="#ffffff" stroke="#1a2332" stroke-width="1"/>
        <text x="240" y="284" fill="#1a2332" font-size="11" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Plugin</text>

        <!-- Tier 2: Listener -->
        <rect x="400" y="260" width="120" height="40" rx="6" fill="#ffffff" stroke="#1a2332" stroke-width="1"/>
        <text x="460" y="284" fill="#1a2332" font-size="11" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Listener</text>

        <!-- Tier 1 sublabels -->
        <text x="112" y="216" fill="#4a5568" font-size="9" font-family="'Geist Mono', monospace" text-anchor="middle">builder · init</text>
        <text x="460" y="216" fill="#4a5568" font-size="9" font-family="'Geist Mono', monospace" text-anchor="middle">login · logout · check</text>
        <text x="400" y="216" fill="#4a5568" font-size="9" font-family="'Geist Mono', monospace" text-anchor="middle">callback trait</text>
        <text x="540" y="216" fill="#4a5568" font-size="9" font-family="'Geist Mono', monospace" text-anchor="middle">storage trait</text>
        <text x="700" y="216" fill="#4a5568" font-size="9" font-family="'Geist Mono', monospace" text-anchor="middle">request context</text>
        <text x="860" y="216" fill="#4a5568" font-size="9" font-family="'Geist Mono', monospace" text-anchor="middle">13 macros</text>

        <!-- Tier 2 sublabels -->
        <text x="240" y="316" fill="#4a5568" font-size="9" font-family="'Geist Mono', monospace" text-anchor="middle">inventory::submit!</text>
        <text x="460" y="316" fill="#4a5568" font-size="9" font-family="'Geist Mono', monospace" text-anchor="middle">31 event variants</text>

        <!-- Annotations detail box -->
        <rect x="736" y="260" width="176" height="80" rx="6" fill="#ffffff" stroke="#1a2332" stroke-width="1"/>
        <text x="748" y="280" fill="#4a5568" font-size="8" font-weight="500" font-family="'Geist Mono', monospace" letter-spacing="0.10em">13 ATTRIBUTE MACROS</text>
        <text x="748" y="300" fill="#1a2332" font-size="10" font-family="'Geist', sans-serif">check_login · check_role</text>
        <text x="748" y="316" fill="#1a2332" font-size="10" font-family="'Geist', sans-serif">check_permission · check_api_key</text>
        <text x="748" y="332" fill="#1a2332" font-size="10" font-family="'Geist', sans-serif">check_disable · check_mfa · check_abac</text>
      </svg>
    </div>
  </div>
</body>
</html>