cookie

package
v0.0.0-...-2eb5408 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

View Source
const EncryptorPasswordLength = 32
View Source
const MaxCookieValueSize = 2048

MaxCookieValueSize We need to make sure that the final encrypted string is smaller than 4096, as this is the maximum cookie size for some browsers. The encryption that is used via securecookie performs a base64 encoding, which increases the original message size by a factor of 4/3. Additionally, it adds a HMAC authentication key of roughly 20 characters. Finally, the encryption process is a stream cipher, which should guarantee an encrypted output of the same size as the input (unless a block padding is added). If we are to split the original text at 2048, we should have sufficient room for encryption and the final result should be below 4096.

Variables

This section is empty.

Functions

func NewStore

func NewStore(encryptor Encryptor, logger gologger.Logger) session.Store

NewStore Creates new store

Types

type Encryptor

type Encryptor interface {
	Encrypt(cookie *http.Cookie) error
	Decrypt(cookie *http.Cookie) error
}

func NewEncryptor

func NewEncryptor(authenticationPassword, encryptionPassword []byte) Encryptor

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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