embedpolicy

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package embedpolicy separates browser framing policy from API transport origins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allows

func Allows(origin string, patterns []string) bool

Allows matches an API origin against normalized host patterns.

func FrameAncestors

func FrameAncestors(patterns []string) string

FrameAncestors also permits same-origin management previews. Empty or wholly invalid legacy lists fail closed; invalid strings never reach the CSP header.

func NormalizeOrigin

func NormalizeOrigin(raw string) (string, error)

NormalizeOrigin accepts an HTTP(S) origin, with an optional trailing slash. Reject URL components that cannot appear in an Origin or CSP host source.

func NormalizePattern

func NormalizePattern(raw string) (string, error)

NormalizePattern accepts an exact origin, a subdomain wildcard, or the development wildcard.

Types

This section is empty.

Jump to

Keyboard shortcuts

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