Categorygithub.com/hashicorp/sentinel-sdk
modulepackage
0.5.2
Repository: https://github.com/hashicorp/sentinel-sdk.git
Documentation: pkg.go.dev

# README

Sentinel Plugin SDK

Tests GoDoc Heimdall

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.

SDK Compatibility Matrix

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 VersionPlugin Protocol VersionSDK Version
Up to v0.10.41Up to v0.1.1
Up to v0.18.132Up to v0.3.13
From v0.19.03Since v0.4.0

Development Info

The following tools are required to work with the Sentinel SDK:

After both of these are installed, you can use the following make commands:

  • make test will run tests on the SDK. You can use the TEST and TESTARGS 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.

Help and Discussion

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.

# Packages

No description provided by the author
Package framework contains a high-level framework for implementing Sentinel plugins with Go.
No description provided by the author
Package rpc contains the API that can be used to serve Sentinel plugins over an RPC interface.
Package testing provides support for automated testing for plugins.

# Functions

NewMockPlugin creates a new instance of MockPlugin.

# Variables

Null is a constant value that represents the null object in Sentinel.
Undefined is a constant value that represents the undefined object in Sentinel.

# Structs

GetKey is an individual key in the larger possible selector of the specific plugin call, along with any supplied arguments for the specific key.
GetReq are the arguments given to Get for an Plugin.
GetResult is the result structure for a Get request.
MockPlugin is an autogenerated mock type for the Plugin type.
MockPluginCloser augments MockPlugin to also implement io.Closer.

# Interfaces

Plugin is an importable package.

# Type aliases

GetResultList is a wrapper around a slice of GetResult structures to provide helpers.