https

package
v0.0.0-...-cc7047c Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Overview

https provides secure convenience functions for basic auth via secure (TLS) web based communication (client/server) based on the password library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(req *http.Request, user string, pw *password.Password) bool

Compare takes a pointer to an http.Request and evalutes if the used credentials are identical to the given user and pw to successfully authorized the request.

func Request

func Request(client *http.Client, method, url string, body io.Reader, user string, pw *password.Password) (*http.Response, error)

Request allows you to call any HTTP ressource via HTTPS on any method with the given authorization values from user and pw.

Types

type Credentials

type Credentials []userpw

func New

func New(user string, pw *password.Password) *Credentials

func (*Credentials) Add

func (c *Credentials) Add(user string, pw *password.Password) error

func (*Credentials) Compare

func (c *Credentials) Compare(req *http.Request) bool

Compare a list of users.

func (*Credentials) Remove

func (c *Credentials) Remove(user string) error

Jump to

Keyboard shortcuts

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