mockusso

package
v1.0.0-alpha4 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2018 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler is a http.Handler that provides a mock implementation of Ubuntu SSO. It is designed to closely match the responses provided by Ubuntu SSO providing openid login and oauth verification.

func New

func New(location string) *Handler

func (*Handler) AddUser

func (h *Handler) AddUser(u *User)

AddUser adds u to the handles user database.

func (*Handler) ExcludeExtensions

func (h *Handler) ExcludeExtensions()

ExcludeExtensions prevents an OpenID login response from including any extensions.

func (*Handler) Login

Login handles OpenID login requests.

func (*Handler) Reset

func (h *Handler) Reset()

Reset sets all of the state in the Handler back to the default. This should be called between tests.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Handler) SetLoginUser

func (h *Handler) SetLoginUser(user string)

SetLoginUser sets the user that is logged in when an OpenID request is recieved.

type Suite

type Suite struct {
	MockUSSO *Handler
	// contains filtered or unexported fields
}

func (*Suite) SetUpSuite

func (s *Suite) SetUpSuite(c *gc.C)

func (*Suite) SetUpTest

func (s *Suite) SetUpTest(c *gc.C)

func (*Suite) TearDownSuite

func (s *Suite) TearDownSuite(c *gc.C)

func (*Suite) TearDownTest

func (s *Suite) TearDownTest(c *gc.C)

type User

type User struct {
	ID       string
	NickName string
	FullName string
	Email    string
	Groups   []string

	// OAuth Credentials
	ConsumerSecret string
	TokenKey       string
	TokenSecret    string
}

Jump to

Keyboard shortcuts

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