Skip to content

Commit

Permalink
docs: fix user guide authenticated rl for app devs based on authpolic…
Browse files Browse the repository at this point in the history
…y/v1beta2 (#282)
  • Loading branch information
guicassolato authored Oct 25, 2023
1 parent 6bffa0b commit 7d0f44e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions doc/user-guides/authenticated-rl-for-app-developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ spec:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: toystore
routes:
- paths:
- "/toy"
rules:
authentication:
"api-key-users":
Expand All @@ -130,9 +127,9 @@ spec:
matchLabels:
app: toystore
allNamespaces: true
credentials:
authorizationHeader:
prefix: APIKEY
credentials:
authorizationHeader:
prefix: APIKEY
response:
success:
dynamicMetadata:
Expand Down Expand Up @@ -235,13 +232,13 @@ Verify the rate limiting works by sending requests as Alice and Bob.
Up to 5 successful (`200 OK`) requests every 10 seconds allowed for Alice, then `429 Too Many Requests`:

```sh
while :; do curl --write-out '%{http_code}' --silent --output /dev/null -H 'Authorization: APIKEY IAMALICE' -H 'Host: api.toystore.com' http://localhost:9080/toy | egrep --color "\b(429)\b|$"; sleep 1; done
while :; do curl --write-out '%{http_code}\n' --silent --output /dev/null -H 'Authorization: APIKEY IAMALICE' -H 'Host: api.toystore.com' http://localhost:9080/toy | egrep --color "\b(429)\b|$"; sleep 1; done
```

Up to 2 successful (`200 OK`) requests every 10 seconds allowed for Bob, then `429 Too Many Requests`:

```sh
while :; do curl --write-out '%{http_code}' --silent --output /dev/null -H 'Authorization: APIKEY IAMBOB' -H 'Host: api.toystore.com' http://localhost:9080/toy | egrep --color "\b(429)\b|$"; sleep 1; done
while :; do curl --write-out '%{http_code}\n' --silent --output /dev/null -H 'Authorization: APIKEY IAMBOB' -H 'Host: api.toystore.com' http://localhost:9080/toy | egrep --color "\b(429)\b|$"; sleep 1; done
```

## Cleanup
Expand Down

0 comments on commit 7d0f44e

Please sign in to comment.