keycloak

package
v0.0.0-...-46e61fc Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.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 Client

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

func (*Client) Authenticate

func (c *Client) Authenticate(username, password string) (*gocloak.JWT, error)

func (*Client) GetAccountIDByJWTToken

func (c *Client) GetAccountIDByJWTToken(token string) (uuid.UUID, error)

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(accessToken string) (*gocloak.UserInfo, error)

func (*Client) IsActiveToken

func (c *Client) IsActiveToken(token string) (bool, error)

type GoCloakMock

type GoCloakMock struct {
	mock.Mock
	gocloak.GoCloak
}

func (*GoCloakMock) GetUserInfo

func (m *GoCloakMock) GetUserInfo(_ context.Context, _, _ string) (*gocloak.UserInfo, error)

func (*GoCloakMock) LoginOtp

func (m *GoCloakMock) LoginOtp(_ context.Context, _, _, _, _, _, _ string) (*gocloak.JWT, error)

func (*GoCloakMock) RetrospectToken

func (m *GoCloakMock) RetrospectToken(_ context.Context, _, _, _, _ string) (*gocloak.RetrospecTokenResult, error)

type IClient

type IClient interface {
	Authenticate(username, password string) (*gocloak.JWT, error)
	IsActiveToken(token string) (bool, error)
	GetAccountIDByJWTToken(token string) (uuid.UUID, error)
	GetUserInfo(accessToken string) (*gocloak.UserInfo, error)
}

func NewKeycloakClient

func NewKeycloakClient() IClient

type Mock

type Mock struct {
	mock.Mock
}

func (*Mock) Authenticate

func (m *Mock) Authenticate(_, _ string) (*gocloak.JWT, error)

func (*Mock) GetAccountIDByJWTToken

func (m *Mock) GetAccountIDByJWTToken(_ string) (uuid.UUID, error)

func (*Mock) GetUserInfo

func (m *Mock) GetUserInfo(_ string) (*gocloak.UserInfo, error)

func (*Mock) IsActiveToken

func (m *Mock) IsActiveToken(_ string) (bool, error)

Jump to

Keyboard shortcuts

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