blob: 0d24c04e7b4a063906b9a9bd9b4e17ac76582468 [file] [log] [blame]
package security
// Code generated by cdproto-gen. DO NOT EDIT.
import (
"errors"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
)
// CertificateID an internal certificate ID value.
type CertificateID int64
// Int64 returns the CertificateID as int64 value.
func (t CertificateID) Int64() int64 {
return int64(t)
}
// MixedContentType a description of mixed content (HTTP resources on HTTPS
// pages), as defined by https://www.w3.org/TR/mixed-content/#categories.
type MixedContentType string
// String returns the MixedContentType as string value.
func (t MixedContentType) String() string {
return string(t)
}
// MixedContentType values.
const (
MixedContentTypeBlockable MixedContentType = "blockable"
MixedContentTypeOptionallyBlockable MixedContentType = "optionally-blockable"
MixedContentTypeNone MixedContentType = "none"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t MixedContentType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t MixedContentType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *MixedContentType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch MixedContentType(in.String()) {
case MixedContentTypeBlockable:
*t = MixedContentTypeBlockable
case MixedContentTypeOptionallyBlockable:
*t = MixedContentTypeOptionallyBlockable
case MixedContentTypeNone:
*t = MixedContentTypeNone
default:
in.AddError(errors.New("unknown MixedContentType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *MixedContentType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// State the security level of a page or resource.
type State string
// String returns the State as string value.
func (t State) String() string {
return string(t)
}
// State values.
const (
StateUnknown State = "unknown"
StateNeutral State = "neutral"
StateInsecure State = "insecure"
StateSecure State = "secure"
StateInfo State = "info"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t State) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t State) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *State) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch State(in.String()) {
case StateUnknown:
*t = StateUnknown
case StateNeutral:
*t = StateNeutral
case StateInsecure:
*t = StateInsecure
case StateSecure:
*t = StateSecure
case StateInfo:
*t = StateInfo
default:
in.AddError(errors.New("unknown State value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *State) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// StateExplanation an explanation of an factor contributing to the security
// state.
type StateExplanation struct {
SecurityState State `json:"securityState"` // Security state representing the severity of the factor being explained.
Title string `json:"title"` // Title describing the type of factor.
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.
}
// InsecureContentStatus information about insecure content on the page.
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.
}
// CertificateErrorAction the action to take when a certificate error occurs.
// continue will continue processing the request and cancel will cancel the
// request.
type CertificateErrorAction string
// String returns the CertificateErrorAction as string value.
func (t CertificateErrorAction) String() string {
return string(t)
}
// CertificateErrorAction values.
const (
CertificateErrorActionContinue CertificateErrorAction = "continue"
CertificateErrorActionCancel CertificateErrorAction = "cancel"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CertificateErrorAction) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CertificateErrorAction) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CertificateErrorAction) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CertificateErrorAction(in.String()) {
case CertificateErrorActionContinue:
*t = CertificateErrorActionContinue
case CertificateErrorActionCancel:
*t = CertificateErrorActionCancel
default:
in.AddError(errors.New("unknown CertificateErrorAction value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CertificateErrorAction) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}