Skip to content

Commit

Permalink
I hate ci dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Aschen committed Aug 18, 2020
1 parent 5255678 commit 3401e54
Show file tree
Hide file tree
Showing 36 changed files with 55 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: auth#createApiKey
description: Creates a new API key for the currently loggued user.
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": ["default"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
try {
await kuzzle.auth.login('local', { username: 'john.doe', password: 'password' });
await kuzzle.auth.login('local', { username: 'jane.doe', password: 'password' });

await kuzzle.auth.deleteApiKey('fQRa28BsidO6V_wmOcL');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ name: auth#deleteApiKey
description: Deletes an API key for the currently loggued user
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": ["default"]
},
"credentials": {
"local": {
"username": "john.doe",
"username": "jane.doe",
"password": "password"
}
}
}' "kuzzle:7512/users/john.doe/_create?refresh=wait_for"
}' "kuzzle:7512/users/jane.doe/_create?refresh=wait_for"
&&
curl -XPOST -H "Content-type: application/json" -d '{
"description": "Sigfox API key"
}' "kuzzle:7512/users/john.doe/api-keys/_create?_id=fQRa28BsidO6V_wmOcL&refresh=wait_for"
}' "kuzzle:7512/users/jane.doe/api-keys/_create?_id=fQRa28BsidO6V_wmOcL&refresh=wait_for"
after:
curl -XDELETE kuzzle:7512/users/john.doe
curl -XDELETE kuzzle:7512/users/jane.doe
template: default
expected:
- API key successfully deleted
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
try {
const promises = [];

// Create some API keys for user "john.doe"
// Create some API keys for user "jared.doe"
promises.push(
kuzzle.security.createApiKey('john.doe', 'Sigfox API key'));
kuzzle.security.createApiKey('jared.doe', 'Sigfox API key'));
promises.push(
kuzzle.security.createApiKey('john.doe', 'LoRa 6 month API key', {
kuzzle.security.createApiKey('jared.doe', 'LoRa 6 month API key', {
expiresIn: '6m'
}));
promises.push(
kuzzle.security.createApiKey('john.doe', 'LoRa permanent API key', {
kuzzle.security.createApiKey('jared.doe', 'LoRa permanent API key', {
refresh: 'wait_for'
}));

await Promise.all(promises);

// Log as "john.doe"
await kuzzle.auth.login('local', { username: 'john.doe', password: 'password' });
// Log as "jared.doe"
await kuzzle.auth.login('local', { username: 'jared.doe', password: 'password' });

const results = await kuzzle.auth.searchApiKeys({
match: {
Expand All @@ -33,7 +33,7 @@ try {
"_id": "znEwbG8BJASM_0-bWU-q",
"_source": {
"description": "LoRa permanent API key",
"userId": "john.doe",
"userId": "jared.doe",
"expiresAt": -1,
"ttl": -1
}
Expand All @@ -42,7 +42,7 @@ try {
"_id": "zXEwbG8BJASM_0-bWU-q",
"_source": {
"description": "LoRa 1 year API key",
"userId": "john.doe",
"userId": "jared.doe",
"expiresAt": 31557600000,
"ttl": 360000
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ name: auth#searchApiKeys
description: Searches API keys for the currently loggued user.
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": ["default"]
},
"credentials": {
"local": {
"username": "john.doe",
"username": "jared.doe",
"password": "password"
}
}
}' "kuzzle:7512/users/john.doe/_create?refresh=wait_for"
sleep 2
}' "kuzzle:7512/users/jared.doe/_create?refresh=wait_for"
after:
curl -XDELETE kuzzle:7512/users/john.doe
curl -XDELETE kuzzle:7512/users/jared.doe
template: default
expected:
- Found 2 API keys matching "LoRa"
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ hooks:
curl -XPUT kuzzle:7512/nyc-open-data/yellow-taxi
for i in 1 2 3 4 5; do
curl -H "Content-type: application/json" -d '{"capacity": 4}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
curl --fail -H "Content-type: application/json" -d '{"capacity": 4}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
done
for i in 1 2 3 4 5; do
curl -H "Content-type: application/json" -d '{"capacity": 7}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
curl --fail -H "Content-type: application/json" -d '{"capacity": 7}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
done
curl -XPOST kuzzle:7512/nyc-open-data/yellow-taxi/_refresh
Expand Down
4 changes: 2 additions & 2 deletions doc/7/controllers/document/count/snippets/count.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ hooks:
curl -XPOST kuzzle:7512/nyc-open-data/_create
curl -XPUT kuzzle:7512/nyc-open-data/yellow-taxi
for i in 1 2 3 4 5; do
curl -H "Content-type: application/json" -d '{"license": "valid"}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
curl --fail -H "Content-type: application/json" -d '{"license": "valid"}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
done
for i in 1 2 3 4 5; do
curl -H "Content-type: application/json" -d '{}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
curl --fail -H "Content-type: application/json" -d '{}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
done
curl -XPOST kuzzle:7512/nyc-open-data/yellow-taxi/_refresh
after:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ hooks:
curl -XPUT kuzzle:7512/nyc-open-data/yellow-taxi
for i in 1 2 3 4 5; do
curl -H "Content-type: application/json" -d '{"capacity": 4}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
curl --fail -H "Content-type: application/json" -d '{"capacity": 4}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
done
for i in 1 2 3 4 5; do
curl -H "Content-type: application/json" -d '{"capacity": 7}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
curl --fail -H "Content-type: application/json" -d '{"capacity": 7}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
done
curl -XPOST kuzzle:7512/nyc-open-data/yellow-taxi/_refresh
Expand Down
2 changes: 1 addition & 1 deletion doc/7/controllers/document/delete/snippets/delete.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ hooks:
curl -XDELETE kuzzle:7512/nyc-open-data
curl -XPOST kuzzle:7512/nyc-open-data/_create
curl -XPUT kuzzle:7512/nyc-open-data/yellow-taxi
curl -H "Content-type: application/json" -XPUT -d '{}' kuzzle:7512/nyc-open-data/yellow-taxi/some-id
curl --fail -H "Content-type: application/json" -XPUT -d '{}' kuzzle:7512/nyc-open-data/yellow-taxi/some-id
after:
template: default
expected: Success
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ hooks:
curl -XPOST kuzzle:7512/nyc-open-data/_create
curl -XPUT kuzzle:7512/nyc-open-data/yellow-taxi
for i in 1 2 ; do
curl -H "Content-type: application/json" -d '{"capacity": 4}' kuzzle:7512/nyc-open-data/yellow-taxi/document_$i/_create
curl --fail -H "Content-type: application/json" -d '{"capacity": 4}' kuzzle:7512/nyc-open-data/yellow-taxi/document_$i/_create
done
for i in 1 2 3 4 5; do
curl -H "Content-type: application/json" -d '{"capacity": 7}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
curl --fail -H "Content-type: application/json" -d '{"capacity": 7}' kuzzle:7512/nyc-open-data/yellow-taxi/_create
done
curl -XPOST kuzzle:7512/nyc-open-data/yellow-taxi/_refresh
after:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#createApiKey
description: Creates a new API key for an user
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": ["default"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#deleteApiKey
description: Deletes an user API key
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": ["default"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#deleteCredentials
description: deletes credentials
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": ["default"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#deleteProfile
description: deletes profile
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"policies": []
}' kuzzle:7512/profiles/myProfile/_create
template: default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#deleteRole
description: deletes role
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"controllers": {
"*": {
"actions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#deleteUser
description: Deletes a user
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": ["default"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#getCredentialsById
description: get credentials by id
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": ["default"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#getCredentials
description: get credentials
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": ["default"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#getProfileRights
description: get profile rights
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"policies": [
{
"roleId": "admin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#getProfile
description: get profile
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"policies": [
{
"roleId": "admin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#getRole
description: get role
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"controllers": {
"auth": {
"actions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#getUserRights
description: get user rights
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": [ "default" ],
"fullName": "John Doe"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#getUser
description: get user
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": [ "default" ],
"fullName": "John Doe"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#hasCredentials
description: has credentials
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": [ "default" ],
"fullName": "John Doe"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: mdelete profiles
hooks:
before: |
for i in 1 2 3 4 5; do
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"policies": [{ "roleId": "default" }]
}' kuzzle:7512/profiles/profile${i}/_create
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: mdelete roles
hooks:
before: |
for i in 1 2 3 4 5; do
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"controllers": {
"*": {
"actions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: mdelete users
hooks:
before: |
for i in 1 2 3; do
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": [ "default" ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: mget profiles
hooks:
before: |
for i in 1 2 3; do
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"policies": [{"roleId": "default"}]
}' kuzzle:7512/profiles/profile${i}/_create
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: mget roles
hooks:
before: |
for i in 1 2 3; do
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"controllers": {
"*": {
"actions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: mget users
hooks:
before: |
for i in 1 2 3; do
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": ["default"],
"fullname": "user'${i}'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#replaceUser
description: replace user
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": [ "default" ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: security#searchApiKeys
description: Searches for an user API keys
hooks:
before: >
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": ["default"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: search profiles
hooks:
before: |
for i in 1 2 3; do
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"policies": [{ "roleId": "default" }]
}' kuzzle:7512/profiles/profile${i}/_create?refresh=wait_for
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: search users
hooks:
before: |
for i in 1 2 3; do
curl -H "Content-type: application/json" -d '{
curl --fail -H "Content-type: application/json" -d '{
"content": {
"profileIds": [ "default" ],
"status": "student"
Expand Down
Loading

0 comments on commit 3401e54

Please sign in to comment.