Documentation
¶
Index ¶
- Variables
- type AuthenticationInput
- type AuthenticationOutput
- type AuthenticationPlugin
- type AuthenticationRPCInput
- type AuthenticationRPCOutput
- type AuthenticationRPCServer
- type AuthorizationInput
- type AuthorizationOutput
- type AuthorizationPlugin
- type AuthorizationRPCInput
- type AuthorizationRPCOutput
- type AuthorizationRPCServer
Constants ¶
This section is empty.
Variables ¶
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
func (in *AuthenticationInput) ToRPC() (*AuthenticationRPCInput, error)
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
func (out *AuthenticationOutput) ToRPC() (*AuthenticationRPCOutput, error)
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
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
func (in *AuthenticationRPCInput) ToPlugin() (*AuthenticationInput, error)
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
func (out *AuthenticationRPCOutput) ToPlugin() (*AuthenticationOutput, error)
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
func (s *AuthenticationRPCServer) Authenticate(in *AuthenticationRPCInput, out *AuthenticationRPCOutput) error
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
func (in *AuthorizationInput) ToRPC() (*AuthorizationRPCInput, error)
type AuthorizationOutput ¶
AuthorizationOutput is the plugin's response.
func (*AuthorizationOutput) ToRPC ¶ added in v0.4.3
func (out *AuthorizationOutput) ToRPC() (*AuthorizationRPCOutput, error)
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
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
func (s *AuthorizationRPCServer) Authorize(in *AuthorizationRPCInput, out *AuthorizationRPCOutput) error