Skip to content

Commit f2184be

Browse files
Sync
Signed-off-by: Łukasz Gryglicki <[email protected]>
1 parent 2e02f21 commit f2184be

6 files changed

+147
-3
lines changed

utils/request_corporate_signature_post.sh renamed to utils/request_corporate_signature_go_post.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# return_url_type='github'
66
# return_url='http://localhost'
77
# TOKEN='...' - Auth0 JWT bearer token
8-
# DEBUG=1 TOKEN="$(cat ./auth0.token.secret)" ./utils/request_corporate_signature_post.sh 862ff296-6508-4f10-9147-2bc2dd7bfe80 88ee12de-122b-4c46-9046-19422054ed8d github 'http://localhost'
8+
# DEBUG=1 TOKEN="$(cat ./auth0.token.secret)" ./utils/request_corporate_signature_go_post.sh 862ff296-6508-4f10-9147-2bc2dd7bfe80 88ee12de-122b-4c46-9046-19422054ed8d github 'http://localhost'
99
# TODO: this is WIP atm (due to AUTH0 token and X-ACL missing)
1010

1111
if [ -z "$TOKEN" ]

utils/request_employee_signature_post.sh renamed to utils/request_employee_signature_go_post.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# project_id='88ee12de-122b-4c46-9046-19422054ed8d'
66
# return_url_type='github'
77
# return_url='http://localhost'
8-
# DEBUG=1 ./utils/request_employee_signature_post.sh 9dcf5bbc-2492-11ed-97c7-3e2a23ea20b5 862ff296-6508-4f10-9147-2bc2dd7bfe80 88ee12de-122b-4c46-9046-19422054ed8d github 'http://localhost'
8+
# DEBUG=1 ./utils/request_employee_signature_py_post.sh 9dcf5bbc-2492-11ed-97c7-3e2a23ea20b5 862ff296-6508-4f10-9147-2bc2dd7bfe80 88ee12de-122b-4c46-9046-19422054ed8d github 'http://localhost'
99

1010
if [ -z "$1" ]
1111
then
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
# API_URL=https://3f13-147-75-85-27.ngrok-free.app (defaults to localhost:5000)
3+
# user_id='9dcf5bbc-2492-11ed-97c7-3e2a23ea20b5'
4+
# company_id='862ff296-6508-4f10-9147-2bc2dd7bfe80'
5+
# project_id='88ee12de-122b-4c46-9046-19422054ed8d'
6+
# return_url_type='github'
7+
# return_url='http://localhost'
8+
# DEBUG=1 ./utils/request_employee_signature_py_post.sh 9dcf5bbc-2492-11ed-97c7-3e2a23ea20b5 862ff296-6508-4f10-9147-2bc2dd7bfe80 88ee12de-122b-4c46-9046-19422054ed8d github 'http://localhost'
9+
10+
if [ -z "$1" ]
11+
then
12+
echo "$0: you need to specify user_id as a 1st parameter"
13+
exit 1
14+
fi
15+
export user_id="$1"
16+
17+
if [ -z "$2" ]
18+
then
19+
echo "$0: you need to specify company_id as a 2nd parameter"
20+
exit 2
21+
fi
22+
export company_id="$2"
23+
24+
if [ -z "$3" ]
25+
then
26+
echo "$0: you need to specify project_id as a 3rd parameter"
27+
exit 3
28+
fi
29+
export project_id="$3"
30+
31+
if [ -z "$4" ]
32+
then
33+
echo "$0: you need to specify return_url_type as a 4th parameter: github|gitlab|gerrit"
34+
exit 4
35+
fi
36+
export return_url_type="$4"
37+
38+
if [ -z "$5" ]
39+
then
40+
echo "$0: you need to specify return_url as a 5th parameter"
41+
exit 5
42+
fi
43+
export return_url="$5"
44+
45+
if [ -z "$API_URL" ]
46+
then
47+
export API_URL="http://localhost:5000"
48+
fi
49+
50+
if [ ! -z "$DEBUG" ]
51+
then
52+
echo "curl -s -XPOST -H 'Authorization: Bearer ${TOKEN}' -H 'Content-Type: application/json' '${API_URL}/v2/request-employee-signature' -d '{\"project_id\":\"${project_id}\",\"user_id\":\"${user_id}\",\"company_id\":\"${company_id}\",\"return_url_type\":\"${return_url_type}\",\"return_url\":\"${return_url}\"}' | jq -r '.'"
53+
fi
54+
curl -s -XPOST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" "${API_URL}/v2/request-employee-signature" -d "{\"project_id\":\"${project_id}\",\"user_id\":\"${user_id}\",\"company_id\":\"${company_id}\",\"return_url_type\":\"${return_url_type}\",\"return_url\":\"${return_url}\"}" | jq -r '.'
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/bash
2+
# API_URL=https://3f13-147-75-85-27.ngrok-free.app (defaults to localhost:5000)
3+
# user_id='9dcf5bbc-2492-11ed-97c7-3e2a23ea20b5'
4+
# project_id='88ee12de-122b-4c46-9046-19422054ed8d'
5+
# return_url_type='github'
6+
# return_url='http://localhost'
7+
# TOKEN='...' - Auth0 JWT bearer token
8+
# XACL='...' - X-ACL header
9+
# DEBUG=1 TOKEN="$(cat ./auth0.token.secret)" XACL="$(cat ./x-acl.secret)" ./utils/request_individual_signature_go_post.sh 9dcf5bbc-2492-11ed-97c7-3e2a23ea20b5 88ee12de-122b-4c46-9046-19422054ed8d github 'http://localhost'
10+
11+
if [ -z "$TOKEN" ]
12+
then
13+
# source ./auth0_token.secret
14+
TOKEN="$(cat ./auth0.token.secret)"
15+
fi
16+
17+
if [ -z "$TOKEN" ]
18+
then
19+
echo "$0: TOKEN not specified and unable to obtain one"
20+
exit 1
21+
fi
22+
23+
if [ -z "$XACL" ]
24+
then
25+
XACL="$(cat ./x-acl.secret)"
26+
fi
27+
28+
if [ -z "$XACL" ]
29+
then
30+
echo "$0: XACL not specified and unable to obtain one"
31+
exit 2
32+
fi
33+
34+
if [ -z "$1" ]
35+
then
36+
echo "$0: you need to specify user_id as a 1st parameter"
37+
exit 3
38+
fi
39+
export user_id="$1"
40+
41+
if [ -z "$2" ]
42+
then
43+
echo "$0: you need to specify project_id as a 2nd parameter"
44+
exit 4
45+
fi
46+
export project_id="$2"
47+
48+
if [ -z "$3" ]
49+
then
50+
echo "$0: you need to specify return_url_type as a 3rd parameter: github|gitlab|gerrit"
51+
exit 5
52+
fi
53+
export return_url_type="$3"
54+
55+
if [ -z "$4" ]
56+
then
57+
echo "$0: you need to specify return_url as a 4th parameter"
58+
exit 6
59+
fi
60+
export return_url="$4"
61+
62+
if [ -z "$API_URL" ]
63+
then
64+
export API_URL="http://localhost:5000"
65+
fi
66+
67+
if [ ! -z "$DEBUG" ]
68+
then
69+
echo "curl -s -XPOST -H 'X-ACL: ${XACL}' -H 'Authorization: Bearer ${TOKEN}' -H 'Content-Type: application/json' '${API_URL}/v4/request-individual-signature' -d '{\"project_id\":\"${project_id}\",\"user_id\":\"${user_id}\",\"return_url_type\":\"${return_url_type}\",\"return_url\":\"${return_url}\"}' | jq -r '.'"
70+
fi
71+
curl -s -XPOST -H "X-ACL: ${XACL}" -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" "${API_URL}/v4/request-individual-signature" -d "{\"project_id\":\"${project_id}\",\"user_id\":\"${user_id}\",\"return_url_type\":\"${return_url_type}\",\"return_url\":\"${return_url}\"}" | jq -r '.'

utils/request_individual_signature_post.sh renamed to utils/request_individual_signature_py_post.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# project_id='88ee12de-122b-4c46-9046-19422054ed8d'
55
# return_url_type='github'
66
# return_url='http://localhost'
7-
# DEBUG=1 ./utils/request_individual_signature_post.sh 9dcf5bbc-2492-11ed-97c7-3e2a23ea20b5 88ee12de-122b-4c46-9046-19422054ed8d github 'http://localhost'
7+
# DEBUG=1 ./utils/request_individual_signature_py_post.sh 9dcf5bbc-2492-11ed-97c7-3e2a23ea20b5 88ee12de-122b-4c46-9046-19422054ed8d github 'http://localhost'
88

99
if [ -z "$1" ]
1010
then

utils/run_tests.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# PY=1
3+
# GO=1
4+
if [ ! -z "$PY" ]
5+
then
6+
cd cla-backend && pytest "cla/tests" -p no:warnings
7+
cd ..
8+
else
9+
echo "$0: skipping python backend tests, specify PY=1 to run them"
10+
fi
11+
12+
if [ ! -z "$GO" ]
13+
then
14+
cd cla-backend-go && make test
15+
cd ..
16+
else
17+
echo "$0: skipping golang backend tests, specify GO=1 to run them"
18+
fi
19+

0 commit comments

Comments
 (0)