fetchmetadata

package
v0.0.0-...-f115076 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package fetchmetadata provides Fetch-Metadata based protections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy struct {
	ReportOnly bool
	// contains filtered or unexported fields
}

Policy is a security policy based on Fetch Metadata.

See https://web.dev/fetch-metadata/ for more.

func FramingIsolationPolicy

func FramingIsolationPolicy() *Policy

FramingIsolationPolicy protects from framing attacks.

See https://xsleaks.dev/docs/defenses/isolation-policies/framing-isolation/#implementation-with-fetch-metadata

func ResourceIsolationPolicy

func ResourceIsolationPolicy() *Policy

ResourceIsolationPolicy protects resources.

See https://web.dev/fetch-metadata/ for more details.

func (*Policy) Before

Before implements the Fetch Metadata validation and signals logic.

func (*Policy) Commit

Commit is a no-op, required to satisfy the safehttp.Interceptor interface.

func (*Policy) Match

func (p *Policy) Match(cfg safehttp.InterceptorConfig) bool

Match recongnizes configs to disable fetch metadata protection.

Directories

Path Synopsis
Package internalunsafefetchmetadata is used internally to override FM policies.
Package internalunsafefetchmetadata is used internally to override FM policies.
unsafefetchmetadatafortests
Package unsafefetchmetadatafortests can be used to disable Fetch Metadata protections on specific handler registration in tests.
Package unsafefetchmetadatafortests can be used to disable Fetch Metadata protections on specific handler registration in tests.
unsaferesourcepolicy
Package unsaferesourcepolicy can be used to disable Fetch Metadata protections on specific handler registration.
Package unsaferesourcepolicy can be used to disable Fetch Metadata protections on specific handler registration.

Jump to

Keyboard shortcuts

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