Fix sms mock endpoint

This commit is contained in:
Matej Bačo 2025-06-26 20:04:56 +02:00
parent 8dcc3c4981
commit bda9adc52e
3 changed files with 38 additions and 30 deletions

View file

@ -61,7 +61,7 @@
"utopia-php/image": "0.8.*",
"utopia-php/locale": "0.4.*",
"utopia-php/logger": "0.6.*",
"utopia-php/messaging": "0.18.*",
"utopia-php/messaging": "dev-feat-customizable-mock as 0.18.99",
"utopia-php/migration": "0.10.*",
"utopia-php/orchestration": "0.9.*",
"utopia-php/platform": "0.7.*",

64
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "55bc52686a08d64930e6af7411ac0654",
"content-hash": "8c1c38af4f7d733255bfdb8390fe6d65",
"packages": [
{
"name": "adhocore/jwt",
@ -1463,16 +1463,16 @@
},
{
"name": "open-telemetry/sem-conv",
"version": "1.32.0",
"version": "1.32.1",
"source": {
"type": "git",
"url": "https://github.com/opentelemetry-php/sem-conv.git",
"reference": "16585cc0dbc3032a318e274043454679430d2ebf"
"reference": "94daa85ea61a8e2b7e1b0af6be0e875bedda7c22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/16585cc0dbc3032a318e274043454679430d2ebf",
"reference": "16585cc0dbc3032a318e274043454679430d2ebf",
"url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/94daa85ea61a8e2b7e1b0af6be0e875bedda7c22",
"reference": "94daa85ea61a8e2b7e1b0af6be0e875bedda7c22",
"shasum": ""
},
"require": {
@ -1516,7 +1516,7 @@
"issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
"source": "https://github.com/open-telemetry/opentelemetry-php"
},
"time": "2025-05-05T03:58:53+00:00"
"time": "2025-06-24T02:32:27+00:00"
},
{
"name": "paragonie/constant_time_encoding",
@ -2327,21 +2327,20 @@
},
{
"name": "ramsey/uuid",
"version": "4.8.1",
"version": "4.9.0",
"source": {
"type": "git",
"url": "https://github.com/ramsey/uuid.git",
"reference": "fdf4dd4e2ff1813111bd0ad58d7a1ddbb5b56c28"
"reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/fdf4dd4e2ff1813111bd0ad58d7a1ddbb5b56c28",
"reference": "fdf4dd4e2ff1813111bd0ad58d7a1ddbb5b56c28",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/4e0e23cc785f0724a0e838279a9eb03f28b092a0",
"reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0",
"shasum": ""
},
"require": {
"brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13",
"ext-json": "*",
"php": "^8.0",
"ramsey/collection": "^1.2 || ^2.0"
},
@ -2400,9 +2399,9 @@
],
"support": {
"issues": "https://github.com/ramsey/uuid/issues",
"source": "https://github.com/ramsey/uuid/tree/4.8.1"
"source": "https://github.com/ramsey/uuid/tree/4.9.0"
},
"time": "2025-06-01T06:28:46+00:00"
"time": "2025-06-25T14:20:11+00:00"
},
{
"name": "spomky-labs/otphp",
@ -3494,16 +3493,16 @@
},
{
"name": "utopia-php/database",
"version": "0.71.7",
"version": "0.71.8",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "aa0116b2380125907fc18c82662be8e74c54091f"
"reference": "7dff6b67a54f1a7f9d3f210db4c6e40d7052b79e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/aa0116b2380125907fc18c82662be8e74c54091f",
"reference": "aa0116b2380125907fc18c82662be8e74c54091f",
"url": "https://api.github.com/repos/utopia-php/database/zipball/7dff6b67a54f1a7f9d3f210db4c6e40d7052b79e",
"reference": "7dff6b67a54f1a7f9d3f210db4c6e40d7052b79e",
"shasum": ""
},
"require": {
@ -3544,9 +3543,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/0.71.7"
"source": "https://github.com/utopia-php/database/tree/0.71.8"
},
"time": "2025-06-17T23:59:10+00:00"
"time": "2025-06-26T14:48:17+00:00"
},
{
"name": "utopia-php/detector",
@ -3943,16 +3942,16 @@
},
{
"name": "utopia-php/messaging",
"version": "0.18.0",
"version": "dev-feat-customizable-mock",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/messaging.git",
"reference": "c151aa5d4d475c788ca15c210b5b2017e21c41d6"
"reference": "1f761b5f4103f372da3cb3f1141024cb1d0735da"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/messaging/zipball/c151aa5d4d475c788ca15c210b5b2017e21c41d6",
"reference": "c151aa5d4d475c788ca15c210b5b2017e21c41d6",
"url": "https://api.github.com/repos/utopia-php/messaging/zipball/1f761b5f4103f372da3cb3f1141024cb1d0735da",
"reference": "1f761b5f4103f372da3cb3f1141024cb1d0735da",
"shasum": ""
},
"require": {
@ -3988,9 +3987,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/messaging/issues",
"source": "https://github.com/utopia-php/messaging/tree/0.18.0"
"source": "https://github.com/utopia-php/messaging/tree/feat-customizable-mock"
},
"time": "2025-05-15T05:00:03+00:00"
"time": "2025-06-26T18:01:16+00:00"
},
{
"name": "utopia-php/migration",
@ -8235,9 +8234,18 @@
"time": "2024-03-07T20:33:40+00:00"
}
],
"aliases": [],
"aliases": [
{
"package": "utopia-php/messaging",
"version": "dev-feat-customizable-mock",
"alias": "0.18.99",
"alias_normalized": "0.18.99.0"
}
],
"minimum-stability": "stable",
"stability-flags": {},
"stability-flags": {
"utopia-php/messaging": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
@ -8261,5 +8269,5 @@
"platform-overrides": {
"php": "8.3"
},
"plugin-api-version": "2.6.0"
"plugin-api-version": "2.3.0"
}

View file

@ -426,7 +426,7 @@ class Messaging extends Action
$credentials = $provider->getAttribute('credentials');
return match ($provider->getAttribute('provider')) {
'mock' => new Mock('username', 'password'),
'mock' => (new Mock('username', 'password'))->setEndpoint('http://request-catcher-sms:5000/'),
'twilio' => new Twilio(
$credentials['accountSid'] ?? '',
$credentials['authToken'] ?? '',