Display the account type as a list in vCard

Complete the documentation
Update the dependencies
Fix the tests
This commit is contained in:
Timothée Jaussoin 2022-01-24 17:29:34 +01:00
parent 717d3e3cc9
commit 79921e56e2
6 changed files with 35 additions and 40 deletions

View file

@ -31,7 +31,6 @@ use App\Password;
use App\EmailChanged;
use App\Helpers\Utils;
use App\Mail\ChangingEmail;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Account extends Authenticatable
{
@ -271,9 +270,9 @@ FN:'.$this->getIdentifierAttribute();
X-LINPHONE-ACCOUNT-DTMF-PROTOCOL:'.$this->dtmf_protocol;
}
if ($this->types->count() > 0) {
foreach ($this->types as $type) {
$vcard .= '
X-LINPHONE-ACCOUNT-TYPE:'.$this->types->implode('key', ',');
X-LINPHONE-ACCOUNT-TYPE:'.$type;
}
foreach ($this->actions as $action) {

53
flexiapi/composer.lock generated
View file

@ -2096,16 +2096,16 @@
},
{
"name": "nesbot/carbon",
"version": "2.55.2",
"version": "2.56.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "8c2a18ce3e67c34efc1b29f64fe61304368259a2"
"reference": "626ec8cbb724cd3c3400c3ed8f730545b744e3f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8c2a18ce3e67c34efc1b29f64fe61304368259a2",
"reference": "8c2a18ce3e67c34efc1b29f64fe61304368259a2",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/626ec8cbb724cd3c3400c3ed8f730545b744e3f4",
"reference": "626ec8cbb724cd3c3400c3ed8f730545b744e3f4",
"shasum": ""
},
"require": {
@ -2122,7 +2122,7 @@
"kylekatarnls/multi-tester": "^2.0",
"phpmd/phpmd": "^2.9",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.54",
"phpstan/phpstan": "^0.12.54 || ^1.0",
"phpunit/phpunit": "^7.5.20 || ^8.5.14",
"squizlabs/php_codesniffer": "^3.4"
},
@ -2188,7 +2188,7 @@
"type": "tidelift"
}
],
"time": "2021-12-03T14:59:52+00:00"
"time": "2022-01-21T17:08:38+00:00"
},
{
"name": "nikic/php-parser",
@ -5491,16 +5491,16 @@
},
{
"name": "voku/portable-ascii",
"version": "1.5.6",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/voku/portable-ascii.git",
"reference": "80953678b19901e5165c56752d087fc11526017c"
"reference": "1f8b372a927ab2d17dbdab443aefbfe6a5354284"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c",
"reference": "80953678b19901e5165c56752d087fc11526017c",
"url": "https://api.github.com/repos/voku/portable-ascii/zipball/1f8b372a927ab2d17dbdab443aefbfe6a5354284",
"reference": "1f8b372a927ab2d17dbdab443aefbfe6a5354284",
"shasum": ""
},
"require": {
@ -5537,7 +5537,7 @@
],
"support": {
"issues": "https://github.com/voku/portable-ascii/issues",
"source": "https://github.com/voku/portable-ascii/tree/1.5.6"
"source": "https://github.com/voku/portable-ascii/tree/1.6.0"
},
"funding": [
{
@ -5561,7 +5561,7 @@
"type": "tidelift"
}
],
"time": "2020-11-12T00:07:28+00:00"
"time": "2022-01-24T09:37:53+00:00"
},
{
"name": "webmozart/assert",
@ -6217,16 +6217,16 @@
},
{
"name": "mockery/mockery",
"version": "1.4.4",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/mockery/mockery.git",
"reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346"
"reference": "c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mockery/mockery/zipball/e01123a0e847d52d186c5eb4b9bf58b0c6d00346",
"reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346",
"url": "https://api.github.com/repos/mockery/mockery/zipball/c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac",
"reference": "c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac",
"shasum": ""
},
"require": {
@ -6283,9 +6283,9 @@
],
"support": {
"issues": "https://github.com/mockery/mockery/issues",
"source": "https://github.com/mockery/mockery/tree/1.4.4"
"source": "https://github.com/mockery/mockery/tree/1.5.0"
},
"time": "2021-09-13T15:28:59+00:00"
"time": "2022-01-20T13:18:17+00:00"
},
{
"name": "myclabs/deep-copy",
@ -6304,9 +6304,6 @@
"require": {
"php": "^7.1 || ^8.0"
},
"replace": {
"myclabs/deep-copy": "self.version"
},
"require-dev": {
"doctrine/collections": "^1.0",
"doctrine/common": "^2.6",
@ -7090,16 +7087,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.5.11",
"version": "9.5.13",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "2406855036db1102126125537adb1406f7242fdd"
"reference": "597cb647654ede35e43b137926dfdfef0fb11743"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd",
"reference": "2406855036db1102126125537adb1406f7242fdd",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/597cb647654ede35e43b137926dfdfef0fb11743",
"reference": "597cb647654ede35e43b137926dfdfef0fb11743",
"shasum": ""
},
"require": {
@ -7177,7 +7174,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.13"
},
"funding": [
{
@ -7189,7 +7186,7 @@
"type": "github"
}
],
"time": "2021-12-25T07:07:57+00:00"
"time": "2022-01-24T07:33:35+00:00"
},
{
"name": "sebastian/cli-parser",
@ -8286,5 +8283,5 @@
"platform-overrides": {
"php": "7.3"
},
"plugin-api-version": "2.1.0"
"plugin-api-version": "2.2.0"
}

View file

@ -321,7 +321,7 @@ Here is the format of the vCard list returned by the endpoint:
KIND:individual
IMPP:sip:schoen.tatyana@sip.linphone.org
FN:schoen.tatyana@sip.linphone.org
X-LINPHONE-ACCOUNT-DTMF-PROTOCOL:SIPInfo
X-LINPHONE-ACCOUNT-DTMF-PROTOCOL:sipinfo
X-LINPHONE-ACCOUNT-TYPE:phone
X-LINPHONE-ACCOUNT-ACTION:action_key;123
END:VCARD
@ -330,7 +330,7 @@ Here is the format of the vCard list returned by the endpoint:
KIND:individual
IMPP:sip:dhand@sip.linphone.org
FN:dhand@sip.linphone.org
X-LINPHONE-ACCOUNT-DTMF-PROTOCOL:SIPInfo
X-LINPHONE-ACCOUNT-DTMF-PROTOCOL:sipinfo
END:VCARD
```

View file

@ -104,8 +104,7 @@ class AccountActionTest extends TestCase
$this->keyAuthenticated($admin->account)
->json($this->method, $this->route.'/'.$password->account->id.'/actions', [
'key' => '123',
'code' => '123',
'protocol' => 'sipinfo'
'code' => '123'
])
->assertStatus(201);
@ -129,8 +128,7 @@ class AccountActionTest extends TestCase
$this->keyAuthenticated($admin->account)
->json($this->method, $this->route.'/'.$password->account->id.'/actions', [
'key' => '123',
'code' => '123',
'protocol' => 'sipinfo'
'code' => '123'
])
->assertStatus(201);
@ -140,8 +138,7 @@ class AccountActionTest extends TestCase
$this->keyAuthenticated($admin->account)
->json('PUT', $this->route.'/'.$password->account->id.'/actions/'.$accountAction->id, [
'key' => '123',
'code' => 'abc',
'protocol' => 'sipinfo'
'code' => 'abc'
])
->assertStatus(200);

View file

@ -76,6 +76,7 @@ class AccountApiTest extends TestCase
'username' => $username,
'algorithm' => 'SHA-256',
'password' => '123456',
'dtmf_protocol' => 'sipinfo'
]);
$response1
@ -84,6 +85,7 @@ class AccountApiTest extends TestCase
'id' => 2,
'username' => $username,
'activated' => false,
'dtmf_protocol' => 'sipinfo'
]);
}

View file

@ -8,7 +8,7 @@
#%define _datadir %{_datarootdir}
#%define _docdir %{_datadir}/doc
%define build_number 124
%define build_number 125
%define var_dir /var/opt/belledonne-communications
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager