httpauth

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package auth provides functions for extracting a user Auth token from a request and associating it with a Context.

Index

Constants

View Source
const (
	BASIC_SCHEMA  string = "Basic "
	BEARER_SCHEMA string = "Bearer "
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	Schema() string
	Token() string
	Username() string
	Password() string
}

func Parse

func Parse(req *http.Request) (a Auth, err error)

type Basic

type Basic struct {
	// contains filtered or unexported fields
}

func (*Basic) Password

func (b *Basic) Password() string

func (*Basic) Schema

func (b *Basic) Schema() string

func (*Basic) Token

func (b *Basic) Token() string

func (*Basic) Username

func (b *Basic) Username() string

type Bearer

type Bearer struct {
	// contains filtered or unexported fields
}

func (*Bearer) Password

func (b *Bearer) Password() string

func (*Bearer) Schema

func (b *Bearer) Schema() string

func (*Bearer) Token

func (b *Bearer) Token() string

func (*Bearer) Username

func (b *Bearer) Username() string

Jump to

Keyboard shortcuts

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