-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vitor Mattos <[email protected]>
- Loading branch information
1 parent
b34003a
commit 666d611
Showing
8 changed files
with
56 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Feature: account/create_to_sign | ||
Background: | ||
Given as user "admin" | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods" | ||
| value | (string)[{"name":"email","enabled":true,"mandatory":true,"can_create_account":true}] | | ||
And my inbox is empty | ||
|
@@ -14,8 +14,8 @@ Feature: account/create_to_sign | |
|
||
Scenario: Try to create with invalid data | ||
Given as user "" | ||
And run the command "user:delete [email protected]" | ||
And run the command "user:delete signer1" | ||
And run the command "user:delete [email protected]" with result code 0 | ||
And run the command "user:delete signer1" with result code 0 | ||
And I open the latest email to "[email protected]" with subject "LibreSign: There is a file for you to sign" | ||
And I fetch the signer UUID from opened email | ||
And follow the link on opened email | ||
|
@@ -36,7 +36,7 @@ Feature: account/create_to_sign | |
|
||
Scenario: Create with valid data | ||
Given as user "" | ||
And run the command "user:delete [email protected]" | ||
And run the command "user:delete [email protected]" with result code 0 | ||
And I open the latest email to "[email protected]" with subject "LibreSign: There is a file for you to sign" | ||
And I fetch the signer UUID from opened email | ||
And follow the link on opened email | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,8 @@ Feature: account/signature | |
|
||
Scenario: Create root certificate with CFSSL engine using API | ||
Given as user "admin" | ||
And run the command "config:app:set libresign certificate_engine --value cfssl" | ||
And run the command "libresign:install --cfssl" | ||
And run the command "config:app:set libresign certificate_engine --value cfssl" with result code 0 | ||
And run the command "libresign:install --cfssl" with result code 0 | ||
And sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/cfssl" | ||
| rootCert | {"commonName":"Common Name","names":{"C":{"id":"C","value":"BR"},"ST":{"id":"ST","value":"State of Company"},"L":{"id":"L","value":"City name"},"O":{"id":"O","value":"Organization"},"OU":{"id":"OU","value":"Organizational Unit"}}} | | ||
And the response should have a status code 200 | ||
|
@@ -31,9 +31,9 @@ Feature: account/signature | |
Given user "signer1" exists | ||
And set the email of user "signer1" to "[email protected]" | ||
And as user "signer1" | ||
And run the command "config:app:set libresign certificate_engine --value cfssl" | ||
And run the command "libresign:install --cfssl" | ||
And run the command "libresign:configure:cfssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name" | ||
And run the command "config:app:set libresign certificate_engine --value cfssl" with result code 0 | ||
And run the command "libresign:install --cfssl" with result code 0 | ||
And run the command "libresign:configure:cfssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name" with result code 0 | ||
And sending "post" to ocs "/apps/libresign/api/v1/account/signature" | ||
| signPassword | password | | ||
And the response should have a status code 200 | ||
|
@@ -56,7 +56,7 @@ Feature: account/signature | |
Given user "signer1" exists | ||
And set the email of user "signer1" to "[email protected]" | ||
And as user "signer1" | ||
And run the command "libresign:configure:openssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name" | ||
And run the command "libresign:configure:openssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name" with result code 0 | ||
And sending "post" to ocs "/apps/libresign/api/v1/account/signature" | ||
| signPassword | password | | ||
And the response should have a status code 200 | ||
|
@@ -76,7 +76,7 @@ Feature: account/signature | |
| (jq).extensions | (jq).subjectKeyIdentifier != "" | | ||
|
||
Scenario: Upload PFX file with error | ||
Given run the command "libresign:configure:openssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name" | ||
Given run the command "libresign:configure:openssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name" with result code 0 | ||
And user "signer1" exists | ||
And as user "signer1" | ||
When sending "post" to ocs "/apps/libresign/api/v1/account/pfx" | ||
|
@@ -86,7 +86,7 @@ Feature: account/signature | |
| message | No certificate file provided | | ||
|
||
Scenario: Change pfx password with success | ||
Given run the command "libresign:configure:openssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name" | ||
Given run the command "libresign:configure:openssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name" with result code 0 | ||
And user "signer1" exists | ||
And as user "signer1" | ||
And sending "post" to ocs "/apps/libresign/api/v1/account/signature" | ||
|
@@ -108,7 +108,7 @@ Feature: account/signature | |
| message | New password to sign documents has been created | | ||
|
||
Scenario: Delete pfx password with success | ||
Given run the command "libresign:configure:openssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name" | ||
Given run the command "libresign:configure:openssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name" with result code 0 | ||
And user "signer1" exists | ||
And as user "signer1" | ||
And sending "post" to ocs "/apps/libresign/api/v1/account/signature" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,9 +33,9 @@ Feature: search | |
Given as user "admin" | ||
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods" | ||
| value | (string)[{"name":"email","enabled":true}] | | ||
And run the command "group:add request_signature" | ||
And run the command "group:adduser request_signature search-signer1" | ||
And run the command "config:app:set libresign groups_request_sign --type=array --value=[\"request_signature\"]" | ||
And run the command "group:add request_signature" with result code 0 | ||
And run the command "group:adduser request_signature search-signer1" with result code 0 | ||
And run the command "config:app:set libresign groups_request_sign --type=array --value=[\"request_signature\"]" with result code 0 | ||
Given as user "search-signer1" | ||
And set the email of user "search-signer1" to "[email protected]" | ||
And set the display name of user "search-signer1" to "My Name" | ||
|
@@ -44,8 +44,8 @@ Feature: search | |
And the response should be a JSON array with the following mandatory values | ||
| key | value | | ||
| ocs | {"meta":{"status":"ok","statuscode":200,"message":"OK"},"data":[]} | | ||
And run the command "group:delete request_signature" | ||
And run the command "config:app:delete libresign groups_request_sign" | ||
And run the command "group:delete request_signature" with result code 0 | ||
And run the command "config:app:delete libresign groups_request_sign" with result code 0 | ||
And set the display name of user "search-signer1" to "search-signer1-displayname" | ||
|
||
Scenario: Search account by herself with permission to identify by account | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ Feature: request-signature | |
Scenario: Get error when try to request to sign isn't manager | ||
Given user "signer1" exists | ||
And as user "signer1" | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
When sending "post" to ocs "/apps/libresign/api/v1/request-signature" | ||
| file | {"base64":""} | | ||
| users | [{"identify":{"account":"signer1"}}] | | ||
|
@@ -15,7 +15,7 @@ Feature: request-signature | |
|
||
Scenario: Get error when try to request to sign without file name | ||
Given as user "admin" | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
When sending "post" to ocs "/apps/libresign/api/v1/request-signature" | ||
| file | {"invalid":""} | | ||
| users | [{"identify":{"account":"signer1"}}] | | ||
|
@@ -28,7 +28,7 @@ Feature: request-signature | |
Scenario: Request to sign with error using different authenticated account | ||
Given as user "admin" | ||
And user "signer1" exists | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And set the email of user "signer1" to "[email protected]" | ||
And reset notifications of user "signer1" | ||
And sending "post" to ocs "/apps/libresign/api/v1/request-signature" | ||
|
@@ -50,7 +50,7 @@ Feature: request-signature | |
Scenario: Request to sign with error when the user is not authenticated | ||
Given as user "admin" | ||
And user "signer1" exists | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And reset notifications of user "signer1" | ||
And my inbox is empty | ||
And sending "post" to ocs "/apps/libresign/api/v1/request-signature" | ||
|
@@ -71,7 +71,7 @@ Feature: request-signature | |
Scenario: Request to sign with error when the authenticated user have an email different of signer | ||
Given as user "admin" | ||
And user "signer1" exists | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And reset notifications of user "signer1" | ||
And set the email of user "signer1" to "[email protected]" | ||
And my inbox is empty | ||
|
@@ -96,8 +96,8 @@ Feature: request-signature | |
Scenario: Request to sign with error when the link was expired | ||
Given as user "admin" | ||
And my inbox is empty | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "config:app:set libresign maximum_validity --value 1" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And run the command "config:app:set libresign maximum_validity --value 1" with result code 0 | ||
When sending "post" to ocs "/apps/libresign/api/v1/request-signature" | ||
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} | | ||
| users | [{"identify":{"email":"signer2@domain.test"}}] | | ||
|
@@ -118,7 +118,7 @@ Feature: request-signature | |
Scenario: Request to sign with success when is necessary to renew the link | ||
Given as user "admin" | ||
And my inbox is empty | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods" | ||
| value | (string)[{"name":"email","enabled":true,"mandatory":true,"can_create_account":false}] | | ||
And sending "post" to ocs "/apps/libresign/api/v1/request-signature" | ||
|
@@ -130,8 +130,8 @@ Feature: request-signature | |
And I open the latest email to "[email protected]" with subject "LibreSign: There is a file for you to sign" | ||
And I fetch the signer UUID from opened email | ||
And as user "" | ||
And run the command "config:app:set libresign maximum_validity --value 300" | ||
And run the command "config:app:set libresign renewal_interval --value 1" | ||
And run the command "config:app:set libresign maximum_validity --value 300" with result code 0 | ||
And run the command "config:app:set libresign renewal_interval --value 1" with result code 0 | ||
Given wait for 2 second | ||
When sending "get" to "/apps/libresign/p/sign/<SIGN_UUID>" | ||
Then the response should have a status code 422 | ||
|
@@ -152,7 +152,7 @@ Feature: request-signature | |
# setting the renewal interval to 2 and making 3 requests, one by second, | ||
# the 3rd don't will fail because on each valid request, the renewal | ||
# interval is renewed. | ||
And run the command "config:app:set libresign renewal_interval --value 2" | ||
And run the command "config:app:set libresign renewal_interval --value 2" with result code 0 | ||
Given wait for 1 second | ||
When sending "get" to "/apps/libresign/p/sign/<SIGN_UUID>" | ||
And the response should have a status code 200 | ||
|
@@ -182,7 +182,7 @@ Feature: request-signature | |
Scenario: Request to sign with success using account as identifier | ||
Given as user "admin" | ||
And user "signer1" exists | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And set the email of user "signer1" to "[email protected]" | ||
And reset notifications of user "signer1" | ||
And my inbox is empty | ||
|
@@ -203,7 +203,7 @@ Feature: request-signature | |
|
||
Scenario: Request to sign with error using account as identifier with invalid email | ||
Given as user "admin" | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
When sending "post" to ocs "/apps/libresign/api/v1/request-signature" | ||
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} | | ||
| users | [{"identify":{"account":"invaliddomain.test"}}] | | ||
|
@@ -215,7 +215,7 @@ Feature: request-signature | |
|
||
Scenario: Request to sign with error using email as account identifier | ||
Given as user "admin" | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
When sending "post" to ocs "/apps/libresign/api/v1/request-signature" | ||
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} | | ||
| users | [{"identify":{"account":"signer3@domain.test"}}] | | ||
|
@@ -227,7 +227,7 @@ Feature: request-signature | |
|
||
Scenario: Request to sign with success using email as identifier and URL as file | ||
Given as user "admin" | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And my inbox is empty | ||
When sending "post" to ocs "/apps/libresign/api/v1/request-signature" | ||
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} | | ||
|
@@ -240,7 +240,7 @@ Feature: request-signature | |
Scenario: Request to sign with success using account as identifier and URL as file | ||
Given as user "admin" | ||
And user "signer1" exists | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And set the email of user "signer1" to "[email protected]" | ||
And reset notifications of user "signer1" | ||
And my inbox is empty | ||
|
@@ -258,7 +258,7 @@ Feature: request-signature | |
|
||
Scenario: Request to sign with success using email as identifier | ||
Given as user "admin" | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And set the email of user "signer1" to "[email protected]" | ||
And my inbox is empty | ||
When sending "post" to ocs "/apps/libresign/api/v1/request-signature" | ||
|
@@ -271,7 +271,7 @@ Feature: request-signature | |
|
||
Scenario: Request to sign using email as identifier and when is necessary to use visible elements | ||
Given as user "admin" | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods" | ||
| value | (string)[{"name":"email","enabled":true,"mandatory":true,"can_create_account":false}] | | ||
And I send a file to be signed | ||
|
@@ -299,7 +299,7 @@ Feature: request-signature | |
Scenario: Request to sign with success using multiple users | ||
Given as user "admin" | ||
And user "signer1" exists | ||
And run the command "libresign:configure:openssl --cn test" | ||
And run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And set the email of user "signer1" to "[email protected]" | ||
And my inbox is empty | ||
When sending "post" to ocs "/apps/libresign/api/v1/request-signature" | ||
|
@@ -316,7 +316,7 @@ Feature: request-signature | |
And I open the latest email to "[email protected]" with subject "LibreSign: There is a file for you to sign" | ||
|
||
Scenario: CRUD of identify methods | ||
Given run the command "libresign:configure:openssl --cn test" | ||
Given run the command "libresign:configure:openssl --cn test" with result code 0 | ||
And user "signer1" exists | ||
And as user "admin" | ||
When I send a file to be signed | ||
|