oauthclients

package
v0.0.0-...-059fb3b Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebAppClientID = "web"
)

Variables

View Source
var ClientIDRegexp = regexp.MustCompile("^[0-9a-zA-Z-]+$")
View Source
var ErrClientIDTaken = errors.New("clientID already exists")
View Source
var ExampleAliceClient = Client{
	// contains filtered or unexported fields
}
View Source
var ExampleBobClient = Client{
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type Client

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

Client client model

func (*Client) GetDomain

func (c *Client) GetDomain() string

func (*Client) GetID

func (c *Client) GetID() string

func (*Client) GetSecret

func (c *Client) GetSecret() string

func (*Client) GetUserID

func (c *Client) GetUserID() string

func (*Client) IsPublic

func (c *Client) IsPublic() bool

func (*Client) Name

func (c *Client) Name() string

func (*Client) RedirectURI

func (c *Client) RedirectURI() string

func (*Client) SkipValidation

func (c *Client) SkipValidation() bool

type CreateCmd

type CreateCmd struct {
	ID             uuid.UUID
	Name           string
	RedirectURI    string
	UserID         uuid.UUID
	Scopes         Scopes
	Public         bool
	SkipValidation bool
}

func (CreateCmd) Validate

func (cmd CreateCmd) Validate() error

Validate the fields.

type FakeClientBuilder

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

func NewFakeClient

func NewFakeClient(t testing.TB) *FakeClientBuilder

func (*FakeClientBuilder) Build

func (f *FakeClientBuilder) Build() *Client

func (*FakeClientBuilder) BuildAndStore

func (f *FakeClientBuilder) BuildAndStore(ctx context.Context, db *sql.DB) *Client

func (*FakeClientBuilder) CreatedBy

func (f *FakeClientBuilder) CreatedBy(user *users.User) *FakeClientBuilder

func (*FakeClientBuilder) SkipValidation

func (f *FakeClientBuilder) SkipValidation() *FakeClientBuilder

type MockService

type MockService struct {
	mock.Mock
}

MockService is an autogenerated mock type for the Service type

func NewMockService

func NewMockService(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockService

NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockService) Create

func (_m *MockService) Create(ctx context.Context, cmd *CreateCmd) (*Client, error)

Create provides a mock function with given fields: ctx, cmd

func (*MockService) GetByID

func (_m *MockService) GetByID(ctx context.Context, clientID uuid.UUID) (*Client, error)

GetByID provides a mock function with given fields: ctx, clientID

type Scopes

type Scopes []string

func (*Scopes) Scan

func (t *Scopes) Scan(src any) error

func (Scopes) String

func (t Scopes) String() string

func (Scopes) Value

func (t Scopes) Value() (driver.Value, error)

type Service

type Service interface {
	Create(ctx context.Context, cmd *CreateCmd) (*Client, error)
	GetByID(ctx context.Context, clientID uuid.UUID) (*Client, error)
}

func Init

func Init(tools tools.Tools, db *sql.DB) Service

Jump to

Keyboard shortcuts

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