package auth

import (
	"secondbit.org/uuid"
)

// Client represents a client that grants access
// to the auth server, exchanging grants for tokens,
// and tokens for access.
type Client struct {
	ID          uuid.ID
	Secret      string
	RedirectURI string
	OwnerID     uuid.ID
	Name        string
	Logo        string
	Website     string
}

// ClientStore abstracts the storage interface for
// storing and retrieving Clients.
type ClientStore interface {
	GetClient(id uuid.ID) (Client, error)
	SaveClient(client Client) error
	UpdateClient(id uuid.ID, secret, redirectURI *string, ownerID uuid.ID, name, logo, website *string) error
	DeleteClient(id uuid.ID) error
	ListClientsByOwner(ownerID uuid.ID, page, num int) ([]Client, error)
}
