Skip to content

feat(cli): add websocket auth message configuration support#12050

Open
fern-support wants to merge 6 commits intomainfrom
devin/1770162214-websocket-oauth-auth
Open

feat(cli): add websocket auth message configuration support#12050
fern-support wants to merge 6 commits intomainfrom
devin/1770162214-websocket-oauth-auth

Conversation

@fern-support
Copy link
Collaborator

@fern-support fern-support commented Feb 4, 2026

Description

Link to Devin run: https://app.devin.ai/sessions/50ce682058004d24beb034e75ffe07d7
Requested by: @fern-support

Adds support for automatic authentication message sending after websocket connection. This enables SDKs to handle message-level auth patterns where the OAuth token is sent as the first message after connecting (as opposed to connection-level auth via headers/query params).

Changes Made

  • Add WebSocketAuthMessageConfig type to IR with messageId and tokenPropertyPath fields
  • Add auth-message field to WebSocketChannelSchema in Fern definition
  • Add x-fern-auth-message extension for AsyncAPI specs
  • Update AsyncAPI converters (2.x and 3.0) to extract auth message config
  • Update IR migration v63-to-v62 for backward compatibility (drops the new field)
  • Update Python generator to send auth message after connecting when configured
  • Regenerate JSON schema files (fern.schema.json, package-yml.schema.json)
  • Update CLI and Python SDK versions.yml
  • Update seed/python-sdk/seed.yml irVersion to v63
  • Update test snapshot for asyncapi-json-refs-ir

Human Review Checklist

  • Python token retrieval: The sync version extracts token from headers via string manipulation (get_headers().get("Authorization", "").replace("Bearer ", "")). The async version uses _async_token(). Verify these approaches are robust.
  • messageId field unused: The messageId is defined in the config but the Python generator only uses tokenPropertyPath to build the nested dict. Is this intentional or should the message format include the messageId?
  • No test fixture: This PR doesn't include a seed test fixture to verify the generated code. Consider whether one should be added.
  • Backward compatibility workaround: Uses getattr(websocket, "auth_message", None) in Python generator for compatibility with older IR types packages.

Updates Since Last Revision

  • Fixed CI validation failure by updating seed/python-sdk/seed.yml irVersion from v62 to v63
  • Regenerated JSON schema files that were out of sync with Fern definition changes
  • Updated test snapshot for asyncapi-json-refs-ir to include new authMessage field

CI Status

Some CI checks are failing with what appear to be unrelated issues:

  • valid-navigation > simple test timing out (5000ms timeout in fern-definition-validator)
  • Migration test failure in v23-to-v22

These failures don't appear to be related to the websocket auth message changes.

Testing

  • Lint checks pass (pnpm run check)
  • Python pre-commit hooks pass
  • JSON schema regeneration completed
  • Test snapshots updated
  • No seed test fixture added for this feature

Add support for automatic authentication message sending after websocket
connection. This enables SDKs to handle message-level auth patterns where
the OAuth token is sent as the first message after connecting.

Changes:
- Add WebSocketAuthMessageConfig type to IR with messageId and tokenPropertyPath
- Add auth-message field to WebSocketChannelSchema in Fern definition
- Update IR migration v63-to-v62 for backward compatibility
- Add x-fern-auth-message extension for AsyncAPI specs
- Update Python generator to send auth message after connecting

Co-Authored-By: blank@buildwithfern.com <blank@buildwithfern.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 5 commits February 4, 2026 00:09
Co-Authored-By: blank@buildwithfern.com <blank@buildwithfern.com>
Co-Authored-By: blank@buildwithfern.com <blank@buildwithfern.com>
Co-Authored-By: blank@buildwithfern.com <blank@buildwithfern.com>
Co-Authored-By: blank@buildwithfern.com <blank@buildwithfern.com>
Co-Authored-By: blank@buildwithfern.com <blank@buildwithfern.com>
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