Documentation
¶
Index ¶
- Constants
- func NewClientConfig(pluginPath string, log hclog.Logger) *goPlugin.ClientConfig
- func NewServerConfig(impl AccessRequester, log hclog.Logger) *goPlugin.ServeConfig
- type AccessRequestPlugin
- type AccessRequester
- type AccessRequesterRPCClient
- type AccessRequesterRPCServer
- type GrantAccessArgsRPC
- type GrantAccessResponseRPC
- type GrantResponse
- type GrantStatus
- type InitResponseRPC
- type PluginError
- type RevokeAccessArgsRPC
- type RevokeAccessResponseRPC
- type RevokeResponse
- type RevokeStatus
Constants ¶
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.
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 ¶
func (c *AccessRequesterRPCClient) GrantAccess(ar *api.AccessRequest, app *argocd.Application) (*GrantResponse, error)
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 ¶
func (c *AccessRequesterRPCClient) RevokeAccess(ar *api.AccessRequest, app *argocd.Application) (*RevokeResponse, error)
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 ¶
func (s *AccessRequesterRPCServer) GrantAccess(args GrantAccessArgsRPC, resp *GrantAccessResponseRPC) error
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 ¶
func (s *AccessRequesterRPCServer) RevokeAccess(args RevokeAccessArgsRPC, resp *RevokeAccessResponseRPC) error
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
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