mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 01:58:07 +00:00
Fix FLEXIAPI-268 Allow pn-param in Apple format for the push notifications endpoints
This commit is contained in:
parent
63c1c404a6
commit
2bf8db6bd1
3 changed files with 21 additions and 2 deletions
|
|
@ -17,6 +17,7 @@ v1.7
|
|||
- Fix FLEXIAPI-262 Bypass the JWT auth if we have an API Key
|
||||
- Fix FLEXIAPI-264 Add -k|api_key_ip parameter to accounts:create-admin-account to set/clear the related API Key restriction
|
||||
- Fix FLEXIAPI-256 Publish an empty string while deleting a device on Redis to force the refresh on the other clients
|
||||
- Fix FLEXIAPI-268 Allow pn-param in Apple format for the push notifications endpoints
|
||||
|
||||
v1.6
|
||||
----
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ class PnParam implements Rule
|
|||
{
|
||||
public function passes($attribute, $value)
|
||||
{
|
||||
return $value == null || Validator::regex('/^\w+$/')->validate($value);
|
||||
return $value == null || Validator::regex('/^[\w\.]+$/')->validate($value);
|
||||
}
|
||||
|
||||
public function message()
|
||||
{
|
||||
return 'The :attribute should be null or contain only alphanumeric and underscore characters';
|
||||
return 'The :attribute should be null or contain only alphanumeric, dots and underscore characters';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,5 +67,23 @@ class ApiPushNotificationTest extends TestCase
|
|||
'type' => $this->type,
|
||||
'call_id' => 'call_id-123'
|
||||
])->assertStatus(503);
|
||||
|
||||
$this->keyAuthenticated($account)
|
||||
->json($this->method, $this->tokenRoute, [
|
||||
'pn_provider' => $this->pnProvider,
|
||||
'pn_param' => 'ABCD1234.org.linphone.phone.voip',
|
||||
'pn_prid' => $this->pnPrid,
|
||||
'type' => $this->type,
|
||||
'call_id' => 'call_id-123'
|
||||
])->assertStatus(503);
|
||||
|
||||
$this->keyAuthenticated($account)
|
||||
->json($this->method, $this->tokenRoute, [
|
||||
'pn_provider' => $this->pnProvider,
|
||||
'pn_param' => '@blabla@',
|
||||
'pn_prid' => $this->pnPrid,
|
||||
'type' => $this->type,
|
||||
'call_id' => 'call_id-123'
|
||||
])->assertJsonValidationErrors(['pn_param']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue