pagepass

package
v0.2.0-dev.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pagepass is the password of a user's page and the cookie that remembers it. Both are computed, never stored: HMAC-SHA256 under a key the panel derives from its master key (vault.Derive(KeyLabel)), over the user's current subscription token. A new link (a rotated token) is therefore a new password and the old cookies stop working; nothing is added to the database.

The password only keeps the page and its self-service calls from whoever happens to hold the link; the subscription itself, which apps fetch from the same address, never asks for it.

Index

Constants

View Source
const KeyLabel = "sub-page-password"

KeyLabel is the vault.Derive label of the key every function here takes.

Variables

This section is empty.

Functions

func Check

func Check(key []byte, token, typed string) bool

Check reports whether typed is the password of the token (constant time).

func CheckCookie

func CheckCookie(key []byte, token, value string) bool

CheckCookie reports whether a cookie value belongs to the token (constant time).

func Cookie(key []byte, token string) string

Cookie is the value of the cookie that remembers an entered password: an HMAC over the token, so the server keeps no state, and under another purpose than the password, so it does not reveal it.

func Password

func Password(key []byte, token string) string

Password is the page password of a token as it is shown and typed: "xxxx-xxxx".

Types

This section is empty.

Jump to

Keyboard shortcuts

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