This repository contains the Sentinel plugin SDK. This SDK allows developers to extend Sentinel to source external information for use in their policies.
Sentinel plugins can be written in any language, but the recommended language is Go. We provide a high-level framework to make writing plugins in Go extremely easy. For other languages, plugins can be written by implementing the protocol over gRPC.
To get started writing a Sentinel plugin, we recommend reading the extending Sentinel guide.
You can also view the plugin API via GoDoc.
Sentinel's plugin protocol is, at this time, not backwards compatible. This means that a specific version of the Sentinel runtime is always coupled to a specific version of the plugin protocol, and SDK. The following table can help you determine which version of the SDK is necessary to work with which versions of Sentinel.
Sentinel Version | Plugin Protocol Version | SDK Version |
---|---|---|
Up to v0.10.4 | 1 | Up to v0.1.1 |
Up to v0.18.13 | 2 | Up to v0.3.13 |
From v0.19.0 | 3 | Since v0.4.0 |
The following tools are required to work with the Sentinel SDK:
- The Sentinel runtime, usually at the most recent version. There are rare exceptions to this, such as when the protocol is in active development. Refer to the SDK Compatibility Matrix to locate the correct version of the SDK to work with the most current version of the runtime.
- Google's Protocol Buffers.
After both of these are installed, you can use the following make
commands:
make test
will run tests on the SDK. You can use theTEST
andTESTARGS
variables to control the packages and test arguments, respectively.make tools
will install any necessary Go tools.make generate
will generate any auto-generated code. Currently this includes the protocol, mockery files, and the code for the plugin testing toolkit.
The modules
, test-circle
, and /usr/bin/sentinel
targets are only used in
Circle and are not necessary for interactive development.
For issues specific to the SDK, please use the GitHub issue tracker (the Issues tab).
For general Sentinel support and discussion, please use the Sentinel Community Forum.