Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec struct {
// contains filtered or unexported fields
}
Codec provides a means of encoding and decoding values to URL-friendly opaque tokens that clients cannot tamper with. It encodes values using encoding/gob before encrypting them, and uses base64 URL encoding for serializing the encrypted bytes to the token string. It's implemented as a thin wrapper around gorilla/securecookie, which already provides the necessary functionality.
TODO: securecookie redundantly applies two iterations of base64 encoding, increasing the output size (see https://github.com/gorilla/securecookie/issues/36). Since there's not that much code, we should consider modifying/implementing the encoding directly in this package.