Skip to content

Sync Go client with updated Control API spec#42

Closed
kennethkalmer wants to merge 1 commit intomainfrom
kenneth/sync-control-api-spec
Closed

Sync Go client with updated Control API spec#42
kennethkalmer wants to merge 1 commit intomainfrom
kenneth/sync-control-api-spec

Conversation

@kennethkalmer
Copy link
Copy Markdown
Member

Summary

Syncs this Go client library with the Control API spec changes from ably/docs#3306.

  • Add 7 new rule target types: aws/lambda/before-publish, http/before-publish, hive/text-model-only, hive/dashboard, bodyguard/text-moderation, tisane/text-moderation, azure/text-moderation
  • Add InvocationMode and BeforePublishConfig to support before-publish rule behavior
  • Add ChatRoomFilter to rule Source
  • Add APNs token-based auth fields (ApnsAuthType, ApnsSigningKey, ApnsSigningKeyId, ApnsIssuerKey, ApnsTopicHeader) to NewApp and App
  • Add response-only fields to App (Created, Modified, FcmServiceAccountConfigured, ApnsCertificateConfigured, ApnsSigningKeyConfigured)
  • Add MutableMessages, PopulateChannelRegistry, and AppID to Namespace
  • Add ExpiresAt to Token
  • Add unit tests for JSON round-tripping of all new rule types

Not addressed

  • The default case in Rule.UnmarshalJSON still returns a hard error for unknown rule types. This is the existing behavior. A graceful fallback (e.g. storing as a raw/generic type) could prevent breakage when further rule types are added, but that would be a behavioral change worth discussing separately.
  • Integration tests for the new rule types are not included as they require third-party API keys or special account configuration.

Test plan

  • go build ./... compiles cleanly
  • All existing tests pass with SKIP_INTEGRATION=true
  • New TestRuleMarshalRoundTrip covers JSON marshal/unmarshal for all 7 new rule types
  • TestRuleWithInvocationMode and TestSourceChatRoomFilter verify new fields deserialize correctly
  • Integration tests against the live Control API (requires ABLY_ACCOUNT_TOKEN)

🤖 Generated with Claude Code

Add support for new rule types (before-publish hooks and content
moderation), APNs token-based auth fields on apps, new namespace
fields (mutableMessages, populateChannelRegistry), and token
expiry on the /me endpoint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kennethkalmer
Copy link
Copy Markdown
Member Author

Closing in favour of #41 — this library is being deprecated.

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.

1 participant