Skip to content

Conversation

@eguzki
Copy link
Member

@eguzki eguzki commented Jun 14, 2023

how to generate policy file

Run apicast

$ cat <<EOF >config.json
{
   "services": [
      {
         "proxy": {
             "hosts": ["one"],
             "proxy_rules": [],
             "api_backend": "https://echo-api.3scale.net",
             "policy_chain": []
         }
      }
   ]
}
EOF

$ docker run -ti --name apicast --rm -v $PWD/config.json:/opt/app/config.json:ro --env THREESCALE_CONFIG_FILE=/opt/app/config.json --env APICAST_LOG_LEVEL=debug --env APICAST_CONFIGURATION_LOADER=lazy --env APICAST_CONFIGURATION_CACHE=0 --env THREESCALE_DEPLOYMENT_ENV=staging --env BACKEND_ENDPOINT_OVERRIDE=http://127.0.0.1:3000 --env APICAST_WORKERS=1 quay.io/3scale/apicast:v3.13.2

Fetch policies

$ APICAST_IP=$(docker inspect apicast | yq e -P '.[0].NetworkSettings.Networks.bridge.IPAddress' -)
$ curl -v -H "Host: one" http://${APICAST_IP}:8090/policies -o policies.latest.json
# pretty print and fix string encoding issues
$ cat policies.latest.json | jq '.' > policies.latest.p.json

@eguzki eguzki marked this pull request as ready for review June 14, 2023 08:30
@eguzki eguzki requested review from a team as code owners June 14, 2023 08:30
@eguzki eguzki merged commit 6e520b1 into master Jun 14, 2023
@eguzki eguzki deleted the update-policies branch June 14, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants