yorkie icon indicating copy to clipboard operation
yorkie copied to clipboard

Authentication WebHook looks unimplemented

Open zyuiop opened this issue 1 year ago • 3 comments

What happened:

I tried to configure an authentication webhook following instructions from https://yorkie.dev/docs/auth-webhook.

# Attempt 1: use the command line flag
docker run --name yorkie --rm --network host yorkieteam/yorkie:0.2.9 server --authorization-webhook=http://localhost:5000/yorkie/webhook


# Attempt 2: use a configuration file
docker run --name yorkie --rm --network host -v (pwd)/yorkie_config.yaml:/yorkie_config.yaml yorkieteam/yorkie:0.2.9 server -c /yorkie_config.yaml

Output of the first attempt:

Error: unknown flag: --authorization-webhook

Output of the second attempt: normal, but the endpoint is not called when sending AttackDocument on the RPC port.

Config used in the second attempt (extract):

Backend:
  AuthWebhookURL: "http://localhost:5000/yorkie/webhook"

What you expected to happen:

  • I expected the command line argument to work (--auth-webhook=xxx did not work either)
  • I expected the RPC server to try calling (or fail with some logs) my webhook endpoint when calling AttachDocument over RPC

How to reproduce it (as minimally and precisely as possible):

Run docker run --name yorkie --rm --network host yorkieteam/yorkie:0.2.9 server --authorization-webhook=http://localhost:5000/yorkie/webhook

Alternatively, copy the default config file, set a webhook URL, and start the server. Then, try to use a RPC client (for example, the Go one) and send an AttachDocument command.

Anything else we need to know?:

I generated Python stubs from the Protobuf/GRPC files and used GRPC in python to test.

Environment:

  • Operating system: ArchLinux // Docker container
  • Browser and version: None
  • Yorkie version (use yorkie version): v0.2.9
  • Yorkie JS SDK version: None

Thanks!

zyuiop avatar Jul 05 '22 16:07 zyuiop

Thank you for reporting the issue! 👍 There has been a recent change to the Yorkie structure, and the guide update has been a bit delayed. 🙏

Now we can apply auth-webhook on a per-project basis. (ref: #313) There is no CLI command yet, and we need to add it.

Currently, you can easily add your auth-webhook URL via yorkie-house.

image

dc7303 avatar Jul 10 '22 06:07 dc7303

The documentation should also be updated. https://yorkie.dev/docs/auth-webhook

hackerwins avatar Aug 10 '22 15:08 hackerwins

Sure. I will also update the doc

jeonjonghyeok avatar Aug 10 '22 17:08 jeonjonghyeok

The documentation appears to have been updated, and the problem fixed, so I'm closing the issue. Thank you for your work!

zyuiop avatar Sep 02 '22 12:09 zyuiop