test

package
v1.29.0-mobile.5 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: BSD-2-Clause Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAccessToken

func NewAccessToken() string

func NewRestrictedToken

func NewRestrictedToken() string

func NewServiceSecret

func NewServiceSecret() string

func NewSessionToken

func NewSessionToken() string

func RandomProviderName added in v1.29.0

func RandomProviderName() string

func RandomProviderNames added in v1.29.0

func RandomProviderNames() []string

func RandomProviderSessionID added in v1.29.0

func RandomProviderSessionID() string

func RandomProviderSessionIDs added in v1.29.0

func RandomProviderSessionIDs() []string

func RandomProviderType added in v1.29.0

func RandomProviderType() string

func RandomProviderTypes added in v1.29.0

func RandomProviderTypes() []string

func RandomRestrictedTokenID added in v1.29.0

func RandomRestrictedTokenID() string

func RandomRestrictedTokenIDs added in v1.29.0

func RandomRestrictedTokenIDs() []string

Types

type Client

func NewClient

func NewClient() *Client

func (*Client) AssertOutputsEmpty added in v1.29.0

func (c *Client) AssertOutputsEmpty()

type CreateUserProviderSessionInput

type CreateUserProviderSessionInput struct {
	Context context.Context
	UserID  string
	Create  *auth.ProviderSessionCreate
}

type CreateUserProviderSessionOutput

type CreateUserProviderSessionOutput struct {
	ProviderSession *auth.ProviderSession
	Error           error
}

type CreateUserRestrictedTokenInput

type CreateUserRestrictedTokenInput struct {
	Context context.Context
	UserID  string
	Create  *auth.RestrictedTokenCreate
}

type CreateUserRestrictedTokenOutput

type CreateUserRestrictedTokenOutput struct {
	RestrictedToken *auth.RestrictedToken
	Error           error
}

type DeleteProviderSessionInput

type DeleteProviderSessionInput struct {
	Context context.Context
	ID      string
}

type DeleteRestrictedTokenInput

type DeleteRestrictedTokenInput struct {
	Context context.Context
	ID      string
}

type EnsureAuthorizedUserInput added in v1.29.0

type EnsureAuthorizedUserInput struct {
	Context              context.Context
	TargetUserID         string
	AuthorizedPermission string
}

type EnsureAuthorizedUserOutput added in v1.29.0

type EnsureAuthorizedUserOutput struct {
	AuthorizedUserID string
	Error            error
}

type ExternalAccessor

type ExternalAccessor struct {
	ServerSessionTokenInvocations      int
	ServerSessionTokenStub             func() (string, error)
	ServerSessionTokenOutputs          []ServerSessionTokenOutput
	ServerSessionTokenOutput           *ServerSessionTokenOutput
	ValidateSessionTokenInvocations    int
	ValidateSessionTokenInputs         []ValidateSessionTokenInput
	ValidateSessionTokenStub           func(ctx context.Context, token string) (request.Details, error)
	ValidateSessionTokenOutputs        []ValidateSessionTokenOutput
	ValidateSessionTokenOutput         *ValidateSessionTokenOutput
	EnsureAuthorizedInvocations        int
	EnsureAuthorizedInputs             []context.Context
	EnsureAuthorizedStub               func(ctx context.Context) error
	EnsureAuthorizedOutputs            []error
	EnsureAuthorizedOutput             *error
	EnsureAuthorizedServiceInvocations int
	EnsureAuthorizedServiceInputs      []context.Context
	EnsureAuthorizedServiceStub        func(ctx context.Context) error
	EnsureAuthorizedServiceOutputs     []error
	EnsureAuthorizedServiceOutput      *error
	EnsureAuthorizedUserInvocations    int
	EnsureAuthorizedUserInputs         []EnsureAuthorizedUserInput
	EnsureAuthorizedUserStub           func(ctx context.Context, targetUserID string, authorizedPermission string) (string, error)
	EnsureAuthorizedUserOutputs        []EnsureAuthorizedUserOutput
	EnsureAuthorizedUserOutput         *EnsureAuthorizedUserOutput
}

func NewExternalAccessor

func NewExternalAccessor() *ExternalAccessor

func (*ExternalAccessor) AssertOutputsEmpty added in v1.29.0

func (e *ExternalAccessor) AssertOutputsEmpty()

func (*ExternalAccessor) EnsureAuthorized added in v1.29.0

func (e *ExternalAccessor) EnsureAuthorized(ctx context.Context) error

func (*ExternalAccessor) EnsureAuthorizedService added in v1.29.0

func (e *ExternalAccessor) EnsureAuthorizedService(ctx context.Context) error

func (*ExternalAccessor) EnsureAuthorizedUser added in v1.29.0

func (e *ExternalAccessor) EnsureAuthorizedUser(ctx context.Context, targetUserID string, authorizedPermission string) (string, error)

func (*ExternalAccessor) ServerSessionToken

func (e *ExternalAccessor) ServerSessionToken() (string, error)

func (*ExternalAccessor) ValidateSessionToken

func (e *ExternalAccessor) ValidateSessionToken(ctx context.Context, token string) (request.Details, error)

type GetProviderSessionInput

type GetProviderSessionInput struct {
	Context context.Context
	ID      string
}

type GetProviderSessionOutput

type GetProviderSessionOutput struct {
	ProviderSession *auth.ProviderSession
	Error           error
}

type GetRestrictedTokenInput

type GetRestrictedTokenInput struct {
	Context context.Context
	ID      string
}

type GetRestrictedTokenOutput

type GetRestrictedTokenOutput struct {
	RestrictedToken *auth.RestrictedToken
	Error           error
}

type ListUserProviderSessionsInput

type ListUserProviderSessionsInput struct {
	Context    context.Context
	UserID     string
	Filter     *auth.ProviderSessionFilter
	Pagination *page.Pagination
}

type ListUserProviderSessionsOutput

type ListUserProviderSessionsOutput struct {
	ProviderSessions auth.ProviderSessions
	Error            error
}

type ListUserRestrictedTokensInput

type ListUserRestrictedTokensInput struct {
	Context    context.Context
	UserID     string
	Filter     *auth.RestrictedTokenFilter
	Pagination *page.Pagination
}

type ListUserRestrictedTokensOutput

type ListUserRestrictedTokensOutput struct {
	RestrictedTokens auth.RestrictedTokens
	Error            error
}

type ProviderSessionAccessor

type ProviderSessionAccessor struct {
	*test.Mock
	ListUserProviderSessionsInvocations  int
	ListUserProviderSessionsInputs       []ListUserProviderSessionsInput
	ListUserProviderSessionsOutputs      []ListUserProviderSessionsOutput
	CreateUserProviderSessionInvocations int
	CreateUserProviderSessionInputs      []CreateUserProviderSessionInput
	CreateUserProviderSessionOutputs     []CreateUserProviderSessionOutput
	GetProviderSessionInvocations        int
	GetProviderSessionInputs             []GetProviderSessionInput
	GetProviderSessionOutputs            []GetProviderSessionOutput
	UpdateProviderSessionInvocations     int
	UpdateProviderSessionInputs          []UpdateProviderSessionInput
	UpdateProviderSessionOutputs         []UpdateProviderSessionOutput
	DeleteProviderSessionInvocations     int
	DeleteProviderSessionInputs          []DeleteProviderSessionInput
	DeleteProviderSessionOutputs         []error
}

func NewProviderSessionAccessor

func NewProviderSessionAccessor() *ProviderSessionAccessor

func (*ProviderSessionAccessor) CreateUserProviderSession

func (p *ProviderSessionAccessor) CreateUserProviderSession(ctx context.Context, userID string, create *auth.ProviderSessionCreate) (*auth.ProviderSession, error)

func (*ProviderSessionAccessor) DeleteProviderSession

func (p *ProviderSessionAccessor) DeleteProviderSession(ctx context.Context, id string) error

func (*ProviderSessionAccessor) Expectations

func (p *ProviderSessionAccessor) Expectations()

func (*ProviderSessionAccessor) GetProviderSession

func (p *ProviderSessionAccessor) GetProviderSession(ctx context.Context, id string) (*auth.ProviderSession, error)

func (*ProviderSessionAccessor) ListUserProviderSessions

func (p *ProviderSessionAccessor) ListUserProviderSessions(ctx context.Context, userID string, filter *auth.ProviderSessionFilter, pagination *page.Pagination) (auth.ProviderSessions, error)

func (*ProviderSessionAccessor) UpdateProviderSession

func (p *ProviderSessionAccessor) UpdateProviderSession(ctx context.Context, id string, update *auth.ProviderSessionUpdate) (*auth.ProviderSession, error)

type RestrictedTokenAccessor

type RestrictedTokenAccessor struct {
	*test.Mock
	ListUserRestrictedTokensInvocations  int
	ListUserRestrictedTokensInputs       []ListUserRestrictedTokensInput
	ListUserRestrictedTokensOutputs      []ListUserRestrictedTokensOutput
	CreateUserRestrictedTokenInvocations int
	CreateUserRestrictedTokenInputs      []CreateUserRestrictedTokenInput
	CreateUserRestrictedTokenOutputs     []CreateUserRestrictedTokenOutput
	GetRestrictedTokenInvocations        int
	GetRestrictedTokenInputs             []GetRestrictedTokenInput
	GetRestrictedTokenOutputs            []GetRestrictedTokenOutput
	UpdateRestrictedTokenInvocations     int
	UpdateRestrictedTokenInputs          []UpdateRestrictedTokenInput
	UpdateRestrictedTokenOutputs         []UpdateRestrictedTokenOutput
	DeleteRestrictedTokenInvocations     int
	DeleteRestrictedTokenInputs          []DeleteRestrictedTokenInput
	DeleteRestrictedTokenOutputs         []error
}

func NewRestrictedTokenAccessor

func NewRestrictedTokenAccessor() *RestrictedTokenAccessor

func (*RestrictedTokenAccessor) CreateUserRestrictedToken

func (r *RestrictedTokenAccessor) CreateUserRestrictedToken(ctx context.Context, userID string, create *auth.RestrictedTokenCreate) (*auth.RestrictedToken, error)

func (*RestrictedTokenAccessor) DeleteRestrictedToken

func (r *RestrictedTokenAccessor) DeleteRestrictedToken(ctx context.Context, id string) error

func (*RestrictedTokenAccessor) Expectations

func (r *RestrictedTokenAccessor) Expectations()

func (*RestrictedTokenAccessor) GetRestrictedToken

func (r *RestrictedTokenAccessor) GetRestrictedToken(ctx context.Context, id string) (*auth.RestrictedToken, error)

func (*RestrictedTokenAccessor) ListUserRestrictedTokens

func (r *RestrictedTokenAccessor) ListUserRestrictedTokens(ctx context.Context, userID string, filter *auth.RestrictedTokenFilter, pagination *page.Pagination) (auth.RestrictedTokens, error)

func (*RestrictedTokenAccessor) UpdateRestrictedToken

func (r *RestrictedTokenAccessor) UpdateRestrictedToken(ctx context.Context, id string, update *auth.RestrictedTokenUpdate) (*auth.RestrictedToken, error)

type ServerSessionTokenOutput

type ServerSessionTokenOutput struct {
	Token string
	Error error
}

type UpdateProviderSessionInput

type UpdateProviderSessionInput struct {
	Context context.Context
	ID      string
	Update  *auth.ProviderSessionUpdate
}

type UpdateProviderSessionOutput

type UpdateProviderSessionOutput struct {
	ProviderSession *auth.ProviderSession
	Error           error
}

type UpdateRestrictedTokenInput

type UpdateRestrictedTokenInput struct {
	Context context.Context
	ID      string
	Update  *auth.RestrictedTokenUpdate
}

type UpdateRestrictedTokenOutput

type UpdateRestrictedTokenOutput struct {
	RestrictedToken *auth.RestrictedToken
	Error           error
}

type ValidateSessionTokenInput

type ValidateSessionTokenInput struct {
	Context context.Context
	Token   string
}

type ValidateSessionTokenOutput

type ValidateSessionTokenOutput struct {
	Details request.Details
	Error   error
}

Jump to

Keyboard shortcuts

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