2017-01-24 15:09:23 +00:00
|
|
|
// Package security provides the Chrome Debugging Protocol
|
2017-02-12 04:59:33 +00:00
|
|
|
// commands, types, and events for the Security domain.
|
2017-01-24 15:09:23 +00:00
|
|
|
//
|
|
|
|
// Security.
|
|
|
|
//
|
|
|
|
// Generated by the chromedp-gen command.
|
|
|
|
package security
|
|
|
|
|
|
|
|
// AUTOGENERATED. DO NOT EDIT.
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2017-01-26 07:28:34 +00:00
|
|
|
cdp "github.com/knq/chromedp/cdp"
|
2017-01-24 15:09:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// EnableParams enables tracking security state changes.
|
|
|
|
type EnableParams struct{}
|
|
|
|
|
|
|
|
// Enable enables tracking security state changes.
|
|
|
|
func Enable() *EnableParams {
|
|
|
|
return &EnableParams{}
|
|
|
|
}
|
|
|
|
|
2017-02-12 04:59:33 +00:00
|
|
|
// Do executes Security.enable against the provided context and
|
|
|
|
// target handler.
|
|
|
|
func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
|
2017-02-14 08:41:23 +00:00
|
|
|
return h.Execute(ctxt, cdp.CommandSecurityEnable, nil, nil)
|
2017-01-24 15:09:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// DisableParams disables tracking security state changes.
|
|
|
|
type DisableParams struct{}
|
|
|
|
|
|
|
|
// Disable disables tracking security state changes.
|
|
|
|
func Disable() *DisableParams {
|
|
|
|
return &DisableParams{}
|
|
|
|
}
|
|
|
|
|
2017-02-12 04:59:33 +00:00
|
|
|
// Do executes Security.disable against the provided context and
|
|
|
|
// target handler.
|
|
|
|
func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
|
2017-02-14 08:41:23 +00:00
|
|
|
return h.Execute(ctxt, cdp.CommandSecurityDisable, nil, nil)
|
2017-01-24 15:09:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ShowCertificateViewerParams displays native dialog with the certificate
|
|
|
|
// details.
|
|
|
|
type ShowCertificateViewerParams struct{}
|
|
|
|
|
|
|
|
// ShowCertificateViewer displays native dialog with the certificate details.
|
|
|
|
func ShowCertificateViewer() *ShowCertificateViewerParams {
|
|
|
|
return &ShowCertificateViewerParams{}
|
|
|
|
}
|
|
|
|
|
2017-02-12 04:59:33 +00:00
|
|
|
// Do executes Security.showCertificateViewer against the provided context and
|
|
|
|
// target handler.
|
|
|
|
func (p *ShowCertificateViewerParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
|
2017-02-14 08:41:23 +00:00
|
|
|
return h.Execute(ctxt, cdp.CommandSecurityShowCertificateViewer, nil, nil)
|
2017-01-24 15:09:23 +00:00
|
|
|
}
|
2017-03-24 22:51:18 +00:00
|
|
|
|
|
|
|
// HandleCertificateErrorParams handles a certificate error that fired a
|
|
|
|
// certificateError event.
|
|
|
|
type HandleCertificateErrorParams struct {
|
|
|
|
EventID int64 `json:"eventId"` // The ID of the event.
|
|
|
|
Action CertificateErrorAction `json:"action"` // The action to take on the certificate error.
|
|
|
|
}
|
|
|
|
|
|
|
|
// HandleCertificateError handles a certificate error that fired a
|
|
|
|
// certificateError event.
|
|
|
|
//
|
|
|
|
// parameters:
|
|
|
|
// eventID - The ID of the event.
|
|
|
|
// action - The action to take on the certificate error.
|
|
|
|
func HandleCertificateError(eventID int64, action CertificateErrorAction) *HandleCertificateErrorParams {
|
|
|
|
return &HandleCertificateErrorParams{
|
|
|
|
EventID: eventID,
|
|
|
|
Action: action,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Do executes Security.handleCertificateError against the provided context and
|
|
|
|
// target handler.
|
|
|
|
func (p *HandleCertificateErrorParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
|
|
|
|
return h.Execute(ctxt, cdp.CommandSecurityHandleCertificateError, p, nil)
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetOverrideCertificateErrorsParams enable/disable overriding certificate
|
|
|
|
// errors. If enabled, all certificate error events need to be handled by the
|
|
|
|
// DevTools client and should be answered with handleCertificateError commands.
|
|
|
|
type SetOverrideCertificateErrorsParams struct {
|
|
|
|
Override bool `json:"override"` // If true, certificate errors will be overridden.
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetOverrideCertificateErrors enable/disable overriding certificate errors.
|
|
|
|
// If enabled, all certificate error events need to be handled by the DevTools
|
|
|
|
// client and should be answered with handleCertificateError commands.
|
|
|
|
//
|
|
|
|
// parameters:
|
|
|
|
// override - If true, certificate errors will be overridden.
|
|
|
|
func SetOverrideCertificateErrors(override bool) *SetOverrideCertificateErrorsParams {
|
|
|
|
return &SetOverrideCertificateErrorsParams{
|
|
|
|
Override: override,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Do executes Security.setOverrideCertificateErrors against the provided context and
|
|
|
|
// target handler.
|
|
|
|
func (p *SetOverrideCertificateErrorsParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
|
|
|
|
return h.Execute(ctxt, cdp.CommandSecuritySetOverrideCertificateErrors, p, nil)
|
|
|
|
}
|