-
Notifications
You must be signed in to change notification settings - Fork 17
Make this SDK compatible with node6 again #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
name: security#updateProfile | ||
description: update profile | ||
description: updates a security profile definition | ||
hooks: | ||
before: > | ||
curl -H "Content-type: application/json" -d '{ | ||
"policies": [] | ||
}' kuzzle:7512/profiles/myProfile/_create | ||
after: curl -XDELETE kuzzle:7512/profiles/myProfile | ||
before: | ||
- > | ||
curl -H "Content-type: application/json" -d '{ | ||
"policies": [] | ||
}' kuzzle:7512/profiles/myProfile/_create | ||
- > | ||
curl -H "Content-type: application/json" -d '{ | ||
"controllers": { | ||
"*": { | ||
"actions": { | ||
"*": true | ||
} | ||
} | ||
} | ||
}' kuzzle:7512/roles/privileged/_create | ||
after: | ||
- curl -XDELETE kuzzle:7512/profiles/myProfile?refresh=wait_for | ||
- curl -XDELETE kuzzle:7512/roles/privileged | ||
template: default | ||
expected: '^ { roleId: ''privileged'', restrictedTo: \[Array\] } \] }$' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,36 @@ | ||
try { | ||
const response = await kuzzle.security.updateRole( | ||
'read-only', | ||
{ | ||
controllers: { | ||
auth: { | ||
actions: { | ||
getCurrentUser: true, | ||
getMyCredentials: true, | ||
getMyRights: true, | ||
logout: true | ||
} | ||
}, | ||
collection: { | ||
actions: { | ||
getMapping: true, | ||
list: true | ||
} | ||
}, | ||
document: { | ||
actions: { | ||
count: true, | ||
get: true, | ||
mGet: true, | ||
scroll: true, | ||
search: true | ||
} | ||
}, | ||
index: { | ||
actions: { | ||
list: true | ||
} | ||
const response = await kuzzle.security.updateRole('read-only', { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing |
||
controllers: { | ||
auth: { | ||
actions: { | ||
getCurrentUser: true, | ||
getMyCredentials: true, | ||
getMyRights: true, | ||
logout: true | ||
} | ||
}, | ||
collection: { | ||
actions: { | ||
getMapping: true, | ||
list: true | ||
} | ||
}, | ||
document: { | ||
actions: { | ||
count: true, | ||
get: true, | ||
mGet: true, | ||
scroll: true, | ||
search: true | ||
} | ||
}, | ||
index: { | ||
actions: { | ||
list: true | ||
} | ||
} | ||
} | ||
); | ||
}); | ||
|
||
console.log(response); | ||
/* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ hooks: | |
before: | ||
after: | ||
template: default | ||
expected: ^(Kuzzle Server configuration:) {("dump":{.*}),("limits":{.*}),("plugins":{.*}),("queues":{.*}),("repositories":{.*}),("server":{.*}),("services":{.*}),("stats":{.*}),("validation":{.*}),("_":.*),("internal":{.*}),("version":"[0-9]\.[0-9]\.[0-9]")}$ | ||
|
||
expected: ^(Kuzzle Server configuration:) {("dump":{.*}),("limits":{.*}),("plugins":{.*}),("queues":{.*}),("repositories":{.*}),("server":{.*}),("services":{.*}),("stats":{.*}),("validation":{.*}),("_":.*),("internal":{.*}),("version":"[0-9]+\.[0-9]+\.[0-9]+")}$ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the change here is not immediately obvious: this fixes the erroneous version regex that fails now because, kuzzle being in 1.10, the minor version has 2 digits |
||
sdk: js | ||
version: 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to create the role beforehand because now kuzzle refuses to create a profile based on a non-existing role