internal

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package internal hides all implementation details of packages github.com/jub0bs/fcors and github.com/jub0bs/fcors/risky.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// A nil ACAO indicates that the corresponding header
	// is set dynamically.
	ACAO   []string
	ACAM   []string
	Corpus origin.Corpus

	ACAH                                 []string
	ACMA                                 []string
	PreflightSuccessStatus               int
	AllowAnyMethod                       bool
	AllowAnyRequestHeaders               bool
	AllowAnyOrigin                       bool
	AllowCredentials                     bool
	ExposeAllResponseHeaders             bool
	PrivateNetworkAccess                 bool
	PrivateNetworkAccessInNoCORSModeOnly bool
	ACEH                                 []string
	// contains filtered or unexported fields
}

type Middleware

type Middleware = func(http.Handler) http.Handler

func NewMiddleware added in v0.6.0

func NewMiddleware[A applier](cred bool, one A, others ...A) (Middleware, error)

type Option

type Option interface {
	// contains filtered or unexported methods
}

func DangerouslyTolerateInsecureOrigins added in v0.9.0

func DangerouslyTolerateInsecureOrigins() Option

func DangerouslyTolerateSubdomainsOfPublicSuffixes added in v0.9.0

func DangerouslyTolerateSubdomainsOfPublicSuffixes() Option

func ExposeResponseHeaders

func ExposeResponseHeaders(one string, others ...string) Option

func FromOrigins

func FromOrigins(one string, others ...string) Option

func MaxAgeInSeconds

func MaxAgeInSeconds(delta uint) Option

func PreflightSuccessStatus

func PreflightSuccessStatus(status uint) Option

func PrivateNetworkAccess

func PrivateNetworkAccess() Option

func PrivateNetworkAccessInNoCORSModeOnly added in v0.9.0

func PrivateNetworkAccessInNoCORSModeOnly() Option

func WithAnyMethod

func WithAnyMethod() Option

func WithAnyRequestHeaders

func WithAnyRequestHeaders() Option

func WithMethods

func WithMethods(one string, others ...string) Option

func WithRequestHeaders

func WithRequestHeaders(one string, others ...string) Option

type OptionAnon

type OptionAnon interface {
	// contains filtered or unexported methods
}

func ExposeAllResponseHeaders

func ExposeAllResponseHeaders() OptionAnon

func FromAnyOrigin

func FromAnyOrigin() OptionAnon

type TempConfig

type TempConfig struct {
	PublicSuffixes                                []string
	InsecureOriginPatterns                        []string
	SingleNonWildcardOrigin                       string
	AllowedMethods                                util.Set[string]
	AllowedRequestHeaders                         util.Set[string]
	CustomPreflightSuccessStatus                  bool
	DangerouslyTolerateSubdomainsOfPublicSuffixes bool
	DangerouslyTolerateInsecureOrigins            bool
	FromOriginsCalled                             bool
	WithMethodsCalled                             bool
	WithRequestHeadersCalled                      bool
	MaxAgeInSecondsCalled                         bool
	ExposeResponseHeadersCalled                   bool
}

Directories

Path Synopsis
Package origin implements parsing of origins and origin patterns and provides data structures useful for representing a set of origins.
Package origin implements parsing of origins and origin patterns and provides data structures useful for representing a set of origins.
Package radix provides an implementation of a specialized radix tree.
Package radix provides an implementation of a specialized radix tree.
Package util provides a generic type representing a mathematical set, and convenience functions for generating error values for packages github.com/jub0bs/fcors and github.com/jub0bs/fcors/risky.
Package util provides a generic type representing a mathematical set, and convenience functions for generating error values for packages github.com/jub0bs/fcors and github.com/jub0bs/fcors/risky.

Jump to

Keyboard shortcuts

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