testauth

package
v0.0.0-...-11149d6 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package testauth provides a mock implementation of auth.Auth for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockAuth

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

MockAuth auth.Auth の mock 実装。

func New

func New(sessionID string) *MockAuth

New 新しい MockAuth を生成して返す。 MockAuth が生成するセッション ID は常に sessionID の値となる。

func (*MockAuth) NewSessionToken

func (s *MockAuth) NewSessionToken(
	clientType session.ClientType,
	clientID string,
	now time.Time,
) (string, string, error)

NewSessionToken セッション ID とトークン文字列を生成する。 セッション ID は常に固定となる。

func (*MockAuth) ParseToken

func (s *MockAuth) ParseToken(tokenString string, now time.Time) (*session.Session, error)

ParseToken トークン文字列をパースしてセッション情報を返す。

Jump to

Keyboard shortcuts

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