Categorygithub.com/tyktechnologies/custom-pluginspluginsgrpc_go-auth-pre_headerinject_authhook
package
0.0.0-20241108211809-e417158c4f9d
Repository: https://github.com/tyktechnologies/custom-plugins.git
Documentation: pkg.go.dev

# README

Go plugin

Plugin overview

This repository provides a sample Go plugin for Tyk.

The project implements a simple middleware for header injection (MyPreHook), using a Pre hook (see Tyk custom middleware hooks). An authentication hook is also provided (MyAuthCheck), see hooks.go.

Requirements

Go compiler.

Instructions

After checking the requirements, clone this repository:

$ git clone https://github.com/TykTechnologies/tyk-plugin-demo-golang.git

Enter the plugin directory:

$ cd tyk-plugin-demo-golang

Building a bundle

Go plugins are delivered as plugin bundles. The manifest file (manifest.json) contains the custom middleware definition.

$ tyk-cli bundle build

You may check the tyk-cli documentation for additional options.

# Functions

MyAuthCheck will initialize and return a valid session object if the authentication is ok:.
MyPreHook performs a header injection:.

# Constants

No description provided by the author
No description provided by the author

# Structs

Dispatcher implementation.