Skip to content

feat!: regenerate PHP SDK from the OpenAPI spec#351

Merged
gjtorikian merged 27 commits intonext-majorfrom
oagen
Apr 9, 2026
Merged

feat!: regenerate PHP SDK from the OpenAPI spec#351
gjtorikian merged 27 commits intonext-majorfrom
oagen

Conversation

@gjtorikian
Copy link
Copy Markdown
Contributor

Description

This branch brings the PHP SDK onto the new v5 surface and runtime.

  • regenerate the SDK around an instantiated WorkOS client with lazy product/service accessors instead of direct top-level class construction
  • replace the legacy curl/request-client stack with a Guzzle-backed HttpClient, RequestOptions, retry behavior, and granular exception types with request metadata
  • replace PaginatedResource and destructured list responses with typed PaginatedResponse models plus auto-pagination helpers
  • migrate the SDK to generated typed request/response/resource models, including stricter enums and DateTimeImmutable hydration
  • rename and reorganize major product areas called out in the migration guide, including RBAC -> authorization(), Portal -> adminPortal(), MFA -> multiFactorAuth(), session helpers -> SessionManager, and separate webhook CRUD from verification
  • add the new v5 service surface, including apiKeys(), connect(), events(), featureFlags(), organizationDomains(), pipes(), radar(), actions(), pkce(), expanded vault(), and session management helpers
  • bump runtime requirements to PHP 8.2+, add Guzzle, and update the hand-maintained modules/tests to the new generated layout
  • add docs/V5_MIGRATION_GUIDE.md to document the breaking changes and upgrade path from v4

Validation:

  • composer test
  • composer typecheck

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[x] Yes

Migration details are included in docs/V5_MIGRATION_GUIDE.md. External docs and code snippets should be updated to match the v5 client architecture and renamed APIs before release.

gjtorikian and others added 12 commits April 1, 2026 12:10
…ookVerification, Actions, SessionManager, PKCEHelper)

Adds all missing non-spec endpoint handlers and helper modules:
- Passwordless: createSession, sendSession
- Vault: 10 KV/key endpoints + client-side AES-GCM encrypt/decrypt
- WebhookVerification: verifyEvent, verifyHeader, signature primitives (H01, H02)
- Actions: verifyHeader, constructAction, signResponse (H03)
- SessionManager: seal/unseal, session auth, refresh, JWKS (H04-H07, H13)
- PKCEHelper: PKCE utilities, AuthKit/SSO PKCE URLs, code exchange, public client factory (H08-H11, H15, H16, H19)

All files marked with @oagen-ignore-file to survive regeneration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Actions, WebhookVerification: suppress property.onlyWritten for $client
  (reserved for future HTTP endpoints)
- SessionManager: use strict base64_decode to fix always-false comparison

Also includes regenerated WorkOS.php with non-spec service accessors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
HttpClient, PaginatedResponse, RequestOptions, exception hierarchy,
Webhook/WebhookResponse utilities, and TestHelper are now hand-maintained
and will no longer be overwritten by oagen regeneration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Eliminates the deprecation warning about config file detection when
passing '.' as a path argument.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously 13 tests were skipped due to complex parameter requirements
or missing fixtures. All tests now pass with proper model construction
and complete fixture coverage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gjtorikian gjtorikian requested review from a team as code owners April 6, 2026 16:30
@gjtorikian gjtorikian requested review from mthadley and removed request for a team April 6, 2026 16:30
@gjtorikian gjtorikian changed the title feat!: regenerate PHP SDK for the v5 client architecture feat!: regenerate PHP SDK from the OpenAPI spec Apr 6, 2026
@birdcar birdcar self-requested a review April 9, 2026 18:39
Copy link
Copy Markdown
Contributor

@birdcar birdcar left a comment

Choose a reason for hiding this comment

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

I took a look at this and ran it through it's paces / was involved in suggested fixes along the way.

I vote ship it :shipit:

@gjtorikian gjtorikian merged commit 8445d41 into next-major Apr 9, 2026
8 checks passed
@gjtorikian gjtorikian deleted the oagen branch April 9, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants