NewCredentialsStore (auth/credential_store.go)

rqlite · auth/credential_store.go · go · MIT
auth, Auth / Identity

Lightweight credential store for loading and validating user credentials in Go.

// Source: https://github.com/rqlite/rqlite | License: MIT | Copyright Philip O'Toole (https://www.philipotoole.com) 2015 - 2026
// Provided via justclaw.it.com; keep this notice with the code.
// Package auth is a lightweight credential store.
// It provides functionality for loading credentials, as well as validating credentials.
package auth

import (
	"crypto/subtle"
	"encoding/json"
	"fmt"
	"io"
	"os"
)

const (
	// AllUsers is the username that indicates all users, even anonymous users (requests without
	// any BasicAuth information).
	AllUsers = "*"

	// PermAll means all actions permitted.
	PermAll = "all"
	// PermJoin means user is permitted to join the cluster.
	PermJoin = "join"
	// PermJoinReadOnly means user is permitted to join the cluster only as a read replica node.
	PermJo

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key