Skip to content

Require fresh GitHub organization evidence - #171

Merged
admdly merged 2 commits into
mainfrom
agent/require-fresh-github-org-evidence
Jul 31, 2026
Merged

Require fresh GitHub organization evidence#171
admdly merged 2 commits into
mainfrom
agent/require-fresh-github-org-evidence

Conversation

@admdly

@admdly admdly commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Require a still-valid central-auth expiry before using stored GitHub organization memberships for developer ownership verification.

Root cause

The API previously treated any parseable users.github_orgs JSON as current evidence. That allowed a copied organization list to remain usable after the auth service could no longer vouch for its freshness.

Changes

  • Extend the read-only external users table definition with github_orgs_expires_at.
  • Return organization memberships only when the absolute expiry parses and is in the future.
  • Treat missing, malformed, or expired organization metadata as an empty membership list.
  • Keep github_login independent so username verification continues to work.
  • Update the D1 test schema and fixtures.
  • Add regressions for fresh organization evidence, expired/missing expiry, fresh confirmed-empty lists, and unaffected username verification.

Historical developers.github_org_verified rows are not automatically expired by this change; only new verification and existing re-verification paths use fresh organization evidence.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
api 65a7172 Commit Preview URL

Branch Preview URL
Jul 31 2026, 08:27 AM

@admdly admdly self-assigned this Jul 31, 2026
@admdly
admdly marked this pull request as ready for review July 31, 2026 08:05

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/services/extensions/v2/users-database.ts

admdly commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up: malformed expiry validation

Validated the reported issue. Before the fix, the new regression using github_orgs_expires_at: "2099" received HTTP 200 because Date.parse("2099") returns a future timestamp.

Fix in 65a7172:

  • Require the expiry string to match the RFC3339 date-time shape before parsing.
  • Keep the existing future-time check.
  • Add the malformed-"2099" regression alongside expired and missing expiry cases.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Auto-approved: Adds expiry check to GitHub org membership evidence, requiring future RFC3339 timestamp. Fixes stale data reuse; bounded and clearly beneficial.

Re-trigger cubic

@admdly
admdly merged commit 948ae7e into main Jul 31, 2026
9 checks passed
@admdly
admdly deleted the agent/require-fresh-github-org-evidence branch July 31, 2026 08:32
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