Documentation
¶
Index ¶
- Variables
- func ProxyLogin(config *coreconfig.CoreConfig, authHost string, req *pb.LoginReq) (string, string, *pb.LoginResp, error)
- type Env
- type File
- type Project
- type Provider
- type Server
- func (s *Server) APILogin(ctx context.Context, req *pb.LoginReq) (*pb.LoginResp, error)
- func (s *Server) CheckConnection(ctx context.Context, req *pb.NoParams) (*pb.CheckConnResp, error)
- func (s *Server) Environments(ctx context.Context, req *pb.NoParams) (*pb.EnvResp, error)
- func (s *Server) GetConfig(env string, path string) (map[string]any, error)
- func (s *Server) GetStatus(ctx context.Context, req *pb.NoParams) (*pb.VaultStatus, error)
- func (s *Server) GetTemplate(ctx context.Context, req *pb.TemplateReq) (*pb.TemplateResp, error)
- func (s *Server) GetValues(ctx context.Context, req *pb.GetValuesReq) (*pb.ValuesRes, error)
- func (s *Server) GetVaultTokens(ctx context.Context, req *pb.TokensReq) (*pb.TokensResp, error)
- func (s *Server) GraphQL(ctx context.Context, req *pb.GraphQLQuery) (*pb.GraphQLResp, error)
- func (s *Server) InitConfig(config *coreconfig.CoreConfig, env string) error
- func (s *Server) InitGQL()
- func (s *Server) InitVault(ctx context.Context, req *pb.InitReq) (*pb.InitResp, error)
- func (s *Server) ListServiceTemplates(ctx context.Context, req *pb.ListReq) (*pb.ListResp, error)
- func (s *Server) ResetServer(ctx context.Context, req *pb.ResetReq) (*pb.NoParams, error)
- func (s *Server) RollTokens(ctx context.Context, req *pb.NoParams) (*pb.NoParams, error)
- func (s *Server) Unseal(ctx context.Context, req *pb.UnsealReq) (*pb.UnsealResp, error)
- func (s *Server) UpdateAPI(ctx context.Context, req *pb.UpdateAPIReq) (*pb.NoParams, error)
- func (s *Server) Validate(ctx context.Context, req *pb.ValidationReq) (*pb.ValidationResp, error)
- type Service
- type Value
- type VaultVals
Constants ¶
This section is empty.
Variables ¶
var SelectedEnvironment []string
Currently selected environments
var SelectedWebEnvironment []string
Currently selected web environments
Functions ¶
func ProxyLogin ¶
func ProxyLogin(config *coreconfig.CoreConfig, authHost string, req *pb.LoginReq) (string, string, *pb.LoginResp, error)
ProxyLogin proxy logs in the user.
Types ¶
type Env ¶
type Env struct {
ID int `json:"id"`
Name string `json:"name"`
Projects []Project `json:"projects"`
Providers []Provider `json:"providers"`
}
Env represents an environment containing multiple services
type File ¶
type File struct {
EnvID int `json:"envID"`
ProjID int `json:"projID"`
ServID int `json:"servID"`
ID int `json:"id"`
Name string `json:"name"`
Values []Value `json:"values"`
}
File represents an individual file containing template values
type Project ¶
type Project struct {
EnvID int `json:"envID"`
ID int `json:"id"`
Name string `json:"name"`
Services []Service `json:"files"`
}
Project represents a project that contains multiple files
type Server ¶
type Server struct {
VaultTokenPtr *string
VaultAddrPtr *string
TrcAPITokenSecret []byte
GQLSchema gql.Schema
Log *log.Logger
}
Server implements the twirp api server endpoints
func (*Server) CheckConnection ¶
CheckConnection checks the server connection
func (*Server) Environments ¶
Environments selects environments based on dev or production mode
func (*Server) GetStatus ¶
GetStatus requests version info and whether the vault has been initailized
func (*Server) GetTemplate ¶
func (s *Server) GetTemplate(ctx context.Context, req *pb.TemplateReq) (*pb.TemplateResp, error)
GetTemplate makes a request to the vault for the template found in <project>/<service>/<file>/template-file Returns the template data in base64 and the template's extension. Returns any errors generated by vault
func (*Server) GetVaultTokens ¶
GetVaultTokens takes app role credentials and attempts to fetch names tokens from the vault
func (*Server) GraphQL ¶
func (s *Server) GraphQL(ctx context.Context, req *pb.GraphQLQuery) (*pb.GraphQLResp, error)
GraphQL Accepts a GraphQL query and creates a response
func (*Server) InitConfig ¶
func (s *Server) InitConfig(config *coreconfig.CoreConfig, env string) error
InitConfig initializes configuration information for the server.
func (*Server) InitVault ¶
InitVault Takes init request and inits/seeds vault with contained file data
func (*Server) ListServiceTemplates ¶
ListServiceTemplates lists the templates under the requested project
func (*Server) ResetServer ¶
ResetServer resets vault token.
func (*Server) RollTokens ¶
RollTokens checks the validity of tokens in super-secrets/bamboo/tokens and rerolls them
func (*Server) Validate ¶
func (s *Server) Validate(ctx context.Context, req *pb.ValidationReq) (*pb.ValidationResp, error)
Validate checks the vault to see if the requested credentials are validated
type Service ¶
type Service struct {
EnvID int `json:"envID"`
ProjID int `json:"projID"`
ID int `json:"id"`
Name string `json:"name"`
Files []File `json:"values"`
}
Service represents an service that contains multiple files
type Value ¶
type Value struct {
EnvID int `json:"envID"`
ProjID int `json:"projID"`
ServID int `json:"servID"`
FileID int `json:"fileID"`
ID int `json:"id"`
Key string `json:"name"`
Value string `json:"value"`
Source string `json:"source"`
}
Value represents an individual key-value pair with source