api

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 34 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 NewAuthenticator added in v1.7.0

func NewAuthenticator(authenticatorPlugin *ast.ObjectItem) (authenticator.Authenticator, error)

NewAuthenticator returns a new Authenticator

func NewAuthorizer added in v1.7.0

func NewAuthorizer(authorizerPlugin *ast.ObjectItem) (authorization.Authorizer, error)

NewAuthorizer returns a new Authorizer

Types

type APIRoleMapping added in v1.7.0

type APIRoleMapping struct {
	Name         string   `hcl:",key"`
	AllowedRoles []string `hcl:"allowed_roles"`
}

type APIv1RoleMapping added in v1.8.0

type APIv1RoleMapping struct {
	Name         string   `hcl:",key"`
	Method       string   `hcl:"-"`
	Path         string   `hcl:"-"`
	AllowedRoles []string `hcl:"allowed_roles"`
}

type AuthRole added in v1.7.0

type AuthRole struct {
	Name string `hcl:",key"`
	Desc string `hcl:"desc"`
}

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 CreateFederatedBundleRequest added in v1.8.0

type CreateFederatedBundleRequest bundle.BatchCreateFederatedBundleRequest

type CreateFederatedBundleResponse added in v1.8.0

type CreateFederatedBundleResponse bundle.BatchCreateFederatedBundleResponse

type CreateFederationRelationshipRequest added in v1.8.0

type CreateFederationRelationshipRequest trustdomain.BatchCreateFederationRelationshipRequest

type CreateFederationRelationshipResponse added in v1.8.0

type CreateFederationRelationshipResponse trustdomain.BatchCreateFederationRelationshipResponse

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 DeleteFederatedBundleRequest added in v1.8.0

type DeleteFederatedBundleRequest bundle.BatchDeleteFederatedBundleRequest

type DeleteFederatedBundleResponse added in v1.8.0

type DeleteFederatedBundleResponse bundle.BatchDeleteFederatedBundleResponse

type DeleteFederationRelationshipRequest added in v1.8.0

type DeleteFederationRelationshipRequest trustdomain.BatchDeleteFederationRelationshipRequest

type DeleteFederationRelationshipResponse added in v1.8.0

type DeleteFederationRelationshipResponse trustdomain.BatchDeleteFederationRelationshipResponse

type EditClusterRequest

type EditClusterRequest tornjakTypes.ClusterInput

type GetBundleRequest added in v1.8.0

type GetBundleRequest bundle.GetBundleRequest

Bundle APIs

type GetBundleResponse added in v1.8.0

type GetBundleResponse types.Bundle

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 ListFederatedBundlesRequest added in v1.8.0

type ListFederatedBundlesRequest bundle.ListFederatedBundlesRequest

type ListFederatedBundlesResponse added in v1.8.0

type ListFederatedBundlesResponse bundle.ListFederatedBundlesResponse

type ListFederationRelationshipsRequest added in v1.8.0

type ListFederationRelationshipsRequest trustdomain.ListFederationRelationshipsRequest

Federation APIs

type ListFederationRelationshipsResponse added in v1.8.0

type ListFederationRelationshipsResponse trustdomain.ListFederationRelationshipsResponse

type ListSelectorsRequest

type ListSelectorsRequest struct{}

type ListSelectorsResponse

type ListSelectorsResponse tornjakTypes.AgentInfoList

type RegisterClusterRequest

type RegisterClusterRequest tornjakTypes.ClusterInput

type RegisterSelectorRequest

type RegisterSelectorRequest tornjakTypes.AgentInfo

type SPIREConfig added in v1.5.0

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

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
	Authenticator authenticator.Authenticator
	Authorizer    authorization.Authorizer
}

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) CreateFederatedBundle added in v1.8.0

func (s *Server) CreateFederatedBundle(inp CreateFederatedBundleRequest) (*CreateFederatedBundleResponse, error)

func (*Server) CreateFederationRelationship added in v1.8.0

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) DeleteFederatedBundle added in v1.8.0

func (s *Server) DeleteFederatedBundle(inp DeleteFederatedBundleRequest) (*DeleteFederatedBundleResponse, error)

func (*Server) DeleteFederationRelationship added in v1.8.0

func (*Server) EditCluster

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

EditCluster registers cluster to local DB

func (*Server) GetBundle added in v1.8.0

func (s *Server) GetBundle(inp GetBundleRequest) (*GetBundleResponse, error)

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) ListFederatedBundles added in v1.8.0

func (s *Server) ListFederatedBundles(inp ListFederatedBundlesRequest) (*ListFederatedBundlesResponse, error)

func (*Server) ListFederationRelationships added in v1.8.0

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) UpdateFederatedBundle added in v1.8.0

func (s *Server) UpdateFederatedBundle(inp UpdateFederatedBundleRequest) (*UpdateFederatedBundleResponse, error)

func (*Server) UpdateFederationRelationship added in v1.8.0

func (*Server) VerifyConfiguration

func (s *Server) VerifyConfiguration() error

type SpireServerConfig added in v1.5.0

type SpireServerConfig struct {
	TrustDomain string `hcl:"trust_domain"`
}

pared down version of full Server Config type spire/cmd/spire-server/cli/run we curently need only extract the trust domain

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

type UpdateFederatedBundleRequest added in v1.8.0

type UpdateFederatedBundleRequest bundle.BatchUpdateFederatedBundleRequest

type UpdateFederatedBundleResponse added in v1.8.0

type UpdateFederatedBundleResponse bundle.BatchUpdateFederatedBundleResponse

type UpdateFederationRelationshipRequest added in v1.8.0

type UpdateFederationRelationshipRequest trustdomain.BatchUpdateFederationRelationshipRequest

type UpdateFederationRelationshipResponse added in v1.8.0

type UpdateFederationRelationshipResponse trustdomain.BatchUpdateFederationRelationshipResponse

Jump to

Keyboard shortcuts

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