-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b40395
commit 35502d6
Showing
5 changed files
with
60 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copy this file in .env.local and change values as needed | ||
COMMON_LOGIN_URL=https://common-sandbox.api.acubeapi.com | ||
COMMON_LOGIN_EMAIL=[email protected] | ||
COMMON_LOGIN_PASSWORD=SomePassword |
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,3 +1,4 @@ | ||
/node_modules/ | ||
/.idea/ | ||
/dist/ | ||
/.env.local |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
######################################################################################################################## | ||
# This script get a JWT token from common sandbox and it is executed also from other scripts | ||
# It requires jq | ||
# You need to add COMMON_LOGIN_URL, COMMON_LOGIN_EMAIL and COMMON_LOGIN_PASSWORD in env.local as well | ||
######################################################################################################################## | ||
|
||
|
||
DIR="$(dirname "${BASH_SOURCE[0]}")" | ||
DIR="$(readlink -f "${DIR}")" | ||
|
||
source "${DIR}"/../.env.local | ||
|
||
JSON_REQUEST=$( jq -n \ | ||
--arg em "$COMMON_LOGIN_EMAIL" \ | ||
--arg pw "$COMMON_LOGIN_PASSWORD" \ | ||
'{email: $em, password: $pw}' ) | ||
|
||
curl -s --location --request POST "$COMMON_LOGIN_URL/login" \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw "$JSON_REQUEST" | jq -r '.token' |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
######################################################################################################################## | ||
# Use this script to verify a company | ||
######################################################################################################################## | ||
|
||
if [ "$#" -lt 1 ]; | ||
then | ||
echo "Use this script to verify a company" | ||
echo "One parameter is needed, which indicates fiscal ID of the company." | ||
echo "Change .env.local and the REMOTE_HOST variable to connect to prod or sanbdox." | ||
echo "$0 123456789" | ||
exit 1 | ||
fi | ||
|
||
DIR="$(dirname "${BASH_SOURCE[0]}")" | ||
DIR="$(readlink -f "${DIR}")" | ||
|
||
REMOTE_HOST=https://api-sandbox.acubeapi.com | ||
|
||
DIR="$(dirname "${BASH_SOURCE[0]}")" | ||
DIR="$(readlink -f "${DIR}")" | ||
|
||
export JWT=$("${DIR}"/getJWT.sh) | ||
|
||
curl -X GET -k --no-progress-meter -H "Authorization: bearer $JWT" -H 'Accept: application/json' -H 'Content-Type: application/json' $REMOTE_HOST/verify/company/${1} | jq |