agentkey

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package agentkey generates and hashes agent keys — the `dgk_…` tokens an agent presents to the gateway to authenticate as a user. Only the sha256 hash is ever stored; the plaintext is shown to the operator exactly once at creation and is otherwise unrecoverable.

Index

Constants

View Source
const Prefix = "dgk_"

Prefix is the human-recognizable scheme prefix of every agent key.

Variables

This section is empty.

Functions

func Hash

func Hash(token string) []byte

Hash returns the sha256 of a token, for storage and lookup.

func New

func New() (full string, hash []byte, prefix string)

New returns a fresh key: the full token (shown once), its sha256 hash (stored), and a short display prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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