praetor 0.2.0

A small, strongly typed authorization library for Rust built around composable can and cannot rules.
Documentation
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Praetor — strongly typed authorization for Rust</title>
  <meta name="description" content="Praetor is a small, strongly typed authorization library for Rust built around composable can and cannot rules. It composes rules, matches them, and returns a decision." />
  <meta name="theme-color" content="#0a0a0a" />
  <link rel="icon" href="assets/favicon.ico" sizes="any" />
  <link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png" />
  <link rel="icon" type="image/png" sizes="16x16" href="assets/favicon-16x16.png" />
  <link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon.png" />
  <meta property="og:title" content="Praetor — strongly typed authorization for Rust" />
  <meta property="og:description" content="A small, strongly typed authorization library for Rust built around composable can and cannot rules." />
  <meta property="og:image" content="assets/logo.png" />
  <meta property="og:type" content="website" />
  <link rel="stylesheet" href="css/styles.css" />
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" />
</head>
<body>
  <!-- top navigation -->
  <header class="nav">
    <div class="wrap">
      <a class="brand" href="index.html">
        <img src="assets/logo.png" alt="" />
        <span>Praetor</span>
      </a>
      <nav class="nav-links">
        <a href="index.html" class="active">Home</a>
        <a href="getting-started.html">Guide</a>
        <a href="https://docs.rs/praetor" target="_blank" rel="noopener">API</a>
        <a class="nav-gh" href="https://github.com/chrisfrazier0/praetor" target="_blank" rel="noopener" aria-label="GitHub">
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8a8 8 0 0 0 5.47 7.59c.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8 8 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg>
          <span>GitHub</span>
        </a>
      </nav>
    </div>
  </header>

  <main>
    <!-- hero -->
    <section class="hero">
      <div class="wrap">
        <img class="hero-logo" src="assets/logo.png" alt="Praetor" />
        <h1>Praetor</h1>
        <p class="hero-tagline">Strongly typed authorization for Rust.</p>
        <p class="hero-sub">A small library built around composable <code>can</code> and <code>cannot</code> rules. It composes rules, matches them, and returns a decision — nothing more.</p>
        <div class="hero-cta">
          <a class="btn btn-primary" href="getting-started.html">Get started →</a>
          <a class="btn btn-ghost" href="https://github.com/chrisfrazier0/praetor" target="_blank" rel="noopener">
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8a8 8 0 0 0 5.47 7.59c.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8 8 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg>
            View on GitHub
          </a>
        </div>
        <div class="flow">
          <b>claims</b> + <b>rules</b> + <b>action</b> + <b>subject/resource</b>
          <span class="arrow">→</span>
          <span class="allow">allow</span> / <span class="deny">deny</span>
        </div>
      </div>
    </section>

    <!-- what is praetor -->
    <section class="section" id="about">
      <div class="wrap center">
        <p class="label">Mechanics, not model</p>
        <h2>Praetor owns the rules. Your app owns the model.</h2>
        <p class="section-lead">Actions, subjects, claims, roles, permissions, and JWT formats all stay in your application. Praetor defines authorization <em>mechanics</em> — it composes rules, matches an action against a subject or a concrete resource, and returns an allow / deny decision. Authorization is a pure, in-memory operation.</p>
      </div>
    </section>

    <!-- evaluation semantics -->
    <section class="section" id="semantics">
      <div class="wrap center">
        <p class="label">Evaluation semantics</p>
        <h2>Two rules you never have to guess about</h2>
        <div class="split" style="margin-top:34px; text-align:left">
          <div class="rulecard">
            <h3>Default deny</h3>
            <p>If no rule matches a request, the decision is <b>deny</b>. Nothing is permitted implicitly — you grant access on purpose.</p>
          </div>
          <div class="rulecard">
            <h3>Last matching rule wins</h3>
            <p>Rules are evaluated in reverse, so later rules override earlier ones. A <code>cannot_if</code> after a broad <code>can</code> carves out an exception cleanly.</p>
          </div>
        </div>
      </div>
    </section>

    <!-- final CTA -->
    <section class="section cta-final" id="start">
      <div class="wrap">
        <p class="label">Ready?</p>
        <h2>Compose your first ability in minutes.</h2>
        <div class="hero-cta">
          <a class="btn btn-primary" href="getting-started.html">Get started →</a>
          <a class="btn btn-ghost" href="https://crates.io/crates/praetor" target="_blank" rel="noopener">View on crates.io</a>
        </div>
      </div>
    </section>
  </main>

  <footer>
    <div class="wrap">
      <span>Praetor — authorization mechanics for Rust.</span>
      <span>Made with <span class="heart">&#10084;</span> by Chris Frazier · <a href="https://github.com/chrisfrazier0/praetor" target="_blank" rel="noopener">GitHub</a> · <a href="https://docs.rs/praetor" target="_blank" rel="noopener">docs.rs</a></span>
    </div>
  </footer>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/rust.min.js"></script>
  <script src="js/main.js"></script>
</body>
</html>