-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (47 loc) · 3.25 KB
/
apiTest.yml
File metadata and controls
66 lines (47 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Test API
on:
workflow_dispatch:
push:
branches:
- workflow-test
paths:
- 'api/source/**'
jobs:
test_api:
name: Build production API and test
runs-on: ubuntu-latest
steps:
-
name: Check out the repo
uses: actions/checkout@v2
-
name: Build API
id: build
run: |
pwd
ls -l ./test
cat ./test/Dockerfile
docker build -t stig-manager -f ./test/Dockerfile .
-
name: Orchestrate
id: Orchestrate
run: |
cd test
docker-compose up -d
-
name: Sleep for 45 seconds
uses: jakejarvis/wait-action@master
with:
time: '45s'
-
name: cURL Test
id: curl
run: |
TOKEN="Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGSjg2R2NGM2pUYk5MT2NvNE52WmtVQ0lVbWZZQ3FvcXRPUWVNZmJoTmxFIn0.eyJleHAiOjE2MDQ0MTMzNzYsImlhdCI6MTYwNDM0ODYwMywiYXV0aF90aW1lIjoxNjA0MzQ4NTc2LCJqdGkiOiJmOThjMTVhYi1lNjM1LTQ0MjgtOTk5NC04YWJmMzA1YzZhZDAiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvc3RpZ21hbiIsImF1ZCI6WyJyZWFsbS1tYW5hZ2VtZW50IiwiYWNjb3VudCJdLCJzdWIiOiJhZmU2MTEzNC01NWVhLTRiODgtOGE3Ni0yYWE1YTRhM2QzMjYiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJzdGlnLW1hbmFnZXIiLCJzZXNzaW9uX3N0YXRlIjoiMDYzYjg5ZTMtM2NhZC00MDc3LTkxNTktZjhhYThmZGY2OWJhIiwiYWNyIjoiMCIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJjcmVhdGVfY29sbGVjdGlvbiIsImFkbWluIiwidXNlciJdfSwicmVzb3VyY2VfYWNjZXNzIjp7InJlYWxtLW1hbmFnZW1lbnQiOnsicm9sZXMiOlsidmlldy11c2VycyIsInF1ZXJ5LWdyb3VwcyIsInF1ZXJ5LXVzZXJzIl19LCJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6IiIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic3RpZ21hbmFkbWluIn0.D0J9M1g8mZuD0dU8dFCa_9lnl1V7FVKpW8DVw8ZGv5H63DZNjRuynLsaTpxR_nT4tkdLh9KBhIQa8JoUhho5_gQipB4SxtrC7d8QeGaa4G80bmpR0voSwRZoCJ9aoXGRbKtyJQq3bSAIi8pFWyPCmAmuUEhu5ljc8gYh2htN7dE"
curl -l http://localhost:64001/api/user -H "accept: application/json" -H "$TOKEN"
curl -X POST "http://localhost:64001/api/stigs" -H "accept: application/json" -H "$TOKEN" -H "Content-Type: multipart/form-data" -F "replace=true" -F "importFile=@test/stigs/U_VPN_SRG_V1R1_Manual-xccdf.xml;type=text/xml"
curl -X POST "http://localhost:64001/api/stigs" -H "accept: application/json" -H "$TOKEN" -H "Content-Type: multipart/form-data" -F "replace=true" -F "importFile=@test/stigs/U_RHEL_7_STIG_V3R0-3_Manual-xccdf.xml;type=text/xml"
curl -X POST "http://localhost:64001/api/stigs" -H "accept: application/json" -H "$TOKEN" -H "Content-Type: multipart/form-data" -F "replace=true" -F "importFile=@test/stigs/U_MS_Windows_10_STIG_V1R23_Manual-xccdf.xml;type=text/xml"
curl -X GET "http://localhost:64001/api/stigs" -H "accept: application/json" -H "$TOKEN"
curl -X POST "http://localhost:64001/api/op/appdata?elevate=true" -H "accept: application/json" -H "$TOKEN" -H "Content-Type: multipart/form-data" -F "importFile=@test/appdata.json;type=application/json"
curl -X GET "http://localhost:64001/api/collections?projection=owners&projection=statistics" -H "accept: application/json" -H "$TOKEN"