Documentation ¶
Index ¶
- Constants
- type AllowList
- type Directive
- func NewAccelerometer(origins ...Origin) Directive
- func NewAmbientLightSensor(origins ...Origin) Directive
- func NewAutoplay(origins ...Origin) Directive
- func NewBattery(origins ...Origin) Directive
- func NewCamera(origins ...Origin) Directive
- func NewDirective(name string, allowed ...Origin) (d Directive)
- func NewDisplayCapture(origins ...Origin) Directive
- func NewDocumentDomain(origins ...Origin) Directive
- func NewEncryptedMedia(origins ...Origin) Directive
- func NewExecutionWhileNotRendered(origins ...Origin) Directive
- func NewExecutionWhileOutOfViewport(origins ...Origin) Directive
- func NewFullscreen(origins ...Origin) Directive
- func NewGamepad(origins ...Origin) Directive
- func NewGamepadconnected(origins ...Origin) Directive
- func NewGeolocation(origins ...Origin) Directive
- func NewGyroscope(origins ...Origin) Directive
- func NewHid(origins ...Origin) Directive
- func NewHidden(origins ...Origin) Directive
- func NewIdleDetection(origins ...Origin) Directive
- func NewLocalFonts(origins ...Origin) Directive
- func NewMagnetometer(origins ...Origin) Directive
- func NewMicrophone(origins ...Origin) Directive
- func NewMidi(origins ...Origin) Directive
- func NewPayment(origins ...Origin) Directive
- func NewPictureInPicture(origins ...Origin) Directive
- func NewPublickeyCredentialsGet(origins ...Origin) Directive
- func NewScreenWakeLock(origins ...Origin) Directive
- func NewSerial(origins ...Origin) Directive
- func NewSpeakerSelection(origins ...Origin) Directive
- func NewUsb(origins ...Origin) Directive
- func NewWebShare(origins ...Origin) Directive
- func NewXrSpatialTracking(origins ...Origin) Directive
- type ModifyPolicyFn
- type Origin
- type Policy
- type PolicyHandler
- func (h *PolicyHandler) ApplyHeaders(w http.ResponseWriter, r *http.Request)
- func (h *PolicyHandler) FinalizeRequest(w http.ResponseWriter, r *http.Request)
- func (h *PolicyHandler) GetRequestPolicy(r *http.Request) (policy Policy)
- func (h *PolicyHandler) ModifyPolicyMiddleware(fn ModifyPolicyFn) (mw func(next http.Handler) http.Handler)
- func (h *PolicyHandler) PrepareRequestMiddleware(next http.Handler) http.Handler
- func (h *PolicyHandler) SetRequestPolicy(r *http.Request, policy Policy) (modified *http.Request)
Constants ¶
View Source
const ( AllowAll keywordOrigin = "*" AllowNone keywordOrigin = "()" AllowSelf keywordOrigin = "self" AllowSrc keywordOrigin = "src" )
View Source
const (
PolicyTag = "permissions-policy"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Directive ¶
func NewAccelerometer ¶
func NewAmbientLightSensor ¶
func NewAutoplay ¶
func NewBattery ¶
func NewDirective ¶
func NewDisplayCapture ¶
func NewDocumentDomain ¶
func NewEncryptedMedia ¶
func NewFullscreen ¶
func NewGamepad ¶
func NewGamepadconnected ¶
func NewGeolocation ¶
func NewGyroscope ¶
func NewIdleDetection ¶
func NewLocalFonts ¶
func NewMagnetometer ¶
func NewMicrophone ¶
func NewPayment ¶
func NewPictureInPicture ¶
func NewScreenWakeLock ¶
func NewSpeakerSelection ¶
func NewWebShare ¶
func NewXrSpatialTracking ¶
type Origin ¶
func NewSpecificOrigin ¶
type Policy ¶
func NoPermissionsPolicy ¶
func NoPermissionsPolicy() Policy
type PolicyHandler ¶
func NewPolicyHandler ¶
func NewPolicyHandler() (h *PolicyHandler)
func (*PolicyHandler) ApplyHeaders ¶
func (h *PolicyHandler) ApplyHeaders(w http.ResponseWriter, r *http.Request)
func (*PolicyHandler) FinalizeRequest ¶
func (h *PolicyHandler) FinalizeRequest(w http.ResponseWriter, r *http.Request)
func (*PolicyHandler) GetRequestPolicy ¶
func (h *PolicyHandler) GetRequestPolicy(r *http.Request) (policy Policy)
func (*PolicyHandler) ModifyPolicyMiddleware ¶
func (h *PolicyHandler) ModifyPolicyMiddleware(fn ModifyPolicyFn) (mw func(next http.Handler) http.Handler)
func (*PolicyHandler) PrepareRequestMiddleware ¶
func (h *PolicyHandler) PrepareRequestMiddleware(next http.Handler) http.Handler
func (*PolicyHandler) SetRequestPolicy ¶
Click to show internal directories.
Click to hide internal directories.