client

package
v0.0.0-...-6d95401 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package client implements a client for the turtleauth protocol

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizedHandler

func AuthorizedHandler(perm *AuthServer, handler http.Handler, permission turtleauth.PermissionClass, errorHandler http.Handler) http.Handler

AuthorizedHandler creates an http.Handler that checks for a permission before granting access

Types

type AuthServer

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

AuthServer is an authentication server

func NewAuthServer

func NewAuthServer(addr *url.URL) *AuthServer

NewAuthServer returns an AuthServer at the specified address

func (*AuthServer) AuthReq

AuthReq checks authorization of a request

func (*AuthServer) AuthUser

func (a *AuthServer) AuthUser(p turtleauth.PermissionClass, c http.Cookie) (bool, error)

AuthUser checks user authorization

func (*AuthServer) GetInfo

func (a *AuthServer) GetInfo(c http.Cookie) (map[string]string, error)

GetInfo returns user info

func (*AuthServer) Ping

func (a *AuthServer) Ping() error

Ping tries to see if the server is up

Jump to

Keyboard shortcuts

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