Skip to content

🔒 [P1] Add authentication to uteke-serve HTTP API #133

Closed

Description

@ajianaz

Problem

uteke-serve exposes a full HTTP API with no authentication. Anyone who can reach the server can:

  • Read all stored memories
  • Write new memories
  • Delete existing memories
  • Access namespace data

Current CORS Setting

CORS is enabled (for browser/extension access) but without any auth, CORS is irrelevant.

Proposed Solution

Option A: API key auth (simple, recommended for v0.0.6)

  • Generate random API key on first server start, stored in ~/.uteke/server.key
  • All requests require Authorization: Bearer <key> header
  • Configurable via uteke.toml [server] api_key
  • Option to disable auth for local-only use (127.0.0.1 binding)

Option B: mTLS (for later)

  • Client certificates for mutual TLS
  • More complex but stronger security

Config Addition

[server]
host = "0.0.0.0"
port = 8420
auth_enabled = true  # default: true if host != 127.0.0.1

Acceptance Criteria

  • API key generated on first server start (auto-created, printed to stdout)
  • All endpoints require valid Authorization header when auth enabled
  • /health endpoint remains unauthenticated (for monitoring)
  • Config option to disable auth for local-only deployments
  • API key stored securely (0600 permissions)
  • Error response: 401 Unauthorized (no key leakage)
  • Documentation updated

Effort: ~1-2 days

Activity

  1. added
    priority:high
    type:feature
    enhancement
    v0.0.14
    and removed
    type:feature
    on Jun 9, 2026
  2. modified the milestones: v0.0.8 — Architecture & Security, on Jun 11, 2026
  3. added
    type:security
    on Jun 11, 2026
  4. ajianaz commented on Jun 11, 2026

    @ajianaz
    CollaboratorAuthor

    Authentication is already implemented in v0.0.13+ via --auth-token flag, UTEKE_AUTH_TOKEN env var, and uteke.toml [server] auth_token. All endpoints except GET /health require Authorization: Bearer \<token>. Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:highscope:integrationsecuritytype:securityv0.0.14

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions