Documentation
¶
Index ¶
- func AddHKPEndpoints(log slog.Instance, dbHandler DatabaseHandler, r *mux.Router)
- func CatchAllError(data interface{}, w http.ResponseWriter, r *http.Request, logI slog.Instance)
- func CatchAllRouter(w http.ResponseWriter, r *http.Request, logI slog.Instance)
- func GenRemoteSignerServerMux(slog slog.Instance, sm interfaces.SecretsManager, gpg interfaces.PGPManager, ...) *mux.Router
- func InitHTTPTimer(log slog.Instance, r *http.Request)
- func InternalServerError(message string, data interface{}, w http.ResponseWriter, r *http.Request, ...)
- func InvalidFieldData(field string, message string, w http.ResponseWriter, r *http.Request, ...)
- func LogExit(slog slog.Instance, r *http.Request, statusCode int, bodyLength int)
- func LoggingMiddleware(next http.Handler) http.Handler
- func NotFound(field string, message string, w http.ResponseWriter, r *http.Request, ...)
- func NotImplemented(w http.ResponseWriter, r *http.Request, logI slog.Instance)
- func PermissionDenied(field string, message string, w http.ResponseWriter, r *http.Request, ...)
- func RunRemoteSignerServer(slog slog.Instance, sm interfaces.SecretsManager, gpg interfaces.PGPManager, ...) chan bool
- func RunRemoteSignerServerSingleKey(slog slog.Instance, sm interfaces.SecretsManager, gpg interfaces.PGPManager, ...) (chan bool, error)
- func UnmarshalBodyOrDie(outData interface{}, w http.ResponseWriter, r *http.Request, ...) bool
- func WriteJSON(data interface{}, statusCode int, w http.ResponseWriter, r *http.Request, ...)
- type AgentAdmin
- type AgentProxy
- type DatabaseHandler
- type GPGEndpoint
- type HTTPHandleFunc
- type HTTPHandleFuncWithLog
- type HealthCheckHandler
- type InternalEndpoint
- type JFCEndpoint
- type KeyRingEndpoint
- type ResponseWriter
- type SKSEndpoint
- type StaticGraphiQL
- type TestsEndpoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHKPEndpoints ¶
func AddHKPEndpoints(log slog.Instance, dbHandler DatabaseHandler, r *mux.Router)
AddHKPEndpoints attach the HKP /lookup and /add endpoints to the specified router with the specified log wrapped into the calls
func CatchAllError ¶
CatchAllError helper method to return an internal server error error to http client in case of non expected errors
func CatchAllRouter ¶
CatchAllRouter helper method to return an not found error error to http client in case of non expected endpoints
func GenRemoteSignerServerMux ¶
func GenRemoteSignerServerMux(slog slog.Instance, sm interfaces.SecretsManager, gpg interfaces.PGPManager, dbh DatabaseHandler) *mux.Router
GenRemoteSignerServerMux generates a remote signer HTTP Router
func InitHTTPTimer ¶
InitHTTPTimer initializes the HTTP Request timer and prints a log line representing a received HTTP Request
func InternalServerError ¶
func InternalServerError(message string, data interface{}, w http.ResponseWriter, r *http.Request, logI slog.Instance)
InternalServerError helper method to return an internal server error to http client
func InvalidFieldData ¶
func InvalidFieldData(field string, message string, w http.ResponseWriter, r *http.Request, logI slog.Instance)
InvalidFieldData helper method to return an invalid field data error to http client
func LoggingMiddleware ¶ added in v1.5.0
LoggingMiddleware is a HTTP middleware that logs the entry and exit requests
func NotFound ¶
func NotFound(field string, message string, w http.ResponseWriter, r *http.Request, logI slog.Instance)
NotFound helper method to return an not found error to http client
func NotImplemented ¶
NotImplemented helper method to return an not implemented error to http client
func PermissionDenied ¶
func PermissionDenied(field string, message string, w http.ResponseWriter, r *http.Request, logI slog.Instance)
PermissionDenied helper method to return an permission denied error to http client
func RunRemoteSignerServer ¶
func RunRemoteSignerServer(slog slog.Instance, sm interfaces.SecretsManager, gpg interfaces.PGPManager, dbh DatabaseHandler) chan bool
RunRemoteSignerServer runs a remote signer server asynchronously and returns a stop channel
func RunRemoteSignerServerSingleKey ¶
func RunRemoteSignerServerSingleKey(slog slog.Instance, sm interfaces.SecretsManager, gpg interfaces.PGPManager, dbh DatabaseHandler) (chan bool, error)
RunRemoteSignerServerSingleKey runs a single key instance of remote signer server asynchronously and returns a stop channel
func UnmarshalBodyOrDie ¶
func UnmarshalBodyOrDie(outData interface{}, w http.ResponseWriter, r *http.Request, logI slog.Instance) bool
UnmarshalBodyOrDie tries to unmarshal the request body into the specified interface and returns InvalidFieldData to the client if something is wrong
Types ¶
type AgentAdmin ¶
type AgentAdmin struct {
// contains filtered or unexported fields
}
func MakeAgentAdmin ¶
func MakeAgentAdmin(log slog.Instance, tm interfaces.TokenManager, am interfaces.AuthManager) *AgentAdmin
MakeAgentAdmin creates an instance of Agent Administration endpoint
func (*AgentAdmin) AddHandlers ¶
func (admin *AgentAdmin) AddHandlers(r *mux.Router)
type AgentProxy ¶
type AgentProxy struct {
// contains filtered or unexported fields
}
func MakeAgentProxy ¶
func MakeAgentProxy(log slog.Instance, gpg interfaces.PGPManager, tm interfaces.TokenManager) *AgentProxy
MakeAgentProxy creates an instance of agent proxy endpoint
func (*AgentProxy) AddHandlers ¶
func (proxy *AgentProxy) AddHandlers(r *mux.Router)
type DatabaseHandler ¶ added in v1.4.0
type DatabaseHandler agent.DatabaseHandler
type GPGEndpoint ¶
type GPGEndpoint struct {
// contains filtered or unexported fields
}
func MakeGPGEndpoint ¶
func MakeGPGEndpoint(log slog.Instance, sm interfaces.SecretsManager, gpg interfaces.PGPManager) *GPGEndpoint
MakeGPGEndpoint Creates an instance of an endpoint that handles GPG Calls
func (*GPGEndpoint) AttachHandlers ¶
func (ge *GPGEndpoint) AttachHandlers(r *mux.Router)
type HTTPHandleFunc ¶
type HTTPHandleFunc = func(w http.ResponseWriter, r *http.Request)
HTTPHandleFunc is a type for a HTTP Handler Function
type HTTPHandleFuncWithLog ¶
HTTPHandleFuncWithLog is a type for a HTTP Handler Function with an slog instance argument
type HealthCheckHandler ¶ added in v1.4.0
type HealthCheckHandler interface {
HealthCheck() error
}
type InternalEndpoint ¶
type InternalEndpoint struct {
// contains filtered or unexported fields
}
func MakeInternalEndpoint ¶
func MakeInternalEndpoint(log slog.Instance, sm interfaces.SecretsManager, gpg interfaces.PGPManager) *InternalEndpoint
MakeInternalEndpoint creates an instance to handle internal control endpoints such as key password data
func (*InternalEndpoint) AttachHandlers ¶
func (ie *InternalEndpoint) AttachHandlers(r *mux.Router)
type JFCEndpoint ¶
type JFCEndpoint struct {
// contains filtered or unexported fields
}
func MakeJFCEndpoint ¶
func MakeJFCEndpoint(log slog.Instance, sm interfaces.SecretsManager, gpg interfaces.PGPManager) *JFCEndpoint
MakeJFCEndpoint creates a handler for Json Field Cipher Endpoints
func (*JFCEndpoint) AttachHandlers ¶
func (jfc *JFCEndpoint) AttachHandlers(r *mux.Router)
type KeyRingEndpoint ¶
type KeyRingEndpoint struct {
// contains filtered or unexported fields
}
func MakeKeyRingEndpoint ¶
func MakeKeyRingEndpoint(log slog.Instance, sm interfaces.SecretsManager, gpg interfaces.PGPManager, dbHandler DatabaseHandler) *KeyRingEndpoint
MakeKeyRingEndpoint creates an instance of key ring management endpoints
func (*KeyRingEndpoint) AttachHandlers ¶
func (kre *KeyRingEndpoint) AttachHandlers(r *mux.Router)
type ResponseWriter ¶ added in v1.5.0
type ResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriter is a http.ResponseWriter wrapper that provides the status code and content length info.
func (*ResponseWriter) Write ¶ added in v1.5.0
func (rw *ResponseWriter) Write(b []byte) (int, error)
Write implements the http.ResponseWriter.Write function. It makes enable to store the response content length.
func (*ResponseWriter) WriteHeader ¶ added in v1.5.0
func (rw *ResponseWriter) WriteHeader(code int)
WriteHeader implements the http.ResponseWriter.WriteHeader function. It makes enable to store the response status code.
type SKSEndpoint ¶
type SKSEndpoint struct {
// contains filtered or unexported fields
}
func MakeSKSEndpoint ¶
func MakeSKSEndpoint(log slog.Instance, sm interfaces.SecretsManager, gpg interfaces.PGPManager, dbHandler DatabaseHandler) *SKSEndpoint
MakeSKSEndpoint creates a handler for SKS Server Endpoint
func (*SKSEndpoint) AttachHandlers ¶
func (sks *SKSEndpoint) AttachHandlers(r *mux.Router)
type StaticGraphiQL ¶
type StaticGraphiQL struct {
// contains filtered or unexported fields
}
func MakeStaticGraphiQL ¶
func MakeStaticGraphiQL(log slog.Instance) *StaticGraphiQL
func (*StaticGraphiQL) AttachHandlers ¶
func (gql *StaticGraphiQL) AttachHandlers(r *mux.Router)
type TestsEndpoint ¶
type TestsEndpoint struct {
// contains filtered or unexported fields
}
func MakeTestsEndpoint ¶
func MakeTestsEndpoint(log slog.Instance, vm *vaultManager.VaultManager, dbHandler HealthCheckHandler) *TestsEndpoint
MakeTestsEndpoint creates an instance of healthcheck tests endpoint
func (*TestsEndpoint) AttachHandlers ¶
func (ge *TestsEndpoint) AttachHandlers(r *mux.Router)