This repository was archived by the owner on Jan 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 22
33mkdir -p cloudflare_mock/cdn-cgi/access
44
5+ printf " \nGenerating Private Key & Certificate: \n"
56openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \
67 -subj " /C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" \
78 -keyout certs/private.key -out certs/certificate.pem
89
910CERT=$( cat certs/certificate.pem)
1011
12+ printf " \nAdding Certificate to JWKS Endpoint: \n"
1113jq -n --arg cert " $CERT " ' {public_certs: [{kid: "1", cert: $cert}, {kid: "2", cert: $cert}]}' \
12- > cloudflare_mock/cdn-cgi/access/certs
14+ > cloudflare_mock/cdn-cgi/access/certs && echo " done "
1315
1416docker-compose stop
1517docker-compose up -d
3840# wait a couple of seconds for the backends to start for haproxy
3941sleep 3
4042
43+ printf " \nCURL Response with Bad Cf-Access-Jwt-Assertion header: \n"
44+ curl -H " Cf-Access-Jwt-Assertion: non-valid-token" localhost:8080
45+
4146JWT_TOKEN=$( jwtgen -a RS256 -p certs/private.key --claims " $CLAIM " )
4247
48+ printf " \nCURL Response with Valid Cf-Access-Jwt-Assertion header: \n"
4349curl -H " Cf-Access-Jwt-Assertion: ${JWT_TOKEN} " localhost:8080
4450
4551docker-compose stop
You can’t perform that action at this time.
0 commit comments