server: github.com/katzenpost/server/userdb Index | Files | Directories

package userdb

import "github.com/katzenpost/server/userdb"

Package userdb defines the Katzenpost server user database abstract interface.

Index

Package Files

userdb.go

Constants

const MaxUsernameSize = constants.RecipientIDLength

MaxUsernameSize is the maximum username length in bytes.

Variables

var (
    // ErrNoSuchUser is the error returned when an operation fails due to
    // a non-existent user.
    ErrNoSuchUser = errors.New("userdb: no such user")

    // ErrNoIdentity is the error returned when the specified user has no
    // identity key set.
    ErrNoIdentity = errors.New("userdb: no identity key set")
)

type UserDB Uses

type UserDB interface {
    // Exists returns true iff the user identified by the username exists.
    Exists([]byte) bool

    // IsValid returns true iff the user identified by the username and
    // public key is valid.
    IsValid([]byte, *ecdh.PublicKey) bool

    // Link returns the user's link layer authentication key.
    Link([]byte) (*ecdh.PublicKey, error)

    // Add adds the user identified by the username and public key
    // to the database.  Existing users will have their public keys
    // updated if specified, otherwise an error will be returned.
    Add([]byte, *ecdh.PublicKey, bool) error

    // SetIdentity sets the optional identity key for the user identified
    // by the user name to the provided public key.  Providing a nil key
    // will remove the user's identity key iff it exists.
    SetIdentity([]byte, *ecdh.PublicKey) error

    // Identity returns the optional identity key for the user identified
    // by the user name.
    Identity([]byte) (*ecdh.PublicKey, error)

    // Remove removes the user identified by the username from the database.
    Remove([]byte) error

    // Close closes the UserDB instance.
    Close()
}

UserDB is the interface provided by all user database implementations.

Directories

PathSynopsis
boltuserdbPackage boltuserdb implements the Katzenpost server user database with a simple boltdb based backend.
externuserdbPackage externuserdb implements the Katzenpost server user database with http calls to a external authorization source (expected to run in localhost).

Package userdb imports 3 packages (graph) and is imported by 8 packages. Updated 2018-10-28. Refresh now. Tools for package owners.