cookie

package
v1.0.35 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Domains            map[string]*DomainConfig `json:"domains,omitempty" xml:"domains,omitempty" yaml:"domains,omitempty"`
	Path               string                   `json:"path,omitempty" xml:"path,omitempty" yaml:"path,omitempty"`
	Lifetime           int                      `json:"lifetime,omitempty" xml:"lifetime,omitempty" yaml:"lifetime,omitempty"`
	Insecure           bool                     `json:"insecure,omitempty" xml:"insecure,omitempty" yaml:"insecure,omitempty"`
	SameSite           string                   `json:"same_site,omitempty" xml:"same_site,omitempty" yaml:"same_site,omitempty"`
	StripDomainEnabled bool                     `json:"strip_domain_enabled,omitempty" xml:"strip_domain_enabled,omitempty" yaml:"strip_domain_enabled,omitempty"`
}

Config represents a common set of configuration settings applicable to the cookies issued by authn.Authenticator.

type DomainConfig

type DomainConfig struct {
	Seq                int    `json:"seq,omitempty" xml:"seq,omitempty" yaml:"seq,omitempty"`
	Domain             string `json:"domain,omitempty" xml:"domain,omitempty" yaml:"domain,omitempty"`
	Path               string `json:"path,omitempty" xml:"path,omitempty" yaml:"path,omitempty"`
	Lifetime           int    `json:"lifetime,omitempty" xml:"lifetime,omitempty" yaml:"lifetime,omitempty"`
	Insecure           bool   `json:"insecure,omitempty" xml:"insecure,omitempty" yaml:"insecure,omitempty"`
	SameSite           string `json:"same_site,omitempty" xml:"same_site,omitempty" yaml:"same_site,omitempty"`
	StripDomainEnabled bool   `json:"strip_domain_enabled,omitempty" xml:"strip_domain_enabled,omitempty" yaml:"strip_domain_enabled,omitempty"`
}

DomainConfig represents a common set of configuration settings applicable to the cookies issued by authn.Authenticator.

type Factory

type Factory struct {
	Referer   string `json:"referer,omitempty" xml:"referer,omitempty" yaml:"referer,omitempty"`
	SessionID string `json:"session_id,omitempty" xml:"session_id,omitempty" yaml:"session_id,omitempty"`
	SandboxID string `json:"sandbox_id,omitempty" xml:"sandbox_id,omitempty" yaml:"sandbox_id,omitempty"`
	// contains filtered or unexported fields
}

Factory holds configuration and associated finctions for the cookies issued by authn.Authenticator.

func NewFactory

func NewFactory(c *Config) (*Factory, error)

NewFactory returns an instance of cookie factory.

func (*Factory) GetCookie

func (f *Factory) GetCookie(h, k, v string) string

GetCookie returns raw cookie string from key-value input.

func (*Factory) GetDeleteCookie

func (f *Factory) GetDeleteCookie(h, s string) string

GetDeleteCookie returns raw cookie with attributes for delete action.

func (*Factory) GetDeleteIdentityTokenCookie

func (f *Factory) GetDeleteIdentityTokenCookie(s string) string

GetDeleteIdentityTokenCookie returns raw identity token cookie with attributes for delete action.

func (*Factory) GetDeleteSessionCookie

func (f *Factory) GetDeleteSessionCookie(h string) string

GetDeleteSessionCookie returns raw cookie with attributes for delete action for session id cookie.

func (*Factory) GetIdentityTokenCookie

func (f *Factory) GetIdentityTokenCookie(k, v string) string

GetIdentityTokenCookie returns raw identity token cookie string from key-value input.

func (*Factory) GetSessionCookie

func (f *Factory) GetSessionCookie(h, s string) string

GetSessionCookie return cookie holding session information

Jump to

Keyboard shortcuts

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