This repository provides a sample gRPC plugin, written in Java, intended to work as part of Tyk. Gradle is used.
Simple auth logic is implemented, based on Tyk custom middleware hooks logic. A class implements the required hook methods.
This plugin implements a single hook, it performs authorization by comparing a header value, you may see the code here.
gradle run
Note that a plugin bundle is not necessary to run middleware. It's simply a deployment option. This blog post here describes how to use custom middleware without plugin bundles.
To use it you must generate a bundle and load it into your Tyk API settings. this guide will walk you through the process.
The manifest.json
file describes the hooks implemented by this plugin. It can be served via http server to Tyk Gateways. A Tyk Gateway will load it into memory to understand how to talk to your custom plugin.
Included in this repo is a 'docker-compose.nginx.yaml' that will run a local Nginx instance to serve your bundle that you generated in the tutorial above using the manifest.json
file.