bitwarden

package
v0.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	WardenHeaderAccessToken = "Warden-Access-Token"
	WardenHeaderStatePath   = "Warden-State-Path"
	WardenHeaderAPIURL      = "Warden-Api-Url"
	WardenHeaderIdentityURL = "Warden-Identity-Url"
)

Defined Header Keys.

Variables

View Source
var ContextClientKey contextKey = "warden-client"

Functions

func Login

func Login(req *LoginRequest) (sdk.BitwardenClientInterface, error)

Login creates a session for further Bitwarden requests. Note: I don't like returning the interface, but that's what the client returns.

func Warden

func Warden(next http.Handler) http.Handler

Warden is a middleware to use with the bitwarden API. Header used by the Warden: Warden-Access-Token: <token> Warden-State-Path: <state-path> Warden-Api-Url: <url> Warden-Identity-Url: <url> Put the client into the context and so if a context contains our client we know that calls are authenticated.

Types

type LoginRequest

type LoginRequest struct {
	*RequestBase `yaml:",inline,omitempty"`

	AccessToken string `yaml:"accessToken"`
	StatePath   string `yaml:"statePath,omitempty"`
}

LoginRequest defines bitwarden login details to Secrets Manager.

type RequestBase

type RequestBase struct {
	APIURL      string `yaml:"apiUrl,omitempty"`
	IdentityURL string `yaml:"identityUrl,omitempty"`
}

RequestBase contains optional API_URL and IDENTITY_URL values. If not defined, defaults are used always.

Jump to

Keyboard shortcuts

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