oauthtest

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package oauthtest provides mocking to test oauth package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenAdapter

type TokenAdapter struct {
	AccessToken  string
	ClientID     string
	ClientSecret string
	Scope        string
	CustomValues map[string][]string
}

A TokenAdapter is an implementation of TokenAdapter interface for testing purposes.

func NewTokenAdapter

func NewTokenAdapter() *TokenAdapter

NewTokenAdapter creates a new instance of TokenAdapter.

func (*TokenAdapter) FindClient

func (a *TokenAdapter) FindClient(c *oauth.TokenContext) *oauth.ClientEntry

FindClient gets the client information if valid.

func (*TokenAdapter) NewAccessToken

func (a *TokenAdapter) NewAccessToken(c *oauth.TokenContext) *oauth.TokenResponse

NewAccessToken creates and returns a new access token.

func (*TokenAdapter) ValidateRefresh

func (a *TokenAdapter) ValidateRefresh(*oauth.TokenContext) bool

ValidateRefresh validate provided refresh token.

func (*TokenAdapter) ValidateUser

func (a *TokenAdapter) ValidateUser(*oauth.TokenContext) bool

ValidateUser validate resource owner credentials for password grant type.

Jump to

Keyboard shortcuts

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