From d3279b63a7442952b8e9dd086b7df9075a1b3341 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 9 Feb 2021 11:10:01 +0100 Subject: [PATCH] hydrator test --- docker/kratos/oathkeeper/access-rules.yml | 7 +++++-- packages/dashboard/src/pages/api/hydrator.js | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 packages/dashboard/src/pages/api/hydrator.js diff --git a/docker/kratos/oathkeeper/access-rules.yml b/docker/kratos/oathkeeper/access-rules.yml index 8a67a3dc..294b9f8d 100644 --- a/docker/kratos/oathkeeper/access-rules.yml +++ b/docker/kratos/oathkeeper/access-rules.yml @@ -1,7 +1,7 @@ - id: "ory:kratos:public" upstream: preserve_host: true - url: "http://kratos:4433" + url: "http://accounts:3000/kratos" strip_path: /.ory/kratos/public match: url: "http://oathkeeper:4455/.ory/kratos/public/<**>" @@ -16,7 +16,10 @@ authorizer: handler: allow mutators: - - handler: noop + - handler: hydrator + config: + api: + url: "http://dashboard:3000/api/hydrator" - id: "dashboard:anonymous" upstream: diff --git a/packages/dashboard/src/pages/api/hydrator.js b/packages/dashboard/src/pages/api/hydrator.js new file mode 100644 index 00000000..4a7b8b99 --- /dev/null +++ b/packages/dashboard/src/pages/api/hydrator.js @@ -0,0 +1,6 @@ +export default (req, res) => { + console.log(Object.keys(req)); + console.log(JSON.stringify(req)); + + res.json({ name: "John Doe" }); +};