token

package
v0.0.0-...-98a7958 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package token enables setting and reading authentication token contexts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, token Token) context.Context

NewContext returns a new context carrying the Authorization Bearer token.

Types

type Token

type Token string

Token is the concrete type which represents kolide session tokens

func FromContext

func FromContext(ctx context.Context) (Token, bool)

FromContext extracts the Authorization Bearer token if present.

func FromHTTPRequest

func FromHTTPRequest(r *http.Request) Token

FromHTTPRequest extracts an Authorization from an HTTP header if present.

Jump to

Keyboard shortcuts

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