digestauth

package module
v0.0.0-...-201b852 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2018 License: MIT Imports: 6 Imported by: 0

README

digestauth

Build Status GoDoc

Minimal implementation of the HTTP Digest Access Authentication protocol.

See Godoc for usage example.

Documentation

Overview

Package digestauth is a minimal implementation of the HTTP digest access authentication protocol.

Basic example:

package main

import (
    "fmt"
    "github.com/cet001/digestauth"
)

client := digestauth.NewDigestAuthClient(nil)
response, err := client.Get("http://john:secret-passwd@example.com/some/resource")

Some major limitations:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcDigestAuth

func CalcDigestAuth(request *http.Request, realm, nonce, qop string) (string, error)

Calculates the digest authorization header value for the provided inputs. The URL within the provided http.Request object must contain the username and password credentials.

Types

type DigestAuthClient

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

DigestAuthClient is an HTTP client that implements a subset of the HTTP Digest Access Authentication protocol.

See:

func NewDigestAuthClient

func NewDigestAuthClient(client *http.Client) *DigestAuthClient

Creates a new DigestAuthClient that uses the provided http.Client object to send HTTP requests. If client is nil, a new http.Client is implicity created.

func (*DigestAuthClient) Get

func (me *DigestAuthClient) Get(url string) (*http.Response, error)

Jump to

Keyboard shortcuts

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