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 ¶
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.
Click to show internal directories.
Click to hide internal directories.