Documentation
¶
Index ¶
- Constants
- Variables
- func NewOverridesModule(caidoHostname string, caidoPort int) *overridesModule
- type AuthenticationRequest
- type AuthenticationResponse
- type CaidoClient
- func (c *CaidoClient) Authenticate(ctx context.Context, authCompleteChan chan<- bool) (string, error)
- func (c *CaidoClient) CreateTamperRule(ctx context.Context, collectionID string, name string, content string, ...) (TamperRule, error)
- func (c *CaidoClient) CreateTamperRuleCollection(ctx context.Context, name string) (TamperRuleCollection, error)
- func (c *CaidoClient) DeleteTamperRule(ctx context.Context, ruleID string) (string, error)
- func (c *CaidoClient) GetTamperRuleCollections(ctx context.Context) ([]TamperRuleCollection, error)
- func (c *CaidoClient) IsAuthenticated() bool
- func (c *CaidoClient) ToggleTamperRule(ctx context.Context, ruleID string, enabled bool) (TamperRule, error)
- func (c *CaidoClient) UpdateTamperRule(ctx context.Context, ruleID string, name string, content string, host string, ...) (TamperRule, error)
- type CreateTamperRuleCollectionInput
- type CreateTamperRuleCollectionResponse
- type CreateTamperRuleInput
- type CreatedAuthenticationToken
- type OverridesModule
- type TamperRule
- type TamperRuleCollection
- type TamperRuleFull
- type TamperRuleMatcher
- type TamperRuleOperation
- type TamperRuleRaw
- type TamperRuleReplacer
- type TamperRuleResponseBody
- type TamperRuleSection
- type TamperRuleTerm
- type ToggleOverrideRequest
Constants ¶
const ( JXScoutTamperRuleCollectionName = "jxscout-overrides" JXScoutTamperRuleNamePrefix = "jxscout-" )
Variables ¶
var ErrAssetContentTypeNotSupported = errors.New("override is only supported for HTML or JS files")
var ErrAssetNoLongerExists = errors.New("asset no longer exists")
var ErrAssetNotFound = errors.New("asset not found")
Functions ¶
func NewOverridesModule ¶
Types ¶
type AuthenticationRequest ¶
type AuthenticationRequest struct {
ID string `graphql:"id"`
ExpiresAt string `graphql:"expiresAt"`
UserCode string `graphql:"userCode"`
VerificationURL string `graphql:"verificationUrl"`
}
AuthenticationRequest represents the response from startAuthenticationFlow
type AuthenticationResponse ¶
type AuthenticationResponse struct {
AuthenticationFlow struct {
Token string `graphql:"token"`
} `graphql:"authenticationFlow"`
}
AuthenticationResponse represents the response from the authentication subscription
type CaidoClient ¶
type CaidoClient struct {
// contains filtered or unexported fields
}
CaidoClient manages communication with the Caido GraphQL API
func NewCaidoClient ¶
NewCaidoClient creates a new Caido API client
func (*CaidoClient) Authenticate ¶
func (*CaidoClient) CreateTamperRule ¶
func (c *CaidoClient) CreateTamperRule(ctx context.Context, collectionID string, name string, content string, host string, path string) (TamperRule, error)
CreateTamperRule creates a new tamper rule
func (*CaidoClient) CreateTamperRuleCollection ¶
func (c *CaidoClient) CreateTamperRuleCollection(ctx context.Context, name string) (TamperRuleCollection, error)
CreateTamperRuleCollection creates a new tamper rule collection
func (*CaidoClient) DeleteTamperRule ¶
DeleteTamperRule deletes a tamper rule
func (*CaidoClient) GetTamperRuleCollections ¶
func (c *CaidoClient) GetTamperRuleCollections(ctx context.Context) ([]TamperRuleCollection, error)
GetTamperRuleCollections retrieves all tamper rule collections
func (*CaidoClient) IsAuthenticated ¶
func (c *CaidoClient) IsAuthenticated() bool
func (*CaidoClient) ToggleTamperRule ¶
func (c *CaidoClient) ToggleTamperRule(ctx context.Context, ruleID string, enabled bool) (TamperRule, error)
ToggleTamperRule enables or disables a tamper rule
func (*CaidoClient) UpdateTamperRule ¶
func (c *CaidoClient) UpdateTamperRule(ctx context.Context, ruleID string, name string, content string, host string, path string) (TamperRule, error)
UpdateTamperRule updates an existing tamper rule
type CreateTamperRuleCollectionInput ¶
type CreateTamperRuleCollectionInput struct {
Name string `json:"name"`
}
CreateTamperRuleCollectionInput represents the input for creating a tamper rule collection
type CreateTamperRuleCollectionResponse ¶
type CreateTamperRuleCollectionResponse struct {
Collection TamperRuleCollection `graphql:"collection"`
}
CreateTamperRuleCollectionResponse represents the response from creating a tamper rule collection
type CreateTamperRuleInput ¶
type CreateTamperRuleInput struct {
CollectionID string `json:"collectionId"`
Name string `json:"name"`
Section TamperRuleSection `json:"section"`
}
CreateTamperRuleInput represents the input for creating a tamper rule
type CreatedAuthenticationToken ¶
type CreatedAuthenticationToken struct {
CreatedAuthenticationToken struct {
Token struct {
AccessToken string `graphql:"accessToken"`
} `graphql:"token"`
} `graphql:"createdAuthenticationToken(requestId: $requestId)"`
}
type OverridesModule ¶
type OverridesModule interface {
IsCaidoAuthenticated(ctx context.Context) bool
AuthenticateCaido(ctx context.Context, authCompleteChan chan<- bool) (string, error)
ToggleOverride(ctx context.Context, request ToggleOverrideRequest) (bool, error)
GetOverrides(ctx context.Context, page, pageSize int) ([]*override, int, error)
StartContentCheck()
}
type TamperRule ¶
TamperRule represents a tamper rule in Caido
type TamperRuleCollection ¶
TamperRuleCollection represents a collection of tamper rules
type TamperRuleFull ¶
type TamperRuleFull struct {
Full bool `json:"full"`
}
TamperRuleFull represents the full matcher of a tamper rule
type TamperRuleMatcher ¶
type TamperRuleMatcher struct {
Full TamperRuleFull `json:"full"`
}
TamperRuleMatcher represents the matcher of a tamper rule
type TamperRuleOperation ¶
type TamperRuleOperation struct {
Raw TamperRuleRaw `json:"raw"`
}
TamperRuleOperation represents the operation of a tamper rule
type TamperRuleRaw ¶
type TamperRuleRaw struct {
Matcher TamperRuleMatcher `json:"matcher"`
Replacer TamperRuleReplacer `json:"replacer"`
}
TamperRuleRaw represents the raw operation of a tamper rule
type TamperRuleReplacer ¶
type TamperRuleReplacer struct {
Term TamperRuleTerm `json:"term"`
}
TamperRuleReplacer represents the replacer of a tamper rule
type TamperRuleResponseBody ¶
type TamperRuleResponseBody struct {
Operation TamperRuleOperation `json:"operation"`
}
TamperRuleResponseBody represents the response body section of a tamper rule
type TamperRuleSection ¶
type TamperRuleSection struct {
ResponseBody TamperRuleResponseBody `json:"responseBody"`
}
TamperRuleSection represents the section of a tamper rule
type TamperRuleTerm ¶
type TamperRuleTerm struct {
Term string `json:"term"`
}
TamperRuleTerm represents the term replacer of a tamper rule
type ToggleOverrideRequest ¶
type ToggleOverrideRequest struct {
AssetURL string
}