security

package
v1.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: BSD-2-Clause Imports: 2 Imported by: 12

Documentation

Overview

Package security provides type definitions for use with the Chrome Security protocol

https://chromedevtools.github.io/devtools-protocol/tot/Security/

Index

Constants

This section is empty.

Variables

View Source
var CertificateErrorAction = certificateErrorActionEnum{
	Continue: certificateErrorActionContinue,
	Cancel:   certificateErrorActionCancel,
}

CertificateErrorAction provides named acces to the CertificateErrorActionEnum values.

View Source
var MixedContentType = mixedContentTypeEnum{
	Blockable:           mixedContentTypeBlockable,
	OptionallyBlockable: mixedContentTypeOptionallyBlockable,
	None:                mixedContentTypeNone,
}

MixedContentType provides named acces to the MixedContentTypeEnum values.

View Source
var State = stateEnum{
	Unknown:  stateUnknown,
	Neutral:  stateNeutral,
	Insecure: stateInsecure,
	Secure:   stateSecure,
	Info:     stateInfo,
}

State provides named acces to the StateEnum values.

Functions

This section is empty.

Types

type CertificateErrorActionEnum

type CertificateErrorActionEnum int

CertificateErrorActionEnum describes the action to take when a certificate error occurs. 'continue' will continue processing the request and 'cancel' will cancel the request. Allowed values:

  • CertificateErrorAction.Continue "continue"
  • CertificateErrorAction.Cancel "cancel"

https://chromedevtools.github.io/devtools-protocol/tot/Security/#type-CertificateErrorAction

func (CertificateErrorActionEnum) MarshalJSON

func (enum CertificateErrorActionEnum) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (CertificateErrorActionEnum) String

func (enum CertificateErrorActionEnum) String() string

String implements Stringer

func (*CertificateErrorActionEnum) UnmarshalJSON

func (enum *CertificateErrorActionEnum) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements json.Unmarshaler

type CertificateErrorEvent

type CertificateErrorEvent struct {
	// The ID of the event.
	EventID int `json:"eventId"`

	// The type of the error.
	ErrorType string `json:"errorType"`

	// The url that was requested.
	RequestURL string `json:"requestURL"`

	// Error information related to this event
	Err error `json:"-"`
}

CertificateErrorEvent represents Security.certificateError event data.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#event-certificateError

type CertificateID

type CertificateID int

CertificateID is an internal certificate ID value.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#type-CertificateId

type DisableResult

type DisableResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

DisableResult represents the result of calls to Security.disable.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#method-disable

type EnableResult

type EnableResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

EnableResult represents the result of calls to Security.enable.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#method-enable

type HandleCertificateErrorParams

type HandleCertificateErrorParams struct {
	// The ID of the event.
	EventID int `json:"eventId"`

	// The action to take on the certificate error. Allowed values:
	//	- CertificateErrorAction.Continue
	//	- CertificateErrorAction.Cancel
	Action CertificateErrorActionEnum `json:"action"`
}

HandleCertificateErrorParams represents Security.handleCertificateError parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#method-handleCertificateError

type HandleCertificateErrorResult

type HandleCertificateErrorResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

HandleCertificateErrorResult represents the result of calls to Security.handleCertificateError.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#method-handleCertificateError

type InsecureContentStatus

type InsecureContentStatus struct {
	// True if the page was loaded over HTTPS and ran mixed (HTTP) content such
	// as scripts.
	RanMixedContent bool `json:"ranMixedContent"`

	// True if the page was loaded over HTTPS and displayed mixed (HTTP) content
	// such as images.
	DisplayedMixedContent bool `json:"displayedMixedContent"`

	// True if the page was loaded over HTTPS and contained a form targeting an
	// insecure url.
	ContainedMixedForm bool `json:"containedMixedForm"`

	// True if the page was loaded over HTTPS without certificate errors, and
	// ran content such as scripts that were loaded with certificate errors.
	RanContentWithCertErrors bool `json:"ranContentWithCertErrors"`

	// True if the page was loaded over HTTPS without certificate errors, and
	// displayed content such as images that were loaded with certificate errors.
	DisplayedContentWithCertErrors bool `json:"displayedContentWithCertErrors"`

	// Security state representing a page that ran insecure content. Allowed
	// values:
	//	- State.Unknown
	//	- State.Neutral
	//	- State.Insecure
	//	- State.Secure
	//	- State.Info
	RanInsecureContentStyle StateEnum `json:"ranInsecureContentStyle"`

	// Security state representing a page that displayed insecure content.
	// Allowed values:
	//	- State.Unknown
	//	- State.Neutral
	//	- State.Insecure
	//	- State.Secure
	//	- State.Info
	DisplayedInsecureContentStyle StateEnum `json:"displayedInsecureContentStyle"`
}

InsecureContentStatus describes information about insecure content on the page.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#type-InsecureContentStatus

type MixedContentTypeEnum

type MixedContentTypeEnum int

MixedContentTypeEnum is a description of mixed content (HTTP resources on HTTPS pages), as defined by https://www.w3.org/TR/mixed-content/#categories Allowed values:

  • MixedContentType.Blockable "blockable"
  • MixedContentType.OptionallyBlockable "optionally-blockable"
  • MixedContentType.None "none"

https://chromedevtools.github.io/devtools-protocol/tot/Security/#type-MixedContentType

func (MixedContentTypeEnum) MarshalJSON

func (enum MixedContentTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (MixedContentTypeEnum) String

func (enum MixedContentTypeEnum) String() string

String implements Stringer

func (*MixedContentTypeEnum) UnmarshalJSON

func (enum *MixedContentTypeEnum) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements json.Unmarshaler

type SetIgnoreCertificateErrorsParams

type SetIgnoreCertificateErrorsParams struct {
	// If true, all certificate errors will be ignored.
	Ignore bool `json:"ignore"`
}

SetIgnoreCertificateErrorsParams represents Security.setIgnoreCertificateErrors parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#method-setIgnoreCertificateErrors

type SetIgnoreCertificateErrorsResult

type SetIgnoreCertificateErrorsResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

SetIgnoreCertificateErrorsResult represents the result of calls to Security.setIgnoreCertificateErrors.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#method-setIgnoreCertificateErrors

type SetOverrideCertificateErrorsParams

type SetOverrideCertificateErrorsParams struct {
	// If true, certificate errors will be overridden.
	Override bool `json:"override"`
}

SetOverrideCertificateErrorsParams represents Security.setOverrideCertificateErrors parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#method-setOverrideCertificateErrors

type SetOverrideCertificateErrorsResult

type SetOverrideCertificateErrorsResult struct {
	// Error information related to executing this method
	Err error `json:"-"`
}

SetOverrideCertificateErrorsResult represents the result of calls to Security.setOverrideCertificateErrors.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#method-setOverrideCertificateErrors

type StateChangedEvent

type StateChangedEvent struct {
	// Security state. Allowed values:
	//	- State.Unknown
	//	- State.Neutral
	//	- State.Insecure
	//	- State.Secure
	//	- State.Info
	State StateEnum `json:"securityState"`

	// True if the page was loaded over cryptographic transport such as HTTPS.
	SchemeIsCryptographic bool `json:"schemeIsCryptographic"`

	// List of explanations for the security state. If the overall security
	// state is `insecure` or `warning`, at least one corresponding explanation
	// should be included.
	Explanations []*StateExplanation `json:"explanations"`

	// Information about insecure content on the page.
	InsecureContentStatus *InsecureContentStatus `json:"insecureContentStatus"`

	// Optional. Overrides user-visible description of the state.
	Summary string `json:"summary,omitempty"`

	// Error information related to this event
	Err error `json:"-"`
}

StateChangedEvent represents Security.securityStateChanged event data.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#event-securityStateChanged

type StateEnum

type StateEnum int

StateEnum is the security level of a page or resource. Allowed values:

  • State.Unknown "unknown"
  • State.Neutral "neutral"
  • State.Insecure "insecure"
  • State.Secure "secure"
  • State.Info "info"

https://chromedevtools.github.io/devtools-protocol/tot/Security/#type-SecurityState

func (StateEnum) MarshalJSON

func (enum StateEnum) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (StateEnum) String

func (enum StateEnum) String() string

String implements Stringer

func (*StateEnum) UnmarshalJSON

func (enum *StateEnum) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements json.Unmarshaler

type StateExplanation

type StateExplanation struct {
	// Security state representing the severity of the factor being explained.
	// Allowed values:
	//	- State.Unknown
	//	- State.Neutral
	//	- State.Insecure
	//	- State.Secure
	//	- State.Info
	State StateEnum `json:"securityState"`

	// Short phrase describing the type of factor.
	Summary string `json:"summary"`

	// Full text explanation of the factor.
	Description string `json:"description"`

	// The type of mixed content described by the explanation.
	MixedContentType MixedContentTypeEnum `json:"mixedContentType"`

	// Page certificate.
	Certificate []string `json:"certificate"`
}

StateExplanation is an explanation of a factor contributing to the security state.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#type-SecurityStateExplanation

Jump to

Keyboard shortcuts

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