feat(generated)!: regenerate from spec (9 changes)#263
feat(generated)!: regenerate from spec (9 changes)#263workos-sdk-automation[bot] wants to merge 10 commits into
Conversation
Greptile SummaryThis is an auto-generated spec-sync PR adding 9 feature changes: new webhook event types (
Confidence Score: 3/5The Vault Get methods now return a type that cannot deserialise the nested metadata fields from the actual API response, causing silent data loss for any caller reading EnvironmentId, KeyId, VersionId, or UpdatedBy after a GetNameAsync/GetKvAsync call. Most of the PR is a clean, well-patterned spec sync. The concern is in the Vault service: replacing Object (which had a proper ObjectMetadata property) with VaultObject (which maps metadata fields at the JSON root) against a response shape that nests those fields under metadata. The tests cover only Id, Name, Value and do not catch the metadata loss. src/WorkOS.net/Services/Vault/VaultService.cs and src/WorkOS.net/Entities/VaultObject.cs — confirm whether the Get endpoint response nests metadata or returns flat fields, and update the mapping accordingly. Important Files Changed
|
| case "dsync.token.created": target = new DsyncTokenCreated(); break; | ||
| case "dsync.token.revoked": target = new DsyncTokenRevoked(); break; | ||
| case "dsync.group.user_added": target = new DsyncGroupUserAdded(); break; |
There was a problem hiding this comment.
Out-of-order dsync.token entries
The two new dsync.token.* cases are inserted between dsync.group.updated and dsync.group.user_added, but alphabetically dsync.token.* sorts after dsync.user.*. An api_key.updated case was also added correctly in the already-sorted api_key.* block. For consistency with the rest of the switch (which appears to be lexicographically ordered), the new dsync.token.created and dsync.token.revoked cases should be placed after dsync.user.updated.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
|
||
| [Fact] | ||
| public async Task TestCreateExpireAsync() | ||
| { | ||
| var fixture = System.IO.File.ReadAllText("testdata/api_key.json"); | ||
| this.httpMock.MockResponse(HttpMethod.Post, "/api_keys/test_id/expire", HttpStatusCode.OK, fixture); | ||
| var result = await this.service.CreateExpireAsync("test_id", new ApiKeysCreateExpireOptions()); | ||
| Assert.NotNull(result); | ||
| Assert.Equal("api_key_01EHZNVPK3SFK441A1RGBFSHRT", result.Id); | ||
| Assert.Equal("Production API Key", result.Name); | ||
| Assert.Equal("sk_...3456", result.ObfuscatedValue); | ||
| this.httpMock.AssertRequestWasMade(HttpMethod.Post, "/api_keys/test_id/expire"); | ||
| } |
There was a problem hiding this comment.
Test uses
api_key.json instead of the newly added expire_api_key.json
TestCreateExpireAsync loads testdata/api_key.json as its mock response, but this PR also adds testdata/expire_api_key.json and testdata/expire_api_key_nulls.json. If those fixtures represent the actual /expire endpoint response shape ({"expires_at": "..."}) they are never exercised. If the real endpoint returns a full ApiKey object then the added fixtures are dead files. Either the test should use expire_api_key.json, or the unused fixtures should be removed.
Summary
feat(user_management): Remove return_to param from revoke session
UserManagementRevokeSessionOptions.ReturnTopropertyfeat(radar): Remove domain_sign_up_rate_limit control
RadarStandaloneResponseControl.DomainSignUpRateLimitenum valuefeat(vault): Replace Object with VaultObject
Objectclass from vault serviceVaultObjectclass inVaultService.GetNameAsync()andVaultService.GetKvAsync()return typesfeat(webhooks): Remove dsync.deactivated event
DsyncDeactivatedevent classDsyncDeactivatedDataandDsyncDeactivatedDataDomainevent payload classesDsyncDeactivatedDataTypeandDsyncDeactivatedDataStatefeat(api_keys): Make expires_at required in API key created/revoked events
ApiKeyCreatedData.expires_atfield is now required (previously optional)ApiKeyRevokedData.expires_atfield is now required (previously optional)feat(api_keys): Add expire endpoint and API key updated event
ApiKeysService.CreateExpireAsync()method to expire API keysApiKeysCreateExpireOptionsrequest options class with optionalExpiresAtparameterApiKeyUpdatedevent class andApiKeyUpdatedDataevent payloadApiKeyUpdatedDataPreviousAttributeto track previous expires_at valueapi_key.updatedfeat(webhooks): Add dsync token created/revoked events
DsyncTokenCreatedevent class andDsyncTokenCreatedDataevent payloadDsyncTokenRevokedevent class (reusesDsyncTokenCreatedDatapayload)dsync.token.createdanddsync.token.revokedfeat(user_management): Add name field to user models
namefield toUserclassnamefield toUserObjectclassnameparameter toCreateUserOptionsandUpdateUserOptionsnamefield toEmailChangeConfirmationUserfeat(webhooks): Add Snowflake log stream type
Snowflakeenum value toAuditLogConfigurationLogStreamTypeAPI_KEY_UPDATEDandapi_key.updatedwebhook event typesTriggered by workos/openapi-spec@dee95fc
BEGIN_COMMIT_OVERRIDE
feat(user_management): Remove return_to param from revoke session (#263)
feat(radar): Remove domain_sign_up_rate_limit control (#263)
feat(vault): Replace Object with VaultObject (#263)
feat(webhooks): Remove dsync.deactivated event (#263)
feat(api_keys): Make expires_at required in API key created/revoked events (#263)
feat(api_keys): Add expire endpoint and API key updated event (#263)
feat(webhooks): Add dsync token created/revoked events (#263)
feat(user_management): Add name field to user models (#263)
feat(webhooks): Add Snowflake log stream type (#263)
END_COMMIT_OVERRIDE