Documentation
¶
Index ¶
- func DecryptData(data []byte, passphrase string) ([]byte, error)
- func EncryptData(data []byte, passphrase string) ([]byte, error)
- func Hmac(secret []byte, data []byte) []byte
- type API
- func (api *API) Buckets(c *gin.Context)
- func (api *API) Containers(c *gin.Context)
- func (api *API) CreateBucket(c *gin.Context)
- func (api *API) Decrypt(c *gin.Context)
- func (api *API) DeleteBucket(c *gin.Context)
- func (api *API) DeleteKey(c *gin.Context)
- func (api *API) DestroyFlow(c *gin.Context)
- func (api *API) Encrypt(c *gin.Context)
- func (api *API) ExecuteFlow(c *gin.Context)
- func (api *API) FlowStatus(c *gin.Context)
- func (api *API) Get(c *gin.Context)
- func (api *API) KeyCount(c *gin.Context)
- func (api *API) PerpetualQueue(c *gin.Context)
- func (api *API) PopQueue(c *gin.Context)
- func (api *API) PrefixScan(c *gin.Context)
- func (api *API) Put(c *gin.Context)
- func (api *API) StartFlow(c *gin.Context)
- func (api *API) StopFlow(c *gin.Context)
- type GithubResponse
- type Lock
- type QueueItem
- type Result
- type ScanResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct { // The bolt database held by this installation Db *bolt.DB // Server Configuration Config *config.Config // A map of queue sizes QueueSize map[string]int // contains filtered or unexported fields }
API : Assemble server api object
func (*API) Buckets ¶
Buckets : List all available top level buckets
Returned responses will be one of: - 200 OK : Message will be a list of bucket names - 500 Error : Message will be the error message
func (*API) Containers ¶
Containers : The API endpoint method for retrieving the sidebar container set
Returned responses will be one of: - 200 OK : Message will be a list of strings
func (*API) CreateBucket ¶
CreateBucket : Create a new bucket
POST /bucket
The create request must contain: - bucket - the name of the bucket to create or parent bucket name when creating a child - child - [optional] the name of the child bucket to create
Responses are: - 201 Created - 400 Bad request sent when bucket name is empty - 500 Internal server error
func (*API) Decrypt ¶
Decrypt Decrypts a given string and sends back the plaintext value
INTERNAL Execution only ¶
POST /decrypt
Request parameters: - value - the value to decrypt - token - the validation token to ensure decryption is allowed to take place
Response codes: - 200 OK Message will be the decrypted value - 400 Bad request if value is empty, token is invalid or token matches value - 500 internal server error if value cannot be decoded - Message field may offer further clarification
This function requires both a value and a 'token' to be passed in via context.
token is the encrypted version of the passphrase used to encrypt passwords and should only be available to the flow server.
This is to offer an additional level of security at the browser level to prevent attackers from decrypting a user stored password by accessing the decrypt api endpoint to have the server decrypt the password for them.
func (*API) DeleteBucket ¶
DeleteBucket : Deletes a given bucket
DELETE /bucket/:bucket[/:child]
The url parameters must contain: - bucket - the name of the bucket to delete or parent bucket name when deleting a child - child - [optional] the name of the child bucket to create
Responses are: - 202 Accepted - 400 Bad request sent when bucket name is empty - 500 Internal server error
func (*API) DeleteKey ¶
DeleteKey : Delete a key value pair from a bucket
DELETE /bucket/:bucket[/:child]/:key
URL parameters are: - bucket : The name of the bucket containing the key - child : [optional] The name of a child bucket to manage - key : The key to delete
Returned responses are: - 202 Accepted - 400 Bad Request when bucket or key are empty - 500 Internal server error on failure to delete
func (*API) DestroyFlow ¶
DestroyFlow : Destroys all infrastructure for a given flow
POST /destroyflow
Request parameters: - pipeline - The name of the pipeline to trigger
Response codes: - See forwardPost method below
func (*API) Encrypt ¶
Encrypt : Encrypt a message and send back the encrypted value as a base64 encoded string
POST /encrypt
Request parameters - value : the value to encrypt
Response codes 200 OK message will contain encrypted value 400 Bad request if value is empty 500 Internal server error if message cannot be encrypted
func (*API) ExecuteFlow ¶
ExecuteFlow : Executes the current pipeline
POST /execute
Request parameters: - pipeline - The name of the pipeline to trigger
Response codes: - See forwardPost method below
Flow execution is handed off to the flow api to build the infrastructure and begin executing the queue.
This should be a straight pass-through and flow should be responsible for verifying if infrastructure has/has not already been built or the pipeline is already in the process of being executed.
func (*API) FlowStatus ¶
FlowStatus : Get the status of all items in the current pipeline
Request params - pipeline : The pipeline to get status messages for
Response codes: - 200 OK - Statuses will be the message field in the response - 500 if status cannot be retrieved
func (*API) Get ¶
Get : Get the value for a given key
GET /bucket/:bucket[/:child]/:key
Response codes - 200 OK - Message will be the value - 400 Bad Request if bucket or key is empty - 500 Internal server error if value cannot be retrieved
func (*API) KeyCount ¶
KeyCount : Count keys in a bucket
GET /count/:bucket[/:child]
Response codes: - 200 OK - Message will be the number of keys in the bucket - 400 Bad Request - Bucket name is missing - 404 Page not found - Bucket name is invalid - 500 Internal server error on all other errors
func (*API) PerpetualQueue ¶
PerpetualQueue : Updates the given queue with new event items
INTERNAL - Automatically update the queue with new items ¶
GET /perpetualqueue
Request parameters: - pipeline The pipeline to execute - maxitems The max items to update into the queue
Response codes - 202 Accept - 500 Internal server error
func (*API) PopQueue ¶
PopQueue : Take an item off the queue
INTERNAL used for comms between flow and assemble ¶
GET /queue/:pipeline/:key
func (*API) PrefixScan ¶
PrefixScan : Scan a bucket and retrieve all contents with keys matching prefix
GET /scan/:bucket[/:child][/:key]
Request parameters - bucket [required] The bucket name to scan - child [optional] The child bucket to scan instead - key [optional] If key is not specified, all contents will be returned
Response codes - 200 OK Messsage will be a map of matching key/value pairs - 400 Bad Request if bucket name is empty - 500 Internal server error if the request fails for any reason
func (*API) Put ¶
Put : create a key/value pair in the boltdb
PUT /bucket
Request parameters: - bucket The bucket to write into - child [optional] the child bucket to write into - key The key to add - value The value to save against the key
Response codes - 204 No content if key successfully stored - 400 Bad request if bucket or key is missing - 500 Internal server error if value cannot be stored
type GithubResponse ¶
GithubResponse : Expected information from the Github request
type QueueItem ¶
type QueueItem struct { // The pipeline folder this queue is destined for PipelineFolder string `json:"pipelineFolder"` // Subfolder is a child of pipeline folder and usually // representative of the upstream command being actioned SubFolder string `json:"subFolder"` // The filename of the queue element Filename string `json:"filename"` // Event data represented in string format Event string `json:"event"` // The command to execute Command pipeline.Command `json:"command"` }
QueueItem : Type information about an item on the queue
type Result ¶
type Result struct { // HTTP response code Code int `json:"code"` // HTTP Result string - normally one of OK | Error Result string `json:"result"` // The request message being returned Message interface{} `json:"message"` }
Result : A server result defines the body wrapper sent back to the client
type ScanResult ¶
type ScanResult struct { // Buckets is a list of child buckets the scanned bucket might contain Buckets []string `json:"buckets"` // For simplicity on the caller side, send the number of child buckets found BucketsLength int `json:"bucketlen"` // A map of key:value pairs containing bucket data Keys map[string]string `json:"keys"` // For simplicity, the number of keys in the bucket KeyLen int `json:"keylen"` }
ScanResult : Return values stored in a bucket