Limit access to resources according to user scoped Account or SP (#140)

* limit access to resources according to user scope

* fix error change

* speech credentials validation

* fix speech credentials validation

* fix the issues that didnt allow tests to pass

* speech credential validation

* retrieve speech cred list

* fixt speech credential test valodation

* check scope of smpp-gateways

* check scope of smpp-gateways

* testing time

* /signin for hosted system needs to return scope in jwt

* fix user delete route and adjust tests

* get refactor

---------

Co-authored-by: eglehelms <e.helms@cognigy.com>
Co-authored-by: Dave Horton <daveh@beachdognet.com>
Co-authored-by: Guilherme Rauen <g.rauen@cognigy.com>
This commit is contained in:
authored and GitHub committed 2023-04-05 14:20:51 -04:00
1 parent 8f93b69af0
commit b2dce18c7a
19 files changed
+530 -126

No files matched your search

+2
View File
@@ -71,6 +71,7 @@ test('speech credentials tests', async(t) => {
const token = jwt.sign({
account_sid,
service_provider_sid,
scope: 'account',
permissions: ["PROVISION_USERS", "PROVISION_SERVICES", "VIEW_ONLY"]
}, process.env.JWT_SECRET, { expiresIn: '1h' });
@@ -393,6 +394,7 @@ test('speech credentials tests', async(t) => {
auth: authUser,
json: true,
body: {
service_provider_sid: service_provider_sid,
vendor: 'nvidia',
use_for_stt: true,
use_for_tts: true,