Proxy-Wasm plugin that grants access based on a result of gRPC callout.
$ cargo build --target wasm32-wasip1 --release
This example can be run with docker compose
and has a matching Envoy configuration.
$ docker compose up
Send gRPC request to localhost:10000
service hello.HelloService
:
$ grpcurl -d '{"greeting": "Rust"}' -plaintext localhost:10000 hello.HelloService/SayHello
{
"reply": "hello Rust"
}
Expected Envoy logs:
[...] wasm log grpc_auth_random: Access granted.
Send gRPC request to localhost:10000
service hello.HelloService
:
$ grpcurl -d '{"greeting": "Rust"}' -plaintext localhost:10000 hello.HelloService/SayHello
ERROR:
Code: Aborted
Message: Aborted by Proxy-Wasm!
Expected Envoy logs:
[...] wasm log grpc_auth_random: Access forbidden.