Skip to content

Commit ecfd360

Browse files
Add util script
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
1 parent f9723d9 commit ecfd360

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
# API_URL=https://api-gw.platform.linuxfoundation.org/cla-service
3+
# DEBUG='' API_URL=https://api-gw.platform.linuxfoundation.org/cla-service companyId='5e8f3a01-b117-4c10-ac26-9dec430bf9c5' projectId='a092M00001JwBlEQAV' ./utils/get_project_company_signatures_v4.sh
4+
if [ -z "$TOKEN" ]
5+
then
6+
# source ./auth0_token.secret
7+
TOKEN="$(cat ./auth0.token.secret)"
8+
fi
9+
10+
if [ -z "$TOKEN" ]
11+
then
12+
echo "$0: TOKEN not specified and unable to obtain one"
13+
exit 1
14+
fi
15+
16+
if [ -z "$XACL" ]
17+
then
18+
XACL="$(cat ./x-acl.secret)"
19+
fi
20+
21+
if [ -z "$XACL" ]
22+
then
23+
echo "$0: XACL not specified and unable to obtain one"
24+
exit 2
25+
fi
26+
27+
if [ -z "${companyId}" ]
28+
then
29+
echo "$0: you need to specify companyId='...'"
30+
exit 3
31+
fi
32+
33+
if [ -z "${projectId}" ]
34+
then
35+
echo "$0: you need to specify projectId='...'"
36+
exit 4
37+
fi
38+
39+
if [ -z "$API_URL" ]
40+
then
41+
export API_URL="http://localhost:5001"
42+
fi
43+
44+
export API_PATH="v4/signatures/project/${projectId}/company/${companyId}"
45+
46+
if [ ! -z "$DEBUG" ]
47+
then
48+
echo "curl -s -XGET -H 'X-ACL: ${XACL}' -H 'Authorization: Bearer ${TOKEN}' -H 'Content-Type: application/json' '${API_URL}/${API_PATH}' | jq -r '.'"
49+
curl -s -XGET -H "X-ACL: ${XACL}" -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" "${API_URL}/${API_PATH}"
50+
else
51+
curl -s -XGET -H "X-ACL: ${XACL}" -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" "${API_URL}/${API_PATH}" | jq -r '.'
52+
fi

0 commit comments

Comments
 (0)