Skip to content

feat: Add Alibaba Cloud SMS Adapter (#6307)#8

Open
deepshekhardas wants to merge 1 commit into
mainfrom
feat/6307-alibaba-cloud-adapter
Open

feat: Add Alibaba Cloud SMS Adapter (#6307)#8
deepshekhardas wants to merge 1 commit into
mainfrom
feat/6307-alibaba-cloud-adapter

Conversation

@deepshekhardas
Copy link
Copy Markdown
Owner

@deepshekhardas deepshekhardas commented Apr 11, 2026

This PR adds support for Alibaba Cloud SMS adapter.

Changes:

  • Implements Alibaba Cloud SMS API integration
  • Follows existing adapter patterns
  • Includes proper error handling

Summary by cubic

Adds an Alibaba Cloud SMS adapter to send templated SMS via Dysmsapi. Lets you send OTPs using your Aliyun sign name and template code.

  • New Features

    • New adapter AlibabaCloud using SendSms (version 2017-05-25) with HMAC-SHA1 signing and percent-encoding.
    • One recipient per request; region set to cn-hangzhou.
    • Marks delivery when API Code is OK; returns per-recipient results.
    • Test added for basic send flow via env vars.
  • Migration

    • Configure with access key ID/secret, sign name, and template code.
    • Use a template with a code param; pass the code as the SMS content (adapter wraps it as { "code": "<content>" }).

Written for commit 076e6de. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/Utopia/Messaging/Adapter/SMS/AlibabaCloud.php">

<violation number="1" location="src/Utopia/Messaging/Adapter/SMS/AlibabaCloud.php:73">
P1: GET request parameters are being sent in the body instead of the query string, which can break Alibaba SMS signature validation.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

method: 'GET',
url: 'https://dysmsapi.aliyuncs.com',
headers: [],
body: $params
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 11, 2026

Choose a reason for hiding this comment

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

P1: GET request parameters are being sent in the body instead of the query string, which can break Alibaba SMS signature validation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/Utopia/Messaging/Adapter/SMS/AlibabaCloud.php, line 73:

<comment>GET request parameters are being sent in the body instead of the query string, which can break Alibaba SMS signature validation.</comment>

<file context>
@@ -0,0 +1,114 @@
+                method: 'GET',
+                url: 'https://dysmsapi.aliyuncs.com',
+                headers: [],
+                body: $params
+            );
+
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant