Skip to content

Enforce per-account rate limit for new developer profile creation - #184

Merged
admdly merged 3 commits into
mainfrom
codex/implement-product-policy-for-profile-creation
Aug 5, 2026
Merged

Enforce per-account rate limit for new developer profile creation#184
admdly merged 3 commits into
mainfrom
codex/implement-product-policy-for-profile-creation

Conversation

@admdly

@admdly admdly commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

  • Add an allowCreationAttempt callback parameter to DevelopersDatabase.upsertOwn that is consulted only when creating a brand-new profile and return error code PROFILE_CREATION_RATE_LIMITED when disallowed.
  • Invoke the Cloudflare rate limiter from the route handler by passing a callback that calls c.env.PROFILE_CREATION_RATE_LIMITER.limit({ key: auth.userId }), map PROFILE_CREATION_RATE_LIMITED to HTTP 429, and set a Retry-After: 60 header on that response.
  • Update the OpenAPI response description for 429 and add the PROFILE_CREATION_RATE_LIMITER binding to worker-configuration.d.ts as well as a ratelimits entry in wrangler.jsonc.
  • Add test helper freshProfileCreationRateLimiter() and two tests to test/services/extensions/v2/index.test.ts that verify per-account creation limits and that profile updates do not consume creation allowance.

@admdly admdly self-assigned this Aug 5, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 5, 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 07bae9e Commit Preview URL

Branch Preview URL
Aug 05 2026, 06:12 AM

…ct-policy-for-profile-creation

# Conflicts:
#	src/services/extensions/v2/index.ts
#	worker-configuration.d.ts
@admdly
admdly marked this pull request as ready for review August 5, 2026 06:00

@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/developer-profile-routes.ts

@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).

Requires human review: Introduces a new per-account rate limit with threshold (3 per 60s) and a new Cloudflare binding. The operational tradeoff of these parameters requires human review to confirm appropriateness.

Re-trigger cubic

@admdly
admdly merged commit 583cc57 into main Aug 5, 2026
9 checks passed
@admdly
admdly deleted the codex/implement-product-policy-for-profile-creation branch August 5, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant