Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Problem
Krater keeps its own copy of some member data from Weave in the users table: email, email_verified and display_name. Weave is the place that stores member data. Each copy is more risk, can go out of date, and must be found when a member asks us to delete their data.
Where Krater uses these fields today:
| Use | File | Can it use the sub or Weave instead? |
|---|---|---|
| Find a Slack user by email | krater/services/slack_membership.py, krater/services/slack_notify.py |
Yes. Krater already asks for the slack scope, so it gets slack_id from Weave |
Show the actor in the audit log (actor_name) |
krater/web/routers/projects.py |
Yes. Store the actor's sub and get the name from Weave when the page shows it |
| Session display name | krater/web/routers/auth.py |
Yes. Take it from the ID token at sign-in. Keep it in the session only |
| Add builders to a project by email | krater/web/forms.py, krater/web/routers/projects.py |
Partly. Find the user with the Weave directory API, then store only the sub |
| SkyPilot allowlist | krater/services/skypilot_sync.py |
No for now. SkyPilot signs in through oauth2-proxy and knows users by email. Read the email from the Weave directory API at sync time |
Proposal
- Use
slack_idfrom Weave for Slack lookups. - Store the actor
subin audit records, not the actor name. Do not change old rows, because the audit log is append-only. - Read email and name from the Weave directory API (
/api/v1/directory/users/:sub) when Krater needs them. Cache them in memory for a short time only. - Drop
email,email_verifiedanddisplay_namefromuserswith an Alembic migration.
flowchart LR
K[Krater] -- "stores sub only" --> DB[(Krater DB)]
K -- "name, email, slack_id on demand" --> W[Weave directory API]
Done when
- No Krater table stores email, name or other member PII.
- Slack lookups use
slack_id. - Audit records store the actor
sub. - Tests pass with the stub Weave.
-
docs/weave-integration.mddescribes the rule.
Context: patchworklabsorg/internal-docs, "Member data" in patches.md.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
jaspermayone commentedon Oct 22, 2026
Done in #9 (de3df05). Krater stores only
users.weave_sub, plus Weave'sslack_idand cached roles. Migrationa7c1e5d9f2b4_stop_storing_member_datadropsemail,email_verifiedanddisplay_name. Names and emails come from the Weave directory throughkrater.services.people. Slack usesslack_idonly. Audit events storeactor_sub.docs/weave-integration.mdhas the "Member data" section. The full suite passes with the stub Weave.