Skip to content

feat/created-by: identity tracking, S3 key prefix, graceful S3 fallback - #2

Merged
glani merged 4 commits into
mainfrom
feat/created-by
May 1, 2026
Merged

feat/created-by: identity tracking, S3 key prefix, graceful S3 fallback#2
glani merged 4 commits into
mainfrom
feat/created-by

Conversation

@glani

@glani glani commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • created_by per entry — populated from JWT identity claim (auth.jwt.identity_claim, default sub) or matched auth.named_tokens entry name; null for anonymous/plain-token requests
  • auth.named_tokens — new config block for named static tokens (service accounts) that populate created_by
  • auth.jwt.required_scopes / auth.jwt.identity_claim — new JWT config knobs
  • Graceful S3 fallback — partial S3 config (missing bucket/region/credentials) no longer crashes startup; logs a warning and disables file tools only
  • s3.enabled: false / WORDSTORE_S3_ENABLED=false — explicit S3 kill switch for environments with leaky env vars
  • s3.key_prefix / WORDSTORE_S3_KEY_PREFIX — optional folder prefix for new S3 object keys; existing entries unaffected
  • CI: ci.yml runs on all branches; release.yml flavor: latest=auto so pre-release tags ship without moving latest
  • Pre-release images: ghcr.io/giglabo/watchword:1.4.0-alpha.1, 1.4.0-alpha.2 already published

Test plan

  • CI green on all commits (vet / staticcheck / test / build)
  • Smoke test v1.4.0-alpha.2 image: partial S3 env → server starts, file tools absent, warning in logs
  • Named token flow: created_by populated correctly on store_entry / get_entry
  • JWT flow: identity_claim: email populates created_by from JWT email claim
  • s3.key_prefix: new uploads land under prefix, existing entries download fine without prefix
  • Migration 004 applies cleanly on fresh PG and SQLite

🤖 Generated with Claude Code

glani added 3 commits May 1, 2026 16:36
Records the caller's identity on each stored entry, sourced from a JWT
identity claim (default sub, configurable via auth.jwt.identity_claim)
or the name of a matched named_tokens config entry. Unnamed static
tokens and disabled-auth requests remain anonymous.

Also extends release CI to publish docker images for pre-release
semver tags (e.g. v1.4.0-alpha.1) without moving the latest tag, and
runs ci.yml on all branches so feature branches get vet/test/build.
Partial S3 configuration (e.g. WORDSTORE_S3_REGION leaking from a
shared ConfigMap with no bucket or credentials) used to fail validate()
or os.Exit() in s3client.NewClient, taking the whole MCP server down
even though only the file tools depend on S3.

Now:
- validate() no longer requires bucket/region/proxy fields when the
  S3 block is non-nil; only defaults are applied.
- main.go skips file-tool init with a WARN log if bucket/region are
  missing or NewClient fails, then keeps the server running with the
  text-based tools.
- Proxy config is gated independently — missing hmac_secret/base_url
  disables only the proxy, presigned URLs still work.
- s3.enabled: false / WORDSTORE_S3_ENABLED=false remains as the
  explicit kill switch for environments that may leak partial S3 env.
Introduces optional s3.key_prefix (WORDSTORE_S3_KEY_PREFIX) to scope
all new file uploads under a folder within the bucket (e.g.
"tenants/acme/<uuid>/file"). Omitting the prefix preserves the existing
bucket-root layout. Existing entries keep their stored S3 key.

Also updates README features list and S3 section to document new
parameters and graceful fallback behaviour introduced in this branch.
@glani glani changed the title Track created_by identity per entry feat/created-by: identity tracking, S3 key prefix, graceful S3 fallback May 1, 2026
@glani
glani force-pushed the feat/created-by branch from 915ddcf to 2f55683 Compare May 1, 2026 19:46
@glani
glani merged commit 4adf3bc into main May 1, 2026
8 checks passed
@glani
glani deleted the feat/created-by branch May 1, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant