From 2772cbeee7edee3f147b61077e22010518b065d6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 12 Jan 2020 02:35:43 +0000 Subject: [PATCH 1/3] Bump css-loader from 3.4.1 to 3.4.2 Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 3.4.1 to 3.4.2. - [Release notes](https://github.com/webpack-contrib/css-loader/releases) - [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/css-loader/compare/v3.4.1...v3.4.2) Signed-off-by: dependabot-preview[bot] Signed-off-by: Jordan Bieder --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a00bee4..daee02de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -948,9 +948,9 @@ } }, "css-loader": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-3.4.1.tgz", - "integrity": "sha512-+ybmv7sVxxNEenQhkifQDvny/1iNQM7YooJbSfVUdQQvisyg1aKIqgGjCjoFSyVLJMp17z9rfZFQaR5HGHcMbw==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-3.4.2.tgz", + "integrity": "sha512-jYq4zdZT0oS0Iykt+fqnzVLRIeiPWhka+7BqPn+oSIpWJAHak5tmB/WZrJ2a21JhCeFyNnnlroSl8c+MtVndzA==", "requires": { "camelcase": "^5.3.1", "cssesc": "^3.0.0", diff --git a/package.json b/package.json index b7a4ad26..c4284009 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "author": "", "license": "AGPL-3.0", "dependencies": { - "css-loader": "^3.4.1", + "css-loader": "^3.4.2", "jquery": "^3.4.1", "nextcloud_fetch": "^2.1.0", "vue": "^2.6.11", From e2942b1549d5129574f1633642aba85e0bc9dcb3 Mon Sep 17 00:00:00 2001 From: Jordan Bieder Date: Thu, 16 Jan 2020 16:37:07 +0100 Subject: [PATCH 2/3] Ovh SMS gateway integration - Add configuration class - Add Provider class Signed-off-by: Jordan Bieder Integrate Ovh gateway - add php API with composer - install the new dependencies - Add configuration for ovh - Update ProviderFactory for ovh Signed-off-by: Jordan Bieder Debug Ovh sms gateway. Has been tested with the test function Signed-off-by: Jordan Bieder Improve documentation since it seems not that easy Signed-off-by: Jordan Bieder Update Admin Documentation.md Signed-off-by: Jordan Bieder Update Admin Documentation.md Signed-off-by: Jordan Bieder Update Admin Documentation.md Signed-off-by: Jordan Bieder Fix php syntax Signed-off-by: Jordan Bieder Bump css-loader from 3.4.1 to 3.4.2 Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 3.4.1 to 3.4.2. - [Release notes](https://github.com/webpack-contrib/css-loader/releases) - [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/css-loader/compare/v3.4.1...v3.4.2) Signed-off-by: dependabot-preview[bot] [tx-robot] updated from transifex [tx-robot] updated from transifex Add sms77 to help and fix case selection string Signed-off-by: Olav Seyfarth Update OVH sms provider to remove ovh/ovh dependency Signed-off-by: Jordan Bieder Update OVH sms provider to remove ovh/ovh dependency Update ovh endpoints Signed-off-by: Jordan Bieder Fix typos Signed-off-by: Jordan Bieder Fix typos bis Signed-off-by: Jordan Bieder Fix POST request Signed-off-by: Jordan Bieder Remove ovh/ovh with composer Signed-off-by: Jordan Bieder Stupid commit to get the DCO ?! Signed-off-by: Jordan Bieder Add requested corrections Signed-off-by: Jordan Bieder Fix indentation Signed-off-by: Jordan Bieder --- composer.lock | 10 +- doc/Admin Documentation.md | 26 +++ l10n/cs.js | 2 +- l10n/cs.json | 2 +- l10n/lt_LT.js | 3 +- l10n/lt_LT.json | 3 +- lib/Command/Configure.php | 38 +++- lib/Service/Gateway/SMS/Provider/Ovh.php | 185 ++++++++++++++++++ .../Gateway/SMS/Provider/OvhConfig.php | 109 +++++++++++ .../Gateway/SMS/Provider/ProviderFactory.php | 2 + 10 files changed, 369 insertions(+), 11 deletions(-) create mode 100644 lib/Service/Gateway/SMS/Provider/Ovh.php create mode 100644 lib/Service/Gateway/SMS/Provider/OvhConfig.php diff --git a/composer.lock b/composer.lock index 5f404a2c..5f81e9d0 100644 --- a/composer.lock +++ b/composer.lock @@ -111,16 +111,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.0", + "version": "6.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5" + "reference": "43ece0e75098b7ecd8d13918293029e555a50f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", - "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82", + "reference": "43ece0e75098b7ecd8d13918293029e555a50f82", "shasum": "" }, "require": { @@ -174,7 +174,7 @@ "rest", "web service" ], - "time": "2019-12-07T18:20:45+00:00" + "time": "2019-12-23T11:57:10+00:00" }, { "name": "guzzlehttp/promises", diff --git a/doc/Admin Documentation.md b/doc/Admin Documentation.md index f737e955..de61069e 100644 --- a/doc/Admin Documentation.md +++ b/doc/Admin Documentation.md @@ -119,6 +119,32 @@ Interactive admin configuration: occ twofactorauth:gateway:configure sms ``` +### OVH +URL: https://www.ovhtelecom.fr/sms/ +Stability: Experimental + +Use the SMS gateway provided by OVH for sending SMS. + +1. First create an application key, an application secret and a consumer key with the [createToken](https://eu.api.ovh.com/createToken/index.cgi?GET=/sms&GET=/sms/*/jobs&POST=/sms/*/jobs) page. + +2. Go to you OVH account manager and get an SMS plan. You should see on the sidebar menu the SMS submenu with the account name: *sms-#######* + +3. Create a "sender". On the main page of the SMS account, you should see a *Create a sender* link. + +4. Interactive admin configuration: +```bash +occ twofactorauth:gateway:configure sms +``` + + * Choose the `ovh` SMS provider. + * Choose the endpoint connexion. + * Enter successively the application key, the application secret, the consumer key, the account, and the sender. + +5. Try to send a test with +```bash +occ twofactorauth:gateway:test sms +``` + [User Documentation]: https://nextcloud-twofactor-gateway.readthedocs.io/en/latest/User%20Documentation/ ### Spryng diff --git a/l10n/cs.js b/l10n/cs.js index 4a797a26..321f7435 100644 --- a/l10n/cs.js +++ b/l10n/cs.js @@ -6,7 +6,7 @@ OC.L10N.register( "Authenticate via Signal" : "Ověřit prostřednictvím služby Signal", "Message gateway verification" : "Ověřování brány zpráv", "Authenticate via SMS" : "Ověřit prostřednictvím SMS", - "Telegram verification" : "Telegram ověřování", + "Telegram verification" : "Ověřování prostřednictvím služby Telegram", "Authenticate via Telegram" : "Ověřit přes Telegram", "Two-Factor Gateway" : "Brána pro dvouúrovňové ověřování", "Two-factor gateway providers (SMS, Telegram, Signal)" : "Poskytovatelé bran pro dvouúrovňové ověřování (SMS, Telegram, Signal)", diff --git a/l10n/cs.json b/l10n/cs.json index 3265db70..c1e3af59 100644 --- a/l10n/cs.json +++ b/l10n/cs.json @@ -4,7 +4,7 @@ "Authenticate via Signal" : "Ověřit prostřednictvím služby Signal", "Message gateway verification" : "Ověřování brány zpráv", "Authenticate via SMS" : "Ověřit prostřednictvím SMS", - "Telegram verification" : "Telegram ověřování", + "Telegram verification" : "Ověřování prostřednictvím služby Telegram", "Authenticate via Telegram" : "Ověřit přes Telegram", "Two-Factor Gateway" : "Brána pro dvouúrovňové ověřování", "Two-factor gateway providers (SMS, Telegram, Signal)" : "Poskytovatelé bran pro dvouúrovňové ověřování (SMS, Telegram, Signal)", diff --git a/l10n/lt_LT.js b/l10n/lt_LT.js index 22640bfb..b59e75f8 100644 --- a/l10n/lt_LT.js +++ b/l10n/lt_LT.js @@ -4,6 +4,7 @@ OC.L10N.register( "%s is your Nextcloud authentication code" : "%s yra jūsų Nextcloud tapatybės nustatymo kodas", "Authentication code" : "Tapatybės nustatymo kodas", "An access code has been sent to %s" : "Prieigos kodas buvo išsiųstas į %s", - "Error while sending the Message. Please try again later or contact the administrator." : "Klaida, siunčiant žinutę. Prašome bandyti vėliau arba susisiekti su administratoriumi." + "Error while sending the Message. Please try again later or contact the administrator." : "Klaida, siunčiant žinutę. Prašome bandyti vėliau arba susisiekti su administratoriumi.", + "Your phone number has changed and had not been re-verified. Use a different two-factor mechanism or contact your admin." : "Jūsų telefono numeris pasikeitė ir nebuvo iš naujo patvirtintas. Naudokite kitą dviejų faktorių mechanizmą arba susisiekite su savo administratoriumi." }, "nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);"); diff --git a/l10n/lt_LT.json b/l10n/lt_LT.json index 11cbf44d..2d6a49e4 100644 --- a/l10n/lt_LT.json +++ b/l10n/lt_LT.json @@ -2,6 +2,7 @@ "%s is your Nextcloud authentication code" : "%s yra jūsų Nextcloud tapatybės nustatymo kodas", "Authentication code" : "Tapatybės nustatymo kodas", "An access code has been sent to %s" : "Prieigos kodas buvo išsiųstas į %s", - "Error while sending the Message. Please try again later or contact the administrator." : "Klaida, siunčiant žinutę. Prašome bandyti vėliau arba susisiekti su administratoriumi." + "Error while sending the Message. Please try again later or contact the administrator." : "Klaida, siunčiant žinutę. Prašome bandyti vėliau arba susisiekti su administratoriumi.", + "Your phone number has changed and had not been re-verified. Use a different two-factor mechanism or contact your admin." : "Jūsų telefono numeris pasikeitė ir nebuvo iš naujo patvirtintas. Naudokite kitą dviejų faktorių mechanizmą arba susisiekite su savo administratoriumi." },"pluralForm" :"nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);" } \ No newline at end of file diff --git a/lib/Command/Configure.php b/lib/Command/Configure.php index 8808cf2b..10c57878 100644 --- a/lib/Command/Configure.php +++ b/lib/Command/Configure.php @@ -32,6 +32,7 @@ use OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\EcallSMSConfig; use OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\PlaySMSConfig; use OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\Sms77IoConfig; +use OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\OvhConfig; use OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\WebSmsConfig; use OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\PuzzelSMSConfig; use OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\HuaweiE3531Config; @@ -105,7 +106,7 @@ private function configureSignal(InputInterface $input, OutputInterface $output) private function configureSms(InputInterface $input, OutputInterface $output) { $helper = $this->getHelper('question'); - $providerQuestion = new Question('Please choose a SMS provider (websms, playsms, clockworksms, puzzelsms, ecallsms, voipms, huawei_e3531, spryng): ', 'websms'); + $providerQuestion = new Question('Please choose a SMS provider (websms, playsms, clockworksms, puzzelsms, ecallsms, voipms, huawei_e3531, spryng, sms77io, 'ovh'): ', 'websms'); $provider = $helper->ask($input, $output, $providerQuestion); /** @var SMSConfig $config */ @@ -236,7 +237,7 @@ private function configureSms(InputInterface $input, OutputInterface $output) { break; - case 'sms77': + case 'sms77io': $config->setProvider($provider); /** @var Sms77IoConfig $providerConfig */ $providerConfig = $config->getProvider()->getConfig(); @@ -247,6 +248,39 @@ private function configureSms(InputInterface $input, OutputInterface $output) { $providerConfig->setApiKey($apiKey); break; + case 'ovh': + $config->setProvider($provider); + + /** @var OvhConfig $providerConfig */ + $providerConfig = $config->getProvider()->getConfig(); + + $endpointQ = new Question('Please enter the endpoint to use (ovh-eu, ovh-us, ovh-ca, soyoustart-eu, soyoustart-ca, kimsufi-eu, kimsufi-ca, runabove-ca): '); + $endpoint = $helper->ask($input, $output, $endpointQ); + + $appKeyQ = new Question('Please enter your application key: '); + $appKey = $helper->ask($input, $output, $appKeyQ); + + $appSecretQ = new Question('Please enter your application secret: '); + $appSecret = $helper->ask($input, $output, $appSecretQ); + + $consumerKeyQ = new Question('Please enter your consumer key: '); + $consumerKey = $helper->ask($input, $output, $consumerKeyQ); + + $accountQ = new Question('Please enter your account (sms-*****): '); + $account = $helper->ask($input, $output, $accountQ); + + $senderQ = new Question('Please enter your sender: '); + $sender = $helper->ask($input, $output, $senderQ); + + $providerConfig->setApplicationKey($appKey); + $providerConfig->setApplicationSecret($appSecret); + $providerConfig->setConsumerKey($consumerKey); + $providerConfig->setEndpoint($endpoint); + $providerConfig->setAccount($account); + $providerConfig->setSender($sender); + break; + + default: $output->writeln("Invalid provider $provider"); break; diff --git a/lib/Service/Gateway/SMS/Provider/Ovh.php b/lib/Service/Gateway/SMS/Provider/Ovh.php new file mode 100644 index 00000000..6aec22ae --- /dev/null +++ b/lib/Service/Gateway/SMS/Provider/Ovh.php @@ -0,0 +1,185 @@ + + * + * Nextcloud - Two-factor Gateway for Ovh + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +namespace OCA\TwoFactorGateway\Service\Gateway\SMS\Provider; + +use Exception; +use OCA\TwoFactorGateway\Exception\SmsTransmissionException; +use OCA\TwoFactorGateway\Exception\InvalidSmsProviderException; +use OCP\Http\Client\IClient; +use OCP\Http\Client\IClientService; + +class Ovh implements IProvider { + + const PROVIDER_ID = 'ovh'; + + /** @var IClient */ + private $client; + + /** @var OvhConfig */ + private $config; + + /** + * Url to communicate with Ovh API + * + * @var array + */ + private $endpoints = [ + 'ovh-eu' => 'https://api.ovh.com/1.0', + 'ovh-us' => 'https://api.us.ovhcloud.com/1.0', + 'ovh-ca' => 'https://ca.api.ovh.com/1.0', + 'kimsufi-eu' => 'https://eu.api.kimsufi.com/1.0', + 'kimsufi-ca' => 'https://ca.api.kimsufi.com/1.0', + 'soyoustart-eu' => 'https://eu.api.soyoustart.com/1.0', + 'soyoustart-ca' => 'https://ca.api.soyoustart.com/1.0', + 'runabove-ca' => 'https://api.runabove.com/1.0', + ]; + + /** + * Array of the 4 needed parameters to connect to the API + * @var array + */ + private $attrs = [ + 'AK' => null, + 'AS' => null, + 'CK' => null, + 'endpoint' => null, + 'timedelta' => null + ]; + + + public function __construct(IClientService $clientService, + OvhConfig $config) { + $this->client = $clientService->newClient(); + $this->config = $config; + } + + /** + * @param string $identifier + * @param string $message + * + * @throws SmsTransmissionException + */ + public function send(string $identifier, string $message) { + $config = $this->getConfig(); + $endpoint = $config->getEndpoint(); + $sender = $config->getSender(); + $smsAccount = $config->getAccount(); + + $this->attrs['AK'] = $config->getApplicationKey(); + $this->attrs['AS'] = $config->getApplicationSecret(); + $this->attrs['CK'] = $config->getConsumerKey(); + if (!isset($this->endpoints[$endpoint])) + throw new InvalidSmsProviderException("Endpoint $endpoint not found"); + $this->attrs['endpoint'] = $this->endpoints[$endpoint]; + + $this->getTimeDelta(); + + $header = $this->getHeader('GET',$this->attrs['endpoint'].'/sms'); + $response = $this->client->get($this->attrs['endpoint'].'/sms',[ + 'headers' => $header, + ]); + $smsServices = json_decode($response->getBody(),true); + + $smsAccountFound = false; + foreach ($smsServices as $smsService) { + if ($smsService === $smsAccount) { + $smsAccountFound = true; + break; + } + } + if ($smsAccountFound === false) { + throw new InvalidSmsProviderException("SMS account $smsAccount not found"); + } + $content = [ + "charset"=> "UTF-8", + "message"=> $message, + "noStopClause"=> true, + "priority"=> "high", + "receivers"=> [ $identifier ], + "senderForResponse"=> false, + "sender"=> $sender, + "validityPeriod"=> 3600 + ]; + $body = json_encode($content); + + $header = $this->getHeader('POST',$this->attrs['endpoint']."/sms/$smsAccount/jobs",$body); + $response = $this->client->post($this->attrs['endpoint']."/sms/$smsAccount/jobs",[ + 'headers' => $header, + 'json' => $content, + ]); + $resultPostJob = json_decode($response->getBody(),true); + + if (count($resultPostJob["validReceivers"]) === 0) { + throw new SmsTransmissionException("Bad receiver $identifier"); + } + } + + /** + * @return OvhConfig + */ + public function getConfig(): IProviderConfig { + return $this->config; + } + + /** + * Compute time delta between this server and OVH endpoint + * @throws InvalidSmsProviderException + */ + private function getTimeDelta() { + if (!isset($this->attrs['timedelta'])) { + if (!isset($this->attrs['endpoint'])) + throw new InvalidSmsProviderException('Need to set the endpoint'); + try { + $response = $this->client->get($this->attrs['endpoint'].'/auth/time'); + $serverTimestamp = (int)$response->getBody(); + $this->attrs['timedelta'] = $serverTimestamp - time(); + } + catch (Exception $ex) { + throw new InvalidSmsProviderException('Unable to calculate time delta:'.$ex->getMessage()); + } + } + } + + /** + * Make header for Ovh + * @param string $method The methode use for the query : GET, POST, PUT, DELETE + * @param string $query The fulle URI for the query: https://eu.api.ovh.com/1.0/...... + * @param string $body JSON encoded body content for the POST request + * @return array $header Contains the data for the request need by OVH + */ + private function getHeader($method,$query,$body='') { + $timestamp = time() + $this->attrs['timedelta']; + $prehash = $this->attrs['AS'].'+'.$this->attrs['CK'].'+'.$method.'+'.$query.'+'.$body.'+'.$timestamp; + $header = [ + 'Content-Type' => 'application/json; charset=utf-8', + 'X-Ovh-Application' => $this->attrs['AK'], + 'X-Ovh-Timestamp' => $timestamp, + 'X-Ovh-Signature' => '$1$'.sha1($prehash), + 'X-Ovh-Consumer' => $this->attrs['CK'], + ]; + return $header; + } + + +} diff --git a/lib/Service/Gateway/SMS/Provider/OvhConfig.php b/lib/Service/Gateway/SMS/Provider/OvhConfig.php new file mode 100644 index 00000000..4703bbde --- /dev/null +++ b/lib/Service/Gateway/SMS/Provider/OvhConfig.php @@ -0,0 +1,109 @@ + + * + * Nextcloud - Two-factor Gateway for Ovh + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +namespace OCA\TwoFactorGateway\Service\Gateway\SMS\Provider; + +use function array_intersect; +use OCA\TwoFactorGateway\AppInfo\Application; +use OCA\TwoFactorGateway\Exception\ConfigurationException; +use OCP\IConfig; + +class OvhConfig implements IProviderConfig { + + /** @var IConfig */ + private $config; + + public function __construct(IConfig $config) { + $this->config = $config; + } + + private function getOrFail(string $key): string { + $val = $this->config->getAppValue(Application::APP_NAME, $key, null); + if (is_null($val)) { + throw new ConfigurationException(); + } + return $val; + } + + public function getApplicationKey(): string { + return $this->getOrFail('ovh_application_key'); + } + + public function getApplicationSecret(): string { + return $this->getOrFail('ovh_application_secret'); + } + + public function getConsumerKey(): string { + return $this->getOrFail('ovh_consumer_key'); + } + + public function getEndpoint(): string { + return $this->getOrFail('ovh_endpoint'); + } + + public function getAccount(): string { + return $this->getOrFail('ovh_account'); + } + + public function getSender(): string { + return $this->getOrFail('ovh_sender'); + } + + public function setApplicationKey(string $appKey){ + $this->config->setAppValue(Application::APP_NAME, 'ovh_application_key', $appKey); + } + + public function setApplicationSecret(string $appSecret){ + $this->config->setAppValue(Application::APP_NAME, 'ovh_application_secret', $appSecret); + } + + public function setConsumerKey(string $consumerKey){ + $this->config->setAppValue(Application::APP_NAME, 'ovh_consumer_key', $consumerKey); + } + + public function setEndpoint(string $endpoint){ + $this->config->setAppValue(Application::APP_NAME, 'ovh_endpoint', $endpoint); + } + + public function setAccount($account){ + $this->config->setAppValue(Application::APP_NAME, 'ovh_account', $account); + } + + public function setSender($sender){ + $this->config->setAppValue(Application::APP_NAME, 'ovh_sender', $sender); + } + + public function isComplete(): bool { + $set = $this->config->getAppKeys(Application::APP_NAME); + $expected = [ + 'ovh_application_key', + 'ovh_application_secret', + 'ovh_consumer_key', + 'ovh_endpoint', + 'ovh_account', + 'ovh_sender' + ]; + return count(array_intersect($set, $expected)) === count($expected); + } + +} diff --git a/lib/Service/Gateway/SMS/Provider/ProviderFactory.php b/lib/Service/Gateway/SMS/Provider/ProviderFactory.php index b27c341c..d3f3614b 100644 --- a/lib/Service/Gateway/SMS/Provider/ProviderFactory.php +++ b/lib/Service/Gateway/SMS/Provider/ProviderFactory.php @@ -53,6 +53,8 @@ public function getProvider(string $id): IProvider { return $this->container->query(HuaweiE3531::class); case Sms77Io::PROVIDER_ID: return $this->container->query(Sms77Io::class); + case Ovh::PROVIDER_ID: + return $this->container->query(Ovh::class); case SpryngSMS::PROVIDER_ID: return $this->container->query(SpryngSMS::class); default: From 10c002a96919aba4d74eb681642c3b2e6b9fb6c7 Mon Sep 17 00:00:00 2001 From: Jordan Bieder Date: Tue, 21 Jan 2020 22:50:55 +0100 Subject: [PATCH 3/3] What happened to this file ?! Signed-off-by: Jordan Bieder --- lib/Command/Configure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Command/Configure.php b/lib/Command/Configure.php index cf12f8ee..e93c8e27 100644 --- a/lib/Command/Configure.php +++ b/lib/Command/Configure.php @@ -107,7 +107,7 @@ private function configureSignal(InputInterface $input, OutputInterface $output) private function configureSms(InputInterface $input, OutputInterface $output) { $helper = $this->getHelper('question'); - $providerQuestion = new Question('Please choose a SMS provider (websms, playsms, clockworksms, puzzelsms, ecallsms, voipms, huawei_e3531, spryng, sms77io, ovh'): ', 'websms'); + $providerQuestion = new Question('Please choose a SMS provider (websms, playsms, clockworksms, puzzelsms, ecallsms, voipms, huawei_e3531, spryng, sms77io, ovh', 'websms'); $provider = $helper->ask($input, $output, $providerQuestion); /** @var SMSConfig $config */