plugin

package
v0.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handshake = hplugin.HandshakeConfig{
	ProtocolVersion:  2,
	MagicCookieKey:   "SYFON_AUTHZ_PLUGIN",
	MagicCookieValue: "syfon_authz_plugin_v2",
}

Handshake is the plugin handshake configuration for hashicorp/go-plugin

Functions

This section is empty.

Types

type AuthenticationInput

type AuthenticationInput struct {
	RequestID  string
	AuthHeader string
	Metadata   map[string]interface{}
}

AuthenticationInput is the request sent to the plugin for authentication.

func (*AuthenticationInput) ToRPC added in v0.4.3

type AuthenticationOutput

type AuthenticationOutput struct {
	Authenticated bool
	Subject       string
	Claims        map[string]interface{}
	Reason        string
}

AuthenticationOutput is the plugin's response.

func (*AuthenticationOutput) ToRPC added in v0.4.3

type AuthenticationPlugin

type AuthenticationPlugin interface {
	Authenticate(ctx context.Context, in *AuthenticationInput) (*AuthenticationOutput, error)
}

AuthenticationPlugin is the interface plugins must implement.

type AuthenticationRPCInput added in v0.4.3

type AuthenticationRPCInput struct {
	RequestID  string
	AuthHeader string
	Metadata   []byte
}

AuthenticationRPCInput is the NetRPC-safe representation of AuthenticationInput. JSON maps use byte fields because gob cannot encode arbitrary interface values.

func (*AuthenticationRPCInput) ToPlugin added in v0.4.3

type AuthenticationRPCOutput added in v0.4.3

type AuthenticationRPCOutput struct {
	Authenticated bool
	Subject       string
	Claims        []byte
	Reason        string
}

AuthenticationRPCOutput is the NetRPC-safe representation of AuthenticationOutput.

func (*AuthenticationRPCOutput) ToPlugin added in v0.4.3

type AuthenticationRPCServer added in v0.4.3

type AuthenticationRPCServer struct {
	// contains filtered or unexported fields
}

AuthenticationRPCServer adapts a public authentication plugin to NetRPC.

func NewAuthenticationRPCServer added in v0.4.3

func NewAuthenticationRPCServer(implementation AuthenticationPlugin) *AuthenticationRPCServer

NewAuthenticationRPCServer returns the NetRPC service to expose as "Plugin".

func (*AuthenticationRPCServer) Authenticate added in v0.4.3

type AuthorizationInput

type AuthorizationInput struct {
	RequestID string
	Subject   string
	Action    string
	Resource  string
	Claims    map[string]interface{}
	Metadata  map[string]interface{}
}

AuthorizationInput is the request sent to the plugin for an authz decision.

func (*AuthorizationInput) ToRPC added in v0.4.3

type AuthorizationOutput

type AuthorizationOutput struct {
	Allow       bool
	Reason      string
	Obligations map[string]interface{}
}

AuthorizationOutput is the plugin's response.

func (*AuthorizationOutput) ToRPC added in v0.4.3

type AuthorizationPlugin

type AuthorizationPlugin interface {
	Authorize(ctx context.Context, in *AuthorizationInput) (*AuthorizationOutput, error)
}

AuthorizationPlugin is the interface plugins must implement.

type AuthorizationRPCInput added in v0.4.3

type AuthorizationRPCInput struct {
	RequestID string
	Subject   string
	Action    string
	Resource  string
	Claims    []byte
	Metadata  []byte
}

AuthorizationRPCInput is the NetRPC-safe representation of AuthorizationInput.

func (*AuthorizationRPCInput) ToPlugin added in v0.4.3

func (in *AuthorizationRPCInput) ToPlugin() (*AuthorizationInput, error)

type AuthorizationRPCOutput added in v0.4.3

type AuthorizationRPCOutput struct {
	Allow       bool
	Reason      string
	Obligations []byte
}

AuthorizationRPCOutput is the NetRPC-safe representation of AuthorizationOutput.

func (*AuthorizationRPCOutput) ToPlugin added in v0.4.3

func (out *AuthorizationRPCOutput) ToPlugin() (*AuthorizationOutput, error)

type AuthorizationRPCServer added in v0.4.3

type AuthorizationRPCServer struct {
	// contains filtered or unexported fields
}

AuthorizationRPCServer adapts a public authorization plugin to NetRPC.

func NewAuthorizationRPCServer added in v0.4.3

func NewAuthorizationRPCServer(implementation AuthorizationPlugin) *AuthorizationRPCServer

NewAuthorizationRPCServer returns the NetRPC service to expose as "Plugin".

func (*AuthorizationRPCServer) Authorize added in v0.4.3

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL