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>Configuration Priority</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: 960px; 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: 800px; display: block; }
    @media print {
      .diagram-container { overflow-x: visible; }
      svg { min-width: 0; }
    }
  </style>
</head>
<body>
  <div class="frame">
    <p class="eyebrow">Layer Stack · Configuration</p>
    <h1>Configuration Source Priority</h1>

    <div class="diagram-container">
      <svg viewBox="0 0 860 420" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="config-priority-title config-priority-desc">
        <title id="config-priority-title">Configuration Source Priority</title>
        <desc id="config-priority-desc">Three-layer configuration merge stack: environment variables override TOML file, which overrides code defaults. Merge flows top to bottom.</desc>
        <defs>
          <marker id="arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0, 8 3, 0 6" fill="#4a5568"/></marker>
        </defs>

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

        <!-- Merge direction indicator (left margin) -->
        <text x="40" y="200" fill="#4a5568" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.10em">MERGE</text>
        <path d="M 40 210 V 290" fill="none" stroke="#4a5568" stroke-width="1.2" marker-end="url(#arrow)"/>

        <!-- Layer 1: Environment Variables (focal — highest priority) -->
        <rect x="80" y="60" width="700" height="96" rx="8" fill="rgba(192,57,43,0.08)" stroke="#c0392b" stroke-width="1.4"/>
        <text x="104" y="92" fill="#c0392b" font-size="8" font-weight="500" font-family="'Geist Mono', monospace" letter-spacing="0.14em">HIGH</text>
        <text x="104" y="120" fill="#1a2332" font-size="16" font-weight="600" font-family="'Geist', sans-serif">Environment Variables</text>
        <text x="104" y="142" fill="#4a5568" font-size="10" font-family="'Geist Mono', monospace">GARRISON_TIMEOUT · GARRISON_JWT_SECRET · GARRISON_REDIS_URL</text>

        <!-- Layer 2: TOML File -->
        <rect x="80" y="188" width="700" height="88" rx="8" fill="#ffffff" stroke="#1a2332" stroke-width="1"/>
        <text x="104" y="216" fill="#4a5568" font-size="8" font-weight="500" font-family="'Geist Mono', monospace" letter-spacing="0.14em">MED</text>
        <text x="104" y="242" fill="#1a2332" font-size="16" font-weight="600" font-family="'Geist', sans-serif">TOML File</text>
        <text x="104" y="262" fill="#4a5568" font-size="10" font-family="'Geist Mono', monospace">garrison.toml — loaded via GarrisonConfig::load()</text>

        <!-- Layer 3: Code Defaults -->
        <rect x="80" y="308" width="700" height="88" rx="8" fill="rgba(26,35,50,0.04)" stroke="#4a5568" stroke-width="1"/>
        <text x="104" y="336" fill="#4a5568" font-size="8" font-weight="500" font-family="'Geist Mono', monospace" letter-spacing="0.14em">LOW</text>
        <text x="104" y="362" fill="#1a2332" font-size="16" font-weight="600" font-family="'Geist', sans-serif">Code Defaults</text>
        <text x="104" y="382" fill="#4a5568" font-size="10" font-family="'Geist Mono', monospace">GarrisonConfig::default_config()</text>

        <!-- Merge arrows between layers -->
        <line x1="430" y1="156" x2="430" y2="184" stroke="#4a5568" stroke-width="1.2" marker-end="url(#arrow)"/>
        <line x1="430" y1="276" x2="430" y2="304" stroke="#4a5568" stroke-width="1.2" marker-end="url(#arrow)"/>
      </svg>
    </div>
  </div>
</body>
</html>