Documentation ¶
Index ¶
- Constants
- func BEHttpRequest(loginobj *LoginObject, beURL, httpverb string, endpoint string, payload []byte, ...) ([]byte, error)
- func BasicBEQuery(req *http.Request, qryData interface{})
- func EmptyQuery(req *http.Request, qryData interface{})
- func GetBEInfo(cfgFile string) string
- func GetOauth2TokenURL() string
- func LoginWithKeycloak(loginDetails CustomerLoginDetails) ([]uuid.UUID, *oidc.IDToken, error)
- func MapQuery(req *http.Request, qryData interface{})
- func SIDFallback(c *Command)
- func ValidateBEConnectorMakerInput(client *http.Client, baseURL string, loginDetails *CustomerLoginDetails) error
- type AuthenticationCookie
- type BELoginResponse
- type BackendConnector
- func (r *BackendConnector) GetBaseURL() string
- func (r *BackendConnector) GetClient() *http.Client
- func (r *BackendConnector) GetLoginObj() *LoginObject
- func (r *BackendConnector) HTTPSend(httpverb string, endpoint string, payload []byte, f HTTPReqFunc, ...) ([]byte, error)
- func (r *BackendConnector) IsExpired() bool
- func (r *BackendConnector) Login() error
- type Command
- func (c *Command) DeepCopy() *Command
- func (c *Command) GetFieldSelector() map[string]string
- func (c *Command) GetID() string
- func (c *Command) GetLabels() map[string]string
- func (c *Command) Json() string
- func (c *Command) SetFieldSelector(labels map[string]string)
- func (c *Command) SetLabels(labels map[string]string)
- type Commands
- type Connector
- type CustomerLoginDetails
- type ElasticRespTotal
- type HTTPReqFunc
- type JobTracking
- type LoginAux
- type LoginObject
- type Oauth2Claims
- type Oauth2Customer
- type SafeMode
- type V2ListResponse
- type WebsocketScanCommand
Constants ¶
const ( WebsocketScanCommandVersion string = "v1" WebsocketScanCommandPath string = "scanImage" )
WebsocketScanCommand api
const ( UPDATE string = "update" ATTACH string = "Attach" REMOVE string = "remove" DETACH string = "Detach" INCOMPATIBLE string = "Incompatible" REPLACE_HEADERS string = "ReplaceHeaders" IMAGE_UNREACHABLE string = "ImageUnreachable" SIGN string = "sign" UNREGISTERED string = "unregistered" INJECT string = "inject" RESTART string = "restart" ENCRYPT string = "encryptSecret" DECRYPT string = "decryptSecret" SCAN string = "scan" )
commands send via websocket
Variables ¶
This section is empty.
Functions ¶
func BEHttpRequest ¶
func BEHttpRequest(loginobj *LoginObject, beURL, httpverb string, endpoint string, payload []byte, f HTTPReqFunc, qryData interface{}) ([]byte, error)
func BasicBEQuery ¶
func EmptyQuery ¶
func GetOauth2TokenURL ¶
func GetOauth2TokenURL() string
func LoginWithKeycloak ¶
func SIDFallback ¶
func SIDFallback(c *Command)
func ValidateBEConnectorMakerInput ¶
func ValidateBEConnectorMakerInput(client *http.Client, baseURL string, loginDetails *CustomerLoginDetails) error
Types ¶
type AuthenticationCookie ¶
type AuthenticationCookie struct { Oauth2Claims `json:",inline"` CustomerGUID uuid.UUID `json:"customerGuid"` Expires time.Time `json:"expires"` Version int `json:"version"` Authorization string `json:"authorization,omitempty"` }
AuthenticationCookie is what it is
type BELoginResponse ¶
type BELoginResponse struct { Name string `json:"name"` PreferredUsername string `json:"preferred_username"` Email string `json:"email"` CustomerGuid string `json:"customerGuid"` Expires string `json:"expires"` Authorization string `json:"authorization"` Cookies []*http.Cookie }
func BELogin ¶
func BELogin(loginDetails *CustomerLoginDetails, login string, cfg string) (*BELoginResponse, error)
func (*BELoginResponse) ToLoginObject ¶
func (r *BELoginResponse) ToLoginObject() *LoginObject
type BackendConnector ¶
type BackendConnector struct { BaseURL string BELoginResponse *BELoginResponse Credentials *CustomerLoginDetails HTTPClient *http.Client }
func MakeBackendConnector ¶
func MakeBackendConnector(client *http.Client, baseURL string, loginDetails *CustomerLoginDetails) (*BackendConnector, error)
func (*BackendConnector) GetBaseURL ¶
func (r *BackendConnector) GetBaseURL() string
func (*BackendConnector) GetClient ¶
func (r *BackendConnector) GetClient() *http.Client
func (*BackendConnector) GetLoginObj ¶
func (r *BackendConnector) GetLoginObj() *LoginObject
func (*BackendConnector) HTTPSend ¶
func (r *BackendConnector) HTTPSend(httpverb string, endpoint string, payload []byte, f HTTPReqFunc, qryData interface{}) ([]byte, error)
func (*BackendConnector) IsExpired ¶
func (r *BackendConnector) IsExpired() bool
func (*BackendConnector) Login ¶
func (r *BackendConnector) Login() error
type Command ¶
type Command struct { CommandName string `json:"commandName"` ResponseID string `json:"responseID"` Wlid string `json:"wlid,omitempty"` WildWlid string `json:"wildWlid,omitempty"` Sid string `json:"sid,omitempty"` WildSid string `json:"wildSid,omitempty"` JobTracking JobTracking `json:"jobTracking"` Args map[string]interface{} `json:"args,omitempty"` }
Command structure of command received from websocket
func (*Command) GetFieldSelector ¶
func (*Command) SetFieldSelector ¶
type Commands ¶
type Commands struct {
Commands []Command `json:"commands"`
}
Commands list of commands received from websocket
type Connector ¶
type Connector interface { //may used for a more generic httpsend interface based method GetBaseURL() string GetLoginObj() *LoginObject GetClient() *http.Client Login() error IsExpired() bool HTTPSend(httpverb string, endpoint string, payload []byte, f HTTPReqFunc, qryData interface{}) ([]byte, error) }
Connector - interface for any connector (BE/Portal and so on)
type CustomerLoginDetails ¶
type CustomerLoginDetails struct { Email string `json:"email"` Password string `json:"password"` CustomerName string `json:"customer,omitempty"` CustomerGUID uuid.UUID `json:"customerGuid,omitempty"` }
CustomerLoginDetails is what it is
type ElasticRespTotal ¶
taken from BE ElasticRespTotal holds the total struct in Elastic array response
type HTTPReqFunc ¶
HTTPReqFunc allows you to insert query params and more to aggregation message while using update aggregator
type JobTracking ¶
type LoginAux ¶
func GetLoginStruct ¶
type LoginObject ¶
type LoginObject struct { Authorization string `json:"authorization"` GUID string Cookies []*http.Cookie Expires string }
func Login ¶
func Login(loginDetails CustomerLoginDetails) (*LoginObject, error)
func (*LoginObject) IsExpired ¶
func (r *LoginObject) IsExpired() bool
type Oauth2Claims ¶
type Oauth2Claims struct { Sub string `json:"sub"` Name string `json:"name"` PreferredUserName string `json:"preferred_username"` CAGroups []string `json:"ca_groups"` Email string `json:"email"` }
Oauth2Claims returns in claims section of Oauth2 verification process
type Oauth2Customer ¶
type Oauth2Customer struct { CustomerName string `json:"customerName"` CustomerGUID string `json:"customerGUID"` }
Oauth2Customer returns inside the "ca_groups" field in claims section of Oauth2 verification process
type SafeMode ¶
type SafeMode struct { Reporter string `json:"reporter"` // "Agent" Action string `json:"action,omitempty"` // "action" Wlid string `json:"wlid"` // CAA_WLID PodName string `json:"podName"` // CAA_POD_NAME InstanceID string `json:"instanceID"` // CAA_POD_NAME ContainerName string `json:"containerName,omitempty"` // CAA_CONTAINER_NAME ProcessName string `json:"processName,omitempty"` ProcessID int `json:"processID,omitempty"` ProcessCMD string `json:"processCMD,omitempty"` ComponentGUID string `json:"componentGUID,omitempty"` // CAA_GUID StatusCode int `json:"statusCode"` // 0/1/2 ProcessExitCode int `json:"processExitCode"` // 0 + Timestamp int64 `json:"timestamp"` Message string `json:"message,omitempty"` // any string JobID string `json:"jobID,omitempty"` // any string Compatible *bool `json:"compatible,omitempty"` }
type V2ListResponse ¶
type V2ListResponse struct { Total ElasticRespTotal `json:"total"` Response interface{} `json:"response"` // Cursor for quick access to the next page. Not supported yet Cursor string `json:"cursor"` }
V2ListResponse holds the response of some list request with some metadata
type WebsocketScanCommand ¶
type WebsocketScanCommand struct { // CustomerGUID string `json:"customerGUID"` ImageTag string `json:"imageTag"` Wlid string `json:"wlid"` IsScanned bool `json:"isScanned"` ContainerName string `json:"containerName"` JobID string `json:"jobID,omitempty"` LastAction int `json:"actionIDN"` // ImageHash string `json:"imageHash"` Credentials *types.AuthConfig `json:"credentials,omitempty"` }
WebsocketScanCommand trigger scan thru the websocket