Skip to content

Commit 491c1ff

Browse files
authored
Update Readme.dev.md (#24)
- fix typo: "uf" to "of" - fix indent of code snippets to align with bulleted-list
1 parent a71a53d commit 491c1ff

File tree

1 file changed

+71
-71
lines changed

1 file changed

+71
-71
lines changed

Readme.dev.md

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -14,105 +14,105 @@ Have a look at the table below:
1414
| 3500 | 1044854 | 327536 | 23.86% | 843754 | 2005030 | 70.38% |
1515
| 5800 | 1044899 | 285553 | 21.46% | 668146 | 3936820 | 85.49% |
1616

17-
Based on the results above, we assume that this plugin and Kong is more reliable than AWS API Gateway, at least in the case when a lot uf users have to be served.
17+
Based on the results above, we assume that this plugin and Kong is more reliable than AWS API Gateway, at least in the case when a lot of users have to be served.
1818

1919
### Plugin Development
2020
Below you will find some actions you might want to perform during plugin development
2121

2222
* #### restarting dev env
23-
```sh
24-
pongo down && pongo run --no-cassandra && pongo shell
25-
```
23+
```sh
24+
pongo down && pongo run --no-cassandra && pongo shell
25+
```
2626

2727
* #### starting kong
28-
```sh
29-
kong migrations bootstrap --force && kong start
30-
```
28+
```sh
29+
kong migrations bootstrap --force && kong start
30+
```
3131

3232
* #### reloading kong
33-
```sh
34-
kong reload
35-
```
33+
```sh
34+
kong reload
35+
```
3636

3737
* #### exporting ENV var used below
38-
```sh
39-
export kong_proxf_url=http://localhost:8000
40-
export kong_admin_url=http://localhost:8001
41-
export service_name=echo
42-
export plugin_name=aws-request-signing
43-
export lambda_url=http://example.com
44-
```
38+
```sh
39+
export kong_proxf_url=http://localhost:8000
40+
export kong_admin_url=http://localhost:8001
41+
export service_name=echo
42+
export plugin_name=aws-request-signing
43+
export lambda_url=http://example.com
44+
```
4545

4646
* #### exporting Token used to AssumeRoleWithWebIdentity
47-
```sh
48-
export auth_token=
49-
```
47+
```sh
48+
export auth_token=
49+
```
5050

5151
* #### Simple service + route + plugin configuration
52-
```sh
53-
curl -i -X POST \
54-
--url $kong_admin_url/services/ \
55-
--data "name=$service_name" \
56-
--data "url=https://$lambda_url/" && curl -i -X POST \
57-
--url $kong_admin_url/services/$service_name/routes \
58-
--data "paths[]=/$service_name" && curl -i -X POST \
59-
--url $kong_admin_url/services/$service_name/plugins/ \
60-
--data "name=$plugin_name" \
61-
--data 'config.aws_assume_role_arn=arn:aws:iam::3000453029296:role/azure-lambda' \
62-
--data 'config.aws_assume_role_name=azure-lambda'\
63-
--data 'config.aws_region=eu-west-1' \
64-
--data 'config.aws_service=lambda'
65-
```
52+
```sh
53+
curl -i -X POST \
54+
--url $kong_admin_url/services/ \
55+
--data "name=$service_name" \
56+
--data "url=https://$lambda_url/" && curl -i -X POST \
57+
--url $kong_admin_url/services/$service_name/routes \
58+
--data "paths[]=/$service_name" && curl -i -X POST \
59+
--url $kong_admin_url/services/$service_name/plugins/ \
60+
--data "name=$plugin_name" \
61+
--data 'config.aws_assume_role_arn=arn:aws:iam::3000453029296:role/azure-lambda' \
62+
--data 'config.aws_assume_role_name=azure-lambda'\
63+
--data 'config.aws_region=eu-west-1' \
64+
--data 'config.aws_service=lambda'
65+
```
6666

6767
* #### Configuring a service a route and adding the Kong Request-Transformer and this plugin
68-
```sh
69-
curl -i -X POST \
70-
--url $kong_admin_url/services/ \
71-
--data "name=$service_name" \
72-
--data "url=https://$lambda_url/" && curl -i -X POST \
73-
--url $kong_admin_url/services/$service_name/routes \
74-
--data "paths[]=/digital/api/(?<g1>$service_name)" && curl -i -X POST \
75-
--url $kong_admin_url/services/$service_name/plugins/ \
76-
--data "name=request-transformer" \
77-
--data 'config.replace.uri=/$(uri_captures.g1)' && curl -i -X POST \
78-
--url $kong_admin_url/services/$service_name/plugins/ \
79-
--data "name=$plugin_name" \
80-
--data 'config.aws_assume_role_arn=arn:aws:iam::300063049296:role/azure-lambda' \
81-
--data 'config.aws_assume_role_name=azure-lambda'\
82-
--data 'config.aws_region=eu-west-1' \
83-
--data 'config.aws_service=lambda'
84-
```
68+
```sh
69+
curl -i -X POST \
70+
--url $kong_admin_url/services/ \
71+
--data "name=$service_name" \
72+
--data "url=https://$lambda_url/" && curl -i -X POST \
73+
--url $kong_admin_url/services/$service_name/routes \
74+
--data "paths[]=/digital/api/(?<g1>$service_name)" && curl -i -X POST \
75+
--url $kong_admin_url/services/$service_name/plugins/ \
76+
--data "name=request-transformer" \
77+
--data 'config.replace.uri=/$(uri_captures.g1)' && curl -i -X POST \
78+
--url $kong_admin_url/services/$service_name/plugins/ \
79+
--data "name=$plugin_name" \
80+
--data 'config.aws_assume_role_arn=arn:aws:iam::300063049296:role/azure-lambda' \
81+
--data 'config.aws_assume_role_name=azure-lambda'\
82+
--data 'config.aws_region=eu-west-1' \
83+
--data 'config.aws_service=lambda'
84+
```
8585

8686

8787
* #### Simple Kong call (Request-Transformer activated)
88-
```sh
89-
curl -v -H "Authorization: Bearer $auth_token" $kong_proxy_url/digital/api/$service_name
90-
```
88+
```sh
89+
curl -v -H "Authorization: Bearer $auth_token" $kong_proxy_url/digital/api/$service_name
90+
```
9191

9292
* #### Simple Kong call
93-
```sh
94-
curl -v -H "Authorization: Bearer $auth_token" $kong_proxy_url/$service_name
95-
```
93+
```sh
94+
curl -v -H "Authorization: Bearer $auth_token" $kong_proxy_url/$service_name
95+
```
9696

9797
* #### Complex Kong call
98-
```sh
99-
curl -v -H "Authorization: Bearer $auth_token" -H "Content-Type: application/json" $kong_proxy_url/$service_name?query=true --data '{"username":"xyz","password":"xyz"}'
100-
```
98+
```sh
99+
curl -v -H "Authorization: Bearer $auth_token" -H "Content-Type: application/json" $kong_proxy_url/$service_name?query=true --data '{"username":"xyz","password":"xyz"}'
100+
```
101101

102102
* #### Complex Kong call (Request-Transformer activated)
103-
```sh
104-
curl -v -H "Authorization: Bearer $auth_token" -H "Content-Type: application/json" $kong_proxy_url/digital/api/$service_name?query=true --data '{"username":"xyz","password":"xyz"}'
105-
```
103+
```sh
104+
curl -v -H "Authorization: Bearer $auth_token" -H "Content-Type: application/json" $kong_proxy_url/digital/api/$service_name?query=true --data '{"username":"xyz","password":"xyz"}'
105+
```
106106

107107
* #### Just like above with forced credentials refresh.
108-
```sh
109-
curl -v -H "Authorization: Bearer $auth_token" -H "Content-Type: application/json" -H "x-sts-refresh: true" $kong_proxy_url/digital/api/$service_name?query=true --data '{"username":"xyz","password":"xyz"}'
110-
```
108+
```sh
109+
curl -v -H "Authorization: Bearer $auth_token" -H "Content-Type: application/json" -H "x-sts-refresh: true" $kong_proxy_url/digital/api/$service_name?query=true --data '{"username":"xyz","password":"xyz"}'
110+
```
111111

112112
* #### Change upstream of the service
113-
```sh
114-
curl -i -X PATCH \
115-
--url "$kong_admin_url/services/$service_name" \
116-
--data "url=https://new.example.com/"
117-
```
113+
```sh
114+
curl -i -X PATCH \
115+
--url "$kong_admin_url/services/$service_name" \
116+
--data "url=https://new.example.com/"
117+
```
118118

0 commit comments

Comments
 (0)