plugin

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GrantStatusGranted  GrantStatus  = "granted"
	GrantStatusPending  GrantStatus  = "grant-pending"
	GrantStatusDenied   GrantStatus  = "denied"
	RevokeStatusRevoked RevokeStatus = "revoked"
	RevokeStatusPending RevokeStatus = "revoke-pending"
	Key                 string       = "ephemeralaccess"
)

Variables

This section is empty.

Functions

func NewClientConfig

func NewClientConfig(pluginPath string, log hclog.Logger) *goPlugin.ClientConfig

NewClientConfig will build and return a new instance of client stub configs.

func NewServerConfig

func NewServerConfig(impl AccessRequester, log hclog.Logger) *goPlugin.ServeConfig

NewServerConfig will build and return a new instance of server stub configs.

Types

type AccessRequestPlugin

type AccessRequestPlugin struct {
	Impl AccessRequester
}

AccessRequestPlugin is the implementation of plugin.Plugin so we can serve/consume

This has two methods: - Server(): must return an RPC server for this plugin type. - Client(): must return an implementation of the interface that communicates over an RPC client.

func (AccessRequestPlugin) Client

func (AccessRequestPlugin) Client(b *goPlugin.MuxBroker, c *rpc.Client) (interface{}, error)

Client will build and return the client side stub for AccessRequester plugings.

func (*AccessRequestPlugin) Server

func (p *AccessRequestPlugin) Server(*goPlugin.MuxBroker) (interface{}, error)

Server will build and return the server side stub for AccessRequester plugings.

type AccessRequester

type AccessRequester interface {
	Init() error
	GrantAccess(ar *api.AccessRequest, app *argocd.Application) (*GrantResponse, error)
	RevokeAccess(ar *api.AccessRequest, app *argocd.Application) (*RevokeResponse, error)
}

AccessRequester defines the main interface that should be implemented by ephemeral access plugins.

func GetAccessRequester

func GetAccessRequester(client *goPlugin.Client) (AccessRequester, error)

GetAccessRequester will attempt to instantiate a new AccessRequester from the provided client. The returned AccessRequester will invoke RPC calls targeting the plugin implementation on method calls.

type AccessRequesterRPCClient

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

AccessRequesterRPCClient is the client side stub used by AccessRequester plugins.

func (*AccessRequesterRPCClient) GrantAccess

GrantAccess is the client side stub implementation of the GrantAccess function.

func (*AccessRequesterRPCClient) Init

func (c *AccessRequesterRPCClient) Init() error

Init is the client side stub implementation of the Init function.

func (*AccessRequesterRPCClient) RevokeAccess

RevokeAccess is the client side stub implementation of the RevokeAccess function.

type AccessRequesterRPCServer

type AccessRequesterRPCServer struct {
	Impl AccessRequester
}

AccessRequesterRPCServer is the server side stub used by AccessRequester plugins.

func (*AccessRequesterRPCServer) GrantAccess

GrantAccess is the server side stub implementation of the GrantAccess function.

func (*AccessRequesterRPCServer) Init

func (s *AccessRequesterRPCServer) Init(args any, resp *InitResponseRPC) error

Init is the server side stub implementation of the Init function.

func (*AccessRequesterRPCServer) RevokeAccess

RevokeAccess is the server side stub implementation of the RevokeAccess function.

type GrantAccessArgsRPC

type GrantAccessArgsRPC struct {
	AccReq *api.AccessRequest
	App    *argocd.Application
}

GrantAccessArgsRPC wraps the args that are sent to the GrantAccess function over RPC.

type GrantAccessResponseRPC

type GrantAccessResponseRPC struct {
	Response *GrantResponse
	Err      error
}

GrantAccessResponseRPC wraps the response that are received by the GrantAccess function over RPC.

type GrantResponse

type GrantResponse struct {
	Status  GrantStatus
	Message string
}

GrantResponse defines the response that will be returned by access request plugins.

type GrantStatus

type GrantStatus string

type InitResponseRPC

type InitResponseRPC struct {
	Err error
}

InitResponseRPC wraps the response that are received by the Init function over RPC.

type PluginError

type PluginError struct {
	Err string
}

PluginError the error type returned by the rpc server over the wire

func (*PluginError) Error

func (pe *PluginError) Error() string

Error the error implementation

type RevokeAccessArgsRPC

type RevokeAccessArgsRPC struct {
	AccReq *api.AccessRequest
	App    *argocd.Application
}

RevokeAccessArgsRPC wraps the args that are sent to the RevokeAccess function over RPC.

type RevokeAccessResponseRPC

type RevokeAccessResponseRPC struct {
	Response *RevokeResponse
	Err      error
}

RevokeAccessResponseRPC wraps the response that are received by the GrantAccess function over RPC.

type RevokeResponse

type RevokeResponse struct {
	Status  RevokeStatus
	Message string
}

RevokeResponse defines the response that will be returned by access request plugins.

type RevokeStatus

type RevokeStatus string

Jump to

Keyboard shortcuts

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