silly

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package silly provides a simple authentication scheme that checks for the existence of an Authorization header and issues access if is present and non-empty.

This package is present as an example implementation of a minimal auth.AccessController and for testing. This is not suitable for any kind of production security.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNew

func MustNew(realm string, service string) auth.AccessController

func New

func New(realm string, service string) (auth.AccessController, error)

Types

type AccessController

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

AccessController provides a simple implementation of auth.AccessController that simply checks for a non-empty Authorization header. It is useful for demonstration and testing.

func (*AccessController) Authorized

func (ac *AccessController) Authorized(req *http.Request, accessRecords ...auth.Access) (*auth.Grant, error)

Authorized simply checks for the existence of the authorization header, responding with a bearer challenge if it doesn't exist.

Jump to

Keyboard shortcuts

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