audits

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 5 Imported by: 5

Documentation

Overview

Package audits implements the Audits domain. Audits domain allows investigation of page violations and possible improvements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn *rpcc.Conn) *domainClient

NewClient returns a client for the Audits domain with the connection set to conn.

Types

type AffectedCookie added in v0.26.0

type AffectedCookie struct {
	Name   string `json:"name"`   // The following three properties uniquely identify a cookie
	Path   string `json:"path"`   // No description.
	Domain string `json:"domain"` // No description.
}

AffectedCookie Information about a cookie that is affected by an inspector issue.

type AffectedFrame added in v0.29.0

type AffectedFrame struct {
	FrameID page.FrameID `json:"frameId"` // No description.
}

AffectedFrame Information about the frame affected by an inspector issue.

type AffectedRequest added in v0.29.0

type AffectedRequest struct {
	RequestID network.RequestID `json:"requestId"`     // The unique request id.
	URL       *string           `json:"url,omitempty"` // No description.
}

AffectedRequest Information about a request that is affected by an inspector issue.

type BlockedByResponseIssueDetails added in v0.29.0

type BlockedByResponseIssueDetails struct {
	Request AffectedRequest         `json:"request"`         // No description.
	Frame   *AffectedFrame          `json:"frame,omitempty"` // No description.
	Reason  BlockedByResponseReason `json:"reason"`          // No description.
}

BlockedByResponseIssueDetails Details for a request that has been blocked with the BLOCKED_BY_RESPONSE code. Currently only used for COEP/COOP, but may be extended to include some CSP errors in the future.

type BlockedByResponseReason added in v0.29.0

type BlockedByResponseReason string

BlockedByResponseReason Enum indicating the reason a response has been blocked. These reasons are refinements of the net error BLOCKED_BY_RESPONSE.

const (
	BlockedByResponseReasonNotSet                                            BlockedByResponseReason = ""
	BlockedByResponseReasonCoepFrameResourceNeedsCoepHeader                  BlockedByResponseReason = "CoepFrameResourceNeedsCoepHeader"
	BlockedByResponseReasonCoopSandboxedIFrameCannotNavigateToCoopPage       BlockedByResponseReason = "CoopSandboxedIFrameCannotNavigateToCoopPage"
	BlockedByResponseReasonCorpNotSameOrigin                                 BlockedByResponseReason = "CorpNotSameOrigin"
	BlockedByResponseReasonCorpNotSameOriginAfterDefaultedToSameOriginByCoep BlockedByResponseReason = "CorpNotSameOriginAfterDefaultedToSameOriginByCoep"
	BlockedByResponseReasonCorpNotSameSite                                   BlockedByResponseReason = "CorpNotSameSite"
)

BlockedByResponseReason as enums.

func (BlockedByResponseReason) String added in v0.29.0

func (e BlockedByResponseReason) String() string

func (BlockedByResponseReason) Valid added in v0.29.0

func (e BlockedByResponseReason) Valid() bool

type GetEncodedResponseArgs

type GetEncodedResponseArgs struct {
	RequestID network.RequestID `json:"requestId"` // Identifier of the network request to get content for.
	// Encoding The encoding to use.
	//
	// Values: "webp", "jpeg", "png".
	Encoding string   `json:"encoding"`
	Quality  *float64 `json:"quality,omitempty"`  // The quality of the encoding (0-1). (defaults to 1)
	SizeOnly *bool    `json:"sizeOnly,omitempty"` // Whether to only return the size information (defaults to false).
}

GetEncodedResponseArgs represents the arguments for GetEncodedResponse in the Audits domain.

func NewGetEncodedResponseArgs

func NewGetEncodedResponseArgs(requestID network.RequestID, encoding string) *GetEncodedResponseArgs

NewGetEncodedResponseArgs initializes GetEncodedResponseArgs with the required arguments.

func (*GetEncodedResponseArgs) SetQuality

func (a *GetEncodedResponseArgs) SetQuality(quality float64) *GetEncodedResponseArgs

SetQuality sets the Quality optional argument. The quality of the encoding (0-1). (defaults to 1)

func (*GetEncodedResponseArgs) SetSizeOnly

func (a *GetEncodedResponseArgs) SetSizeOnly(sizeOnly bool) *GetEncodedResponseArgs

SetSizeOnly sets the SizeOnly optional argument. Whether to only return the size information (defaults to false).

type GetEncodedResponseReply

type GetEncodedResponseReply struct {
	Body         *string `json:"body,omitempty"` // The encoded body as a base64 string. Omitted if sizeOnly is true.
	OriginalSize int     `json:"originalSize"`   // Size before re-encoding.
	EncodedSize  int     `json:"encodedSize"`    // Size after re-encoding.
}

GetEncodedResponseReply represents the return values for GetEncodedResponse in the Audits domain.

type InspectorIssue added in v0.26.0

type InspectorIssue struct {
	Code    InspectorIssueCode    `json:"code"`    // No description.
	Details InspectorIssueDetails `json:"details"` // No description.
}

InspectorIssue An inspector issue reported from the back-end.

type InspectorIssueCode added in v0.26.0

type InspectorIssueCode string

InspectorIssueCode A unique identifier for the type of issue. Each type may use one of the optional fields in InspectorIssueDetails to convey more specific information about the kind of issue.

const (
	InspectorIssueCodeNotSet                 InspectorIssueCode = ""
	InspectorIssueCodeSameSiteCookieIssue    InspectorIssueCode = "SameSiteCookieIssue"
	InspectorIssueCodeMixedContentIssue      InspectorIssueCode = "MixedContentIssue"
	InspectorIssueCodeBlockedByResponseIssue InspectorIssueCode = "BlockedByResponseIssue"
)

InspectorIssueCode as enums.

func (InspectorIssueCode) String added in v0.26.0

func (e InspectorIssueCode) String() string

func (InspectorIssueCode) Valid added in v0.26.0

func (e InspectorIssueCode) Valid() bool

type InspectorIssueDetails added in v0.26.0

type InspectorIssueDetails struct {
	SameSiteCookieIssueDetails    *SameSiteCookieIssueDetails    `json:"sameSiteCookieIssueDetails,omitempty"`    // No description.
	MixedContentIssueDetails      *MixedContentIssueDetails      `json:"mixedContentIssueDetails,omitempty"`      // No description.
	BlockedByResponseIssueDetails *BlockedByResponseIssueDetails `json:"blockedByResponseIssueDetails,omitempty"` // No description.
}

InspectorIssueDetails This struct holds a list of optional fields with additional information specific to the kind of issue. When adding a new issue code, please also add a new optional field to this type.

type IssueAddedClient added in v0.26.0

type IssueAddedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*IssueAddedReply, error)
	rpcc.Stream
}

IssueAddedClient is a client for IssueAdded events.

type IssueAddedReply added in v0.26.0

type IssueAddedReply struct {
	Issue InspectorIssue `json:"issue"` // No description.
}

IssueAddedReply is the reply for IssueAdded events.

type MixedContentIssueDetails added in v0.29.0

type MixedContentIssueDetails struct {
	ResourceType     MixedContentResourceType     `json:"resourceType,omitempty"` // The type of resource causing the mixed content issue (css, js, iframe, form,...). Marked as optional because it is mapped to from blink::mojom::RequestContextType, which will be replaced by network::mojom::RequestDestination
	ResolutionStatus MixedContentResolutionStatus `json:"resolutionStatus"`       // The way the mixed content issue is being resolved.
	InsecureURL      string                       `json:"insecureURL"`            // The unsafe http url causing the mixed content issue.
	MainResourceURL  string                       `json:"mainResourceURL"`        // The url responsible for the call to an unsafe url.
	Request          *AffectedRequest             `json:"request,omitempty"`      // The mixed content request. Does not always exist (e.g. for unsafe form submission urls).
	Frame            *AffectedFrame               `json:"frame,omitempty"`        // Optional because not every mixed content issue is necessarily linked to a frame.
}

MixedContentIssueDetails

type MixedContentResolutionStatus added in v0.29.0

type MixedContentResolutionStatus string

MixedContentResolutionStatus

const (
	MixedContentResolutionStatusNotSet                            MixedContentResolutionStatus = ""
	MixedContentResolutionStatusMixedContentBlocked               MixedContentResolutionStatus = "MixedContentBlocked"
	MixedContentResolutionStatusMixedContentAutomaticallyUpgraded MixedContentResolutionStatus = "MixedContentAutomaticallyUpgraded"
	MixedContentResolutionStatusMixedContentWarning               MixedContentResolutionStatus = "MixedContentWarning"
)

MixedContentResolutionStatus as enums.

func (MixedContentResolutionStatus) String added in v0.29.0

func (MixedContentResolutionStatus) Valid added in v0.29.0

type MixedContentResourceType added in v0.29.0

type MixedContentResourceType string

MixedContentResourceType

const (
	MixedContentResourceTypeNotSet         MixedContentResourceType = ""
	MixedContentResourceTypeAudio          MixedContentResourceType = "Audio"
	MixedContentResourceTypeBeacon         MixedContentResourceType = "Beacon"
	MixedContentResourceTypeCSPReport      MixedContentResourceType = "CSPReport"
	MixedContentResourceTypeDownload       MixedContentResourceType = "Download"
	MixedContentResourceTypeEventSource    MixedContentResourceType = "EventSource"
	MixedContentResourceTypeFavicon        MixedContentResourceType = "Favicon"
	MixedContentResourceTypeFont           MixedContentResourceType = "Font"
	MixedContentResourceTypeForm           MixedContentResourceType = "Form"
	MixedContentResourceTypeFrame          MixedContentResourceType = "Frame"
	MixedContentResourceTypeImage          MixedContentResourceType = "Image"
	MixedContentResourceTypeImport         MixedContentResourceType = "Import"
	MixedContentResourceTypeManifest       MixedContentResourceType = "Manifest"
	MixedContentResourceTypePing           MixedContentResourceType = "Ping"
	MixedContentResourceTypePluginData     MixedContentResourceType = "PluginData"
	MixedContentResourceTypePluginResource MixedContentResourceType = "PluginResource"
	MixedContentResourceTypePrefetch       MixedContentResourceType = "Prefetch"
	MixedContentResourceTypeResource       MixedContentResourceType = "Resource"
	MixedContentResourceTypeScript         MixedContentResourceType = "Script"
	MixedContentResourceTypeServiceWorker  MixedContentResourceType = "ServiceWorker"
	MixedContentResourceTypeSharedWorker   MixedContentResourceType = "SharedWorker"
	MixedContentResourceTypeStylesheet     MixedContentResourceType = "Stylesheet"
	MixedContentResourceTypeTrack          MixedContentResourceType = "Track"
	MixedContentResourceTypeVideo          MixedContentResourceType = "Video"
	MixedContentResourceTypeWorker         MixedContentResourceType = "Worker"
	MixedContentResourceTypeXMLHttpRequest MixedContentResourceType = "XMLHttpRequest"
	MixedContentResourceTypeXSLT           MixedContentResourceType = "XSLT"
)

MixedContentResourceType as enums.

func (MixedContentResourceType) String added in v0.29.0

func (e MixedContentResourceType) String() string

func (MixedContentResourceType) Valid added in v0.29.0

func (e MixedContentResourceType) Valid() bool

type SameSiteCookieExclusionReason added in v0.26.0

type SameSiteCookieExclusionReason string

SameSiteCookieExclusionReason

const (
	SameSiteCookieExclusionReasonNotSet                                 SameSiteCookieExclusionReason = ""
	SameSiteCookieExclusionReasonExcludeSameSiteUnspecifiedTreatedAsLax SameSiteCookieExclusionReason = "ExcludeSameSiteUnspecifiedTreatedAsLax"
	SameSiteCookieExclusionReasonExcludeSameSiteNoneInsecure            SameSiteCookieExclusionReason = "ExcludeSameSiteNoneInsecure"
)

SameSiteCookieExclusionReason as enums.

func (SameSiteCookieExclusionReason) String added in v0.26.0

func (SameSiteCookieExclusionReason) Valid added in v0.26.0

type SameSiteCookieIssueDetails added in v0.26.0

type SameSiteCookieIssueDetails struct {
	Cookie                 AffectedCookie                  `json:"cookie"`                   // No description.
	CookieWarningReasons   []SameSiteCookieWarningReason   `json:"cookieWarningReasons"`     // No description.
	CookieExclusionReasons []SameSiteCookieExclusionReason `json:"cookieExclusionReasons"`   // No description.
	Operation              SameSiteCookieOperation         `json:"operation"`                // Optionally identifies the site-for-cookies and the cookie url, which may be used by the front-end as additional context.
	SiteForCookies         *string                         `json:"siteForCookies,omitempty"` // No description.
	CookieURL              *string                         `json:"cookieUrl,omitempty"`      // No description.
	Request                *AffectedRequest                `json:"request,omitempty"`        // No description.
}

SameSiteCookieIssueDetails This information is currently necessary, as the front-end has a difficult time finding a specific cookie. With this, we can convey specific error information without the cookie.

type SameSiteCookieOperation added in v0.29.0

type SameSiteCookieOperation string

SameSiteCookieOperation

const (
	SameSiteCookieOperationNotSet     SameSiteCookieOperation = ""
	SameSiteCookieOperationSetCookie  SameSiteCookieOperation = "SetCookie"
	SameSiteCookieOperationReadCookie SameSiteCookieOperation = "ReadCookie"
)

SameSiteCookieOperation as enums.

func (SameSiteCookieOperation) String added in v0.29.0

func (e SameSiteCookieOperation) String() string

func (SameSiteCookieOperation) Valid added in v0.29.0

func (e SameSiteCookieOperation) Valid() bool

type SameSiteCookieWarningReason added in v0.26.0

type SameSiteCookieWarningReason string

SameSiteCookieWarningReason

const (
	SameSiteCookieWarningReasonNotSet                                  SameSiteCookieWarningReason = ""
	SameSiteCookieWarningReasonWarnSameSiteUnspecifiedCrossSiteContext SameSiteCookieWarningReason = "WarnSameSiteUnspecifiedCrossSiteContext"
	SameSiteCookieWarningReasonWarnSameSiteNoneInsecure                SameSiteCookieWarningReason = "WarnSameSiteNoneInsecure"
	SameSiteCookieWarningReasonWarnSameSiteUnspecifiedLaxAllowUnsafe   SameSiteCookieWarningReason = "WarnSameSiteUnspecifiedLaxAllowUnsafe"
	SameSiteCookieWarningReasonWarnSameSiteStrictLaxDowngradeStrict    SameSiteCookieWarningReason = "WarnSameSiteStrictLaxDowngradeStrict"
	SameSiteCookieWarningReasonWarnSameSiteStrictCrossDowngradeStrict  SameSiteCookieWarningReason = "WarnSameSiteStrictCrossDowngradeStrict"
	SameSiteCookieWarningReasonWarnSameSiteStrictCrossDowngradeLax     SameSiteCookieWarningReason = "WarnSameSiteStrictCrossDowngradeLax"
	SameSiteCookieWarningReasonWarnSameSiteLaxCrossDowngradeStrict     SameSiteCookieWarningReason = "WarnSameSiteLaxCrossDowngradeStrict"
	SameSiteCookieWarningReasonWarnSameSiteLaxCrossDowngradeLax        SameSiteCookieWarningReason = "WarnSameSiteLaxCrossDowngradeLax"
)

SameSiteCookieWarningReason as enums.

func (SameSiteCookieWarningReason) String added in v0.26.0

func (SameSiteCookieWarningReason) Valid added in v0.26.0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL