apikeys

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 7 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 apikeys checks the keys callers bring: a tenant's, or the one gitd's network address asks for without tenants. A key is read from its file — best a systemd credential — and kept hashed; replacing the file replaces the key, with no restart.

Index

Constants

View Source
const Header = "Authorization"

Header is where a caller brings its key: `Authorization: Bearer <key>`.

Variables

This section is empty.

Functions

func Of

func Of(request *http.Request) string

Of is the key a request brings, if any.

Types

type File

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

File is one key, read from a file and read again when the file changes.

func NewFile

func NewFile(path string) *File

NewFile returns the key in the file at path; it is read on first use.

func (*File) Matches

func (file *File) Matches(key string) bool

Matches says whether key is this one, in constant time. A file that cannot be read, or holds nothing, matches no key.

Jump to

Keyboard shortcuts

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