https

package
v0.0.0-...-d6179ee Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

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 []User

func (Credentials) Compare

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

Compare a list of users.

type User

type User struct {
	Name string
	Pass *password.Password
}

Jump to

Keyboard shortcuts

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