Skip to content

Conversation

@HughParry
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings November 18, 2025 11:24
@HughParry HughParry changed the title Feat/wip demo keys Demo keys Nov 18, 2025
@HughParry HughParry marked this pull request as draft November 18, 2025 11:25
@HughParry HughParry changed the title Demo keys Demo keys (Draft) Nov 18, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces demo keys functionality for testing and development purposes. Demo keys are hardcoded site keys that automatically pass or fail CAPTCHA verification, enabling developers to test success and failure flows without requiring complex provider setup.

Key Changes:

  • Added demo key utilities with "always pass" and "always fail" behaviors using Polkadot.js sr25519 well-known accounts (Alice and Eve)
  • Integrated demo key logic into PoW and image CAPTCHA verification flows with environment-based enablement controls
  • Updated PoW challenge ID schema to include a nonce component for uniqueness

Reviewed Changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
packages/types/src/datasets/captcha.ts Extended PoW challenge ID type to include nonce field; improved type safety in schema validation
packages/provider/src/utils/demoKeys.ts New utility for demo key management with environment-based controls and behavior detection
packages/provider/src/tests/unit/utils/demoKeys.unit.test.ts Comprehensive unit tests for demo key utility functions
packages/provider/src/tests/unit/tasks/powCaptcha/powTasks.unit.test.ts Updated PoW challenge ID format in tests to include nonce
packages/provider/src/tests/unit/tasks/client/clientTasks.unit.test.ts Updated test data to match new challenge ID format
packages/provider/src/tasks/powCaptcha/powTasks.ts Integrated demo key bypass logic into PoW verification
packages/provider/src/tasks/imgCaptcha/imgCaptchaTasks.ts Integrated demo key bypass logic into image CAPTCHA verification
packages/provider/src/api/captcha/submitPoWCaptchaSolution.ts Added demo key handling in PoW submission endpoint
packages/provider/src/api/captcha/submitImageCaptchaSolution.ts Added demo key handling in image CAPTCHA submission endpoint
packages/provider/src/api/captcha/getPoWCaptchaChallenge.ts Added demo key handling in PoW challenge generation endpoint
packages/provider/src/api/captcha/getFrictionlessCaptchaChallenge.ts Added demo key handling in frictionless challenge endpoint
packages/procaptcha-react/src/components/ProcaptchaWidget.tsx Integrated demo key banner display in React widget
packages/procaptcha-common/src/util/demoKeys.ts Client-side demo key detection utilities
packages/procaptcha-common/src/tests/demoKeys.test.ts Unit tests for client-side demo key utilities
packages/procaptcha-common/src/tests/DemoKeyBanner.test.tsx Tests for demo key warning banner component
packages/procaptcha-common/src/reactComponents/DemoKeyBanner.tsx Visual warning banner component for demo key usage
packages/procaptcha-common/src/index.ts Exports for demo key utilities and banner component
integration/frameworks/react/react-procaptcha-wrapper/project.json Formatting update to dependsOn arrays
demos/client-bundle-example/vite.config.ts Added demo key demo pages to build configuration
demos/client-bundle-example/src/plugins/navigation-injector.ts Added navigation for demo key pages
demos/client-bundle-example/src/demo-keys-always-pass.html Demo page showcasing always-pass behavior
demos/client-bundle-example/src/demo-keys-always-fail.html Demo page showcasing always-fail behavior
.changeset/funny-moments-remain.md Changeset documenting the demo keys feature addition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HughParry HughParry marked this pull request as ready for review January 27, 2026 10:47
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.

2 participants