Skip to content

Commit c2307e0

Browse files
committed
demo: Adopt smoke test for demo at OpenFGA community
1 parent 4708e12 commit c2307e0

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

_build/deployment/kong-smoke-test/kong/kong.local.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,31 @@ services:
77
host: 127.0.0.1
88
port: 15555
99
plugins:
10+
- name: basic-auth
11+
service: smoke-test-upstream
12+
config:
13+
hide_credentials: true
1014
- name: kong-authz-openfga
1115
config:
1216
host: kong-plugin-kong-authz-openfga-openfga
1317
store_id: 01JF958AHC0F7CT35GCFN4EHP6
1418
tuple:
15-
user: user:anne
16-
relation: reader
19+
user_by_lua: return 'user:' .. kong.client.get_consumer().username
20+
relation: writer
1721
object: repo:openfga/openfga
1822
routes:
1923
- name: smoke.test
2024
paths:
2125
- /
2226
protocols:
23-
- https
24-
snis:
25-
- smoke.test
27+
- http
28+
29+
consumers:
30+
- username: anne
31+
basicauth_credentials:
32+
- username: anne
33+
password: password
34+
- username: beth
35+
basicauth_credentials:
36+
- username: beth
37+
password: password

_build/deployment/kong-smoke-test/kong/smoke-test.nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ server {
44
default_type 'text/plain';
55

66
content_by_lua_block {
7-
ngx.say('Smoke test was a success')
7+
ngx.say('Access granted')
88
}
99
}
1010
}

0 commit comments

Comments
 (0)