credential

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 2 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 credential extracts a credential from an HTTP request for the authenticators of auth and auth/jwtauth: from a header after an optional scheme prefix, a query parameter or a cookie.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromCookie

func FromCookie(r *http.Request, cookie string) (string, bool)

FromCookie returns the trimmed value of the cookie named cookie, when it is not empty; an empty name finds nothing.

func FromHeader

func FromHeader(r *http.Request, header, prefix string) (string, bool)

FromHeader returns the first value of header that carries a credential after prefix: the prefix matches case-insensitively and must be followed by a space or tab, every value of a repeated header is tried, and surrounding whitespace is trimmed. An empty prefix takes the whole trimmed value; an empty header name finds nothing.

func FromQuery

func FromQuery(r *http.Request, query string) (string, bool)

FromQuery returns the trimmed value of the query parameter query, when it is not empty; an empty name finds nothing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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