feat: Descope service, SDK library, and generic snapshot explorer#13
Closed
feat: Descope service, SDK library, and generic snapshot explorer#13
Conversation
Covers Python artifacts (__pycache__, .venv, .pytest_cache), Rust target/, IDE files, and .doubleagent.env config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Core SDK providing the stateful fake server infrastructure: - StateOverlay: copy-on-write state with immutable baseline + mutable overlay - NamespaceRouter: per-agent isolation via X-DoubleAgent-Namespace header - WebhookSimulator: async webhook delivery with retry and HMAC signatures - SnapshotConnector: abstract interface for snapshot pulling - AirbyteAdapter: wraps 300+ Airbyte Docker connectors for snapshot pulls - PiiRedactor: deterministic PII replacement before writing to disk - ReadOnlyHttpClient: GET/HEAD-only HTTP with SSRF protection - DualTargetValidator: run same tests against fake + real API Includes unit tests for all modules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Full stateful fake of the Descope Management + Auth API: Server (870+ lines): - User CRUD with search, status management, roles, tenants - Tenant and role management with full CRUD - Token exchange, OTP simulation, JWKS endpoint - Password hashing, JWT signing with auto-generated RSA keys - All standard /_doubleagent control-plane endpoints Contract tests (30 tests, all passing): - test_users: CRUD, search, status, role assignment - test_tenants: CRUD, member management - test_roles: CRUD with permission management - test_tokens: JWT exchange, OTP flow, JWKS validation - test_snapshots: seed/reset/bootstrap state management Fixtures: - startup.yaml: minimal seed (1 user, 1 tenant, 1 role) - enterprise.yaml: full org (5 users, 3 tenants, 4 roles) Connector: - DescopeConnector with schema discovery - Returns empty data for POST-only APIs (documented) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a generic read-only server that can serve any Airbyte-pulled
snapshot data as a REST API. This enables services that have an
Airbyte connector but no custom fake server (Jira, Salesforce, etc.)
to be started and queried immediately.
Generic server endpoints:
- GET /resources → list available resource types
- GET /resources/{type} → list resources with filtering (?q=field=value)
- GET /resources/{type}/{id} → get single resource by ID
- All standard /_doubleagent/* control-plane endpoints
Wires up Jira and Salesforce to use the generic server:
- services/jira/service.yaml → server command uses generic_server
- services/salesforce/service.yaml → same
- Both include .mise.toml and server/pyproject.toml for dependencies
Usage:
doubleagent start jira
curl localhost:8080/_doubleagent/health
curl -X POST localhost:8080/_doubleagent/seed \
-d '{"projects": {"P1": {"id": "P1", "name": "Test"}}}'
curl localhost:8080/resources/projects
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… snapshots Adds PyAirbyte backend (no Docker required) and smart relational filtering so snapshot pulls produce small, relationally-consistent datasets instead of brute-force full-stream dumps. New modules: - smart_filter.py: breadth-first relational graph traversal (projects → issues → comments) - pyairbyte_backend.py: wraps PyAirbyte's get_source/get_records API - airbyte_pull.py: rewritten CLI entry point with dual backend + smart filter Rust CLI: - ConnectorConfig gains seeding/backend fields - snapshot pull passes --seeding-json and --backend to Python subprocess Service configs: - Jira: 3 projects → issues/sprints/boards/comments with per-parent limits - Salesforce: 5 accounts → contacts/opportunities/cases 12 unit tests passing, 3 integration tests (skipped without airbyte pkg). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Superseded by 3 focused, stacked PRs:
PRs #15 and #16 are based on #14. Merge #14 first, then #15 and #16 can merge in parallel. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds three major components to DoubleAgent:
1.
doubleagent-sdkPython Library (services/_lib/)The shared SDK that all service fakes depend on:
X-DoubleAgent-Namespaceheader2. Descope Identity Management Service (
services/descope/)Full stateful fake of the Descope Management + Auth API:
startup.yaml(minimal) +enterprise.yaml(full org)3. Generic Snapshot Explorer (
generic_server.py+ Jira/Salesforce)A read-only server for Airbyte-backed services that don't have custom fakes yet:
GET /resources/{type}andGET /resources/{type}/{id}?q=field=value/_doubleagent/*control-plane endpointsThis enables the full Airbyte → DoubleAgent pipeline:
Also
.gitignorefor Python/Rust/IDE artifactsTest plan
pytest services/descope/contracts/)🤖 Generated with Claude Code