security

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package security implements the Security domain. Security

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 Security domain with the connection set to conn.

Types

type CertificateErrorAction

type CertificateErrorAction int

CertificateErrorAction The action to take when a certificate error occurs. continue will continue processing the request and cancel will cancel the request.

const (
	CertificateErrorActionNotSet CertificateErrorAction = iota
	CertificateErrorActionContinue
	CertificateErrorActionCancel
)

CertificateErrorAction as enums.

func (CertificateErrorAction) MarshalJSON

func (e CertificateErrorAction) MarshalJSON() ([]byte, error)

MarshalJSON encodes enum into a string or null when not set.

func (CertificateErrorAction) String

func (e CertificateErrorAction) String() string

func (*CertificateErrorAction) UnmarshalJSON

func (e *CertificateErrorAction) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes a string value into a enum.

func (CertificateErrorAction) Valid

func (e CertificateErrorAction) Valid() bool

Valid returns true if enum is set.

type CertificateErrorClient

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

CertificateErrorClient is a client for CertificateError events. There is a certificate error. If overriding certificate errors is enabled, then it should be handled with the handleCertificateError command. Note: this event does not fire if the certificate error has been allowed internally.

type CertificateErrorReply

type CertificateErrorReply struct {
	EventID    int    `json:"eventId"`    // The ID of the event.
	ErrorType  string `json:"errorType"`  // The type of the error.
	RequestURL string `json:"requestURL"` // The url that was requested.
}

CertificateErrorReply is the reply for CertificateError events.

type CertificateID

type CertificateID int

CertificateID An internal certificate ID value.

type HandleCertificateErrorArgs

type HandleCertificateErrorArgs struct {
	EventID int                    `json:"eventId"` // The ID of the event.
	Action  CertificateErrorAction `json:"action"`  // The action to take on the certificate error.
}

HandleCertificateErrorArgs represents the arguments for HandleCertificateError in the Security domain.

func NewHandleCertificateErrorArgs

func NewHandleCertificateErrorArgs(eventID int, action CertificateErrorAction) *HandleCertificateErrorArgs

NewHandleCertificateErrorArgs initializes HandleCertificateErrorArgs with the required arguments.

type InsecureContentStatus

type InsecureContentStatus struct {
	RanMixedContent                bool  `json:"ranMixedContent"`                // True if the page was loaded over HTTPS and ran mixed (HTTP) content such as scripts.
	DisplayedMixedContent          bool  `json:"displayedMixedContent"`          // True if the page was loaded over HTTPS and displayed mixed (HTTP) content such as images.
	ContainedMixedForm             bool  `json:"containedMixedForm"`             // True if the page was loaded over HTTPS and contained a form targeting an insecure url.
	RanContentWithCertErrors       bool  `json:"ranContentWithCertErrors"`       // True if the page was loaded over HTTPS without certificate errors, and ran content such as scripts that were loaded with certificate errors.
	DisplayedContentWithCertErrors bool  `json:"displayedContentWithCertErrors"` // True if the page was loaded over HTTPS without certificate errors, and displayed content such as images that were loaded with certificate errors.
	RanInsecureContentStyle        State `json:"ranInsecureContentStyle"`        // Security state representing a page that ran insecure content.
	DisplayedInsecureContentStyle  State `json:"displayedInsecureContentStyle"`  // Security state representing a page that displayed insecure content.
}

InsecureContentStatus Information about insecure content on the page.

type MixedContentType

type MixedContentType int

MixedContentType A description of mixed content (HTTP resources on HTTPS pages), as defined by https://www.w3.org/TR/mixed-content/#categories

const (
	MixedContentTypeNotSet MixedContentType = iota
	MixedContentTypeBlockable
	MixedContentTypeOptionallyBlockable
	MixedContentTypeNone
)

MixedContentType as enums.

func (MixedContentType) MarshalJSON

func (e MixedContentType) MarshalJSON() ([]byte, error)

MarshalJSON encodes enum into a string or null when not set.

func (MixedContentType) String

func (e MixedContentType) String() string

func (*MixedContentType) UnmarshalJSON

func (e *MixedContentType) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes a string value into a enum.

func (MixedContentType) Valid

func (e MixedContentType) Valid() bool

Valid returns true if enum is set.

type SetOverrideCertificateErrorsArgs

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

SetOverrideCertificateErrorsArgs represents the arguments for SetOverrideCertificateErrors in the Security domain.

func NewSetOverrideCertificateErrorsArgs

func NewSetOverrideCertificateErrorsArgs(override bool) *SetOverrideCertificateErrorsArgs

NewSetOverrideCertificateErrorsArgs initializes SetOverrideCertificateErrorsArgs with the required arguments.

type State

type State int

State The security level of a page or resource.

const (
	StateNotSet State = iota
	StateUnknown
	StateNeutral
	StateInsecure
	StateWarning
	StateSecure
	StateInfo
)

State as enums.

func (State) MarshalJSON

func (e State) MarshalJSON() ([]byte, error)

MarshalJSON encodes enum into a string or null when not set.

func (State) String

func (e State) String() string

func (*State) UnmarshalJSON

func (e *State) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes a string value into a enum.

func (State) Valid

func (e State) Valid() bool

Valid returns true if enum is set.

type StateChangedClient

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

StateChangedClient is a client for SecurityStateChanged events. The security state of the page changed.

type StateChangedReply

type StateChangedReply struct {
	SecurityState         State                 `json:"securityState"`         // Security state.
	SchemeIsCryptographic bool                  `json:"schemeIsCryptographic"` // True if the page was loaded over cryptographic transport such as HTTPS.
	Explanations          []StateExplanation    `json:"explanations"`          // List of explanations for the security state. If the overall security state is `insecure` or `warning`, at least one corresponding explanation should be included.
	InsecureContentStatus InsecureContentStatus `json:"insecureContentStatus"` // Information about insecure content on the page.
	Summary               *string               `json:"summary,omitempty"`     // Overrides user-visible description of the state.
}

StateChangedReply is the reply for SecurityStateChanged events.

type StateExplanation

type StateExplanation struct {
	SecurityState    State            `json:"securityState"`    // Security state representing the severity of the factor being explained.
	Summary          string           `json:"summary"`          // Short phrase describing the type of factor.
	Description      string           `json:"description"`      // Full text explanation of the factor.
	MixedContentType MixedContentType `json:"mixedContentType"` // The type of mixed content described by the explanation.
	Certificate      []string         `json:"certificate"`      // Page certificate.
}

StateExplanation An explanation of an factor contributing to the security state.

Jump to

Keyboard shortcuts

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