api

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgentsDB

func NewAgentsDB(dbPlugin *ast.ObjectItem) (agentdb.AgentDB, error)

NewAgentsDB returns a new agents DB, given a DB connection string

func NewAuth

func NewAuth(authPlugin *ast.ObjectItem) (auth.Auth, error)

NewAuth returns a new Auth

Types

type BanAgentRequest

type BanAgentRequest agent.BanAgentRequest

type BatchCreateEntryRequest

type BatchCreateEntryRequest entry.BatchCreateEntryRequest

type BatchCreateEntryResponse

type BatchCreateEntryResponse entry.BatchCreateEntryResponse

type BatchDeleteEntryRequest

type BatchDeleteEntryRequest entry.BatchDeleteEntryRequest

type BatchDeleteEntryResponse

type BatchDeleteEntryResponse entry.BatchDeleteEntryResponse

type CreateJoinTokenRequest

type CreateJoinTokenRequest agent.CreateJoinTokenRequest

type CreateJoinTokenResponse

type CreateJoinTokenResponse types.JoinToken

type DebugServerRequest

type DebugServerRequest debugServer.GetInfoRequest

type DebugServerResponse

type DebugServerResponse debugServer.GetInfoResponse

type DeleteAgentRequest

type DeleteAgentRequest agent.DeleteAgentRequest

type DeleteClusterRequest

type DeleteClusterRequest tornjakTypes.ClusterInput

type EditClusterRequest

type EditClusterRequest tornjakTypes.ClusterInput

type GetTornjakServerInfoRequest

type GetTornjakServerInfoRequest struct{}

type GetTornjakServerInfoResponse

type GetTornjakServerInfoResponse TornjakSpireServerInfo

type HTTPConfig

type HTTPConfig struct {
	ListenPort int `hcl:"port"`
}

type HTTPSConfig

type HTTPSConfig struct {
	ListenPort int    `hcl:"port"`
	Cert       string `hcl:"cert"`
	Key        string `hcl:"key"`
	ClientCA   string `hcl:"client_ca"`
}

func (HTTPSConfig) Parse

func (h HTTPSConfig) Parse() (*tls.Config, error)

type ListAgentMetadataRequest

type ListAgentMetadataRequest tornjakTypes.AgentMetadataRequest

type ListAgentMetadataResponse

type ListAgentMetadataResponse tornjakTypes.AgentInfoList

type ListAgentsRequest

type ListAgentsRequest agent.ListAgentsRequest

type ListAgentsResponse

type ListAgentsResponse agent.ListAgentsResponse

type ListClustersRequest

type ListClustersRequest struct{}

type ListClustersResponse

type ListClustersResponse tornjakTypes.ClusterInfoList

type ListEntriesRequest

type ListEntriesRequest entry.ListEntriesRequest

type ListEntriesResponse

type ListEntriesResponse entry.ListEntriesResponse

type ListSelectorsRequest

type ListSelectorsRequest struct{}

type ListSelectorsResponse

type ListSelectorsResponse tornjakTypes.AgentInfoList

type RegisterClusterRequest

type RegisterClusterRequest tornjakTypes.ClusterInput

type RegisterSelectorRequest

type RegisterSelectorRequest tornjakTypes.AgentInfo

type Server

type Server struct {
	// SPIRE socket location
	SpireServerAddr string

	// SpireServerInfo provides config info for the spire server
	SpireServerInfo TornjakSpireServerInfo

	// Information from Tornjak Config file passed in as argument
	TornjakConfig *TornjakConfig

	// Plugins
	Db   agentdb.AgentDB
	Auth auth.Auth
}

func (*Server) BanAgent

func (s *Server) BanAgent(inp BanAgentRequest) error

func (*Server) BatchCreateEntry

func (s *Server) BatchCreateEntry(inp BatchCreateEntryRequest) (*BatchCreateEntryResponse, error)

func (*Server) BatchDeleteEntry

func (s *Server) BatchDeleteEntry(inp BatchDeleteEntryRequest) (*BatchDeleteEntryResponse, error)

func (*Server) Configure

func (s *Server) Configure() error

func (*Server) ConfigureDefaults

func (s *Server) ConfigureDefaults() error

func (*Server) CreateJoinToken

func (s *Server) CreateJoinToken(inp CreateJoinTokenRequest) (*CreateJoinTokenResponse, error)

func (*Server) DebugServer

func (s *Server) DebugServer(inp DebugServerRequest) (*DebugServerResponse, error)

func (*Server) DefineCluster

func (s *Server) DefineCluster(inp RegisterClusterRequest) error

DefineCluster registers cluster to local DB

func (*Server) DefineSelectors

func (s *Server) DefineSelectors(inp RegisterSelectorRequest) error

DefineSelectors registers an agent to the local DB with the following info spiffeid string plugin string

func (*Server) DeleteAgent

func (s *Server) DeleteAgent(inp DeleteAgentRequest) error

func (*Server) DeleteCluster

func (s *Server) DeleteCluster(inp DeleteClusterRequest) error

DeleteCluster deletes cluster with name cinfo.Name and assignment to agents

func (*Server) EditCluster

func (s *Server) EditCluster(inp EditClusterRequest) error

EditCluster registers cluster to local DB

func (*Server) GetRouter

func (s *Server) GetRouter() http.Handler

func (*Server) GetTornjakServerInfo

func (s *Server) GetTornjakServerInfo(inp GetTornjakServerInfoRequest) (*GetTornjakServerInfoResponse, error)

func (*Server) HandleRequests

func (s *Server) HandleRequests()

HandleRequests connects api links with respective functions Functions currently handle the api calls all as post-requests

func (*Server) ListAgentMetadata

func (s *Server) ListAgentMetadata(inp ListAgentMetadataRequest) (*ListAgentMetadataResponse, error)

ListAgentMetadata takes in list of agent spiffeids and returns list of those agents from the local DB with following info spiffeid string plugin string cluster string if no metadata found, no row is included if no spiffeids are specified, all agent metadata is returned

func (*Server) ListAgents

func (s *Server) ListAgents(inp ListAgentsRequest) (*ListAgentsResponse, error)

func (*Server) ListClusters

func (s *Server) ListClusters(inp ListClustersRequest) (*ListClustersResponse, error)

ListClusters returns list of clusters from the local DB with the following info name string details json

func (*Server) ListEntries

func (s *Server) ListEntries(inp ListEntriesRequest) (*ListEntriesResponse, error)

func (*Server) ListSelectors

func (s *Server) ListSelectors(inp ListSelectorsRequest) (*ListSelectorsResponse, error)

ListSelectors returns list of agents from the local DB with the following info spiffeid string plugin string

func (*Server) SPIREHealthcheck

func (s *Server) SPIREHealthcheck(inp HealthcheckRequest) (*HealthcheckResponse, error)

func (*Server) VerifyConfiguration

func (s *Server) VerifyConfiguration() error

type TornjakConfig

type TornjakConfig struct {
	Server  *serverConfig `hcl:"server"`
	Plugins *ast.Node     `hcl:"plugins"`
}

type TornjakSpireServerInfo

type TornjakSpireServerInfo struct {
	// Plugins is a map from plugin types to respective names of plugins configured
	Plugins map[string][]string `json:"plugins"`
	// TrustDomain specifies the trust domain of the SPIRE server configured with tornjak
	TrustDomain string `json:"trustDomain"`
	// Verbose config contains unstructure information on the config on the agent
	VerboseConfig string `json:"verboseConfig"`
}

TornjakServerInfo provides insight into the configuration of the SPIRE server where the Tornjak Agent resides

Jump to

Keyboard shortcuts

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