signer

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package signer contains signing helpers used to compute the CouchDB proxy authentication token.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

Signer computes deterministic HMAC tags using a static secret. It is used to produce CouchDB proxy authentication tokens for securing the communication between the proxy and CouchDB.

func New

func New(cfg config.Signer) *Signer

New returns a new Signer that derives its HMAC key from the given secret. If the secret is empty, nil will be returned.

func (*Signer) Sign

func (s *Signer) Sign(user string) string

Sign returns the lowercase hex-encoded HMAC-SHA256 of the provided user name using the underlying secret key. The output is deterministic for the same input and key.

Jump to

Keyboard shortcuts

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