client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 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 {
	ID                      string                 `json:"id"`
	Name                    string                 `json:"name"`
	RedirectURIs            []string               `json:"redirect_uris"`
	GrantTypes              []string               `json:"grant_types"`
	ResponseTypes           []string               `json:"response_types"`
	Scopes                  []string               `json:"scopes"`
	Audience                []string               `json:"audience"`
	Public                  bool                   `json:"public"`
	TokenEndpointAuthMethod string                 `json:"token_endpoint_auth_method"`
	Metadata                map[string]interface{} `json:"metadata"`
	CreatedAt               time.Time              `json:"created_at"`
	UpdatedAt               time.Time              `json:"updated_at"`
}

type CreateClientRequest

type CreateClientRequest struct {
	Name                    string                 `json:"name" validate:"required"`
	RedirectURIs            []string               `json:"redirect_uris"`
	GrantTypes              []string               `json:"grant_types"`
	ResponseTypes           []string               `json:"response_types"`
	Scopes                  []string               `json:"scopes"`
	Audience                []string               `json:"audience"`
	Public                  bool                   `json:"public"`
	TokenEndpointAuthMethod string                 `json:"token_endpoint_auth_method"`
	Metadata                map[string]interface{} `json:"metadata"`
}

type CreateClientResponse

type CreateClientResponse struct {
	Client
	Secret string `json:"client_secret"`
}

type Handler

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

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) Create

func (h *Handler) Create(w http.ResponseWriter, r *http.Request)

func (*Handler) Delete

func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)

func (*Handler) Get

func (h *Handler) Get(w http.ResponseWriter, r *http.Request)

func (*Handler) List

func (h *Handler) List(w http.ResponseWriter, r *http.Request)

func (*Handler) RotateSecret

func (h *Handler) RotateSecret(w http.ResponseWriter, r *http.Request)

func (*Handler) Routes

func (h *Handler) Routes() chi.Router

type Service

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

func NewService

func NewService(pool *pgxpool.Pool) *Service

func (*Service) Create

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id string) error

func (*Service) GetByID

func (s *Service) GetByID(ctx context.Context, id string) (*Client, error)

func (*Service) List

func (s *Service) List(ctx context.Context, limit, offset int) ([]Client, int64, error)

func (*Service) RotateSecret

func (s *Service) RotateSecret(ctx context.Context, id string) (string, error)

type UpdateClientRequest

type UpdateClientRequest struct {
	Name                    *string                `json:"name"`
	RedirectURIs            []string               `json:"redirect_uris"`
	GrantTypes              []string               `json:"grant_types"`
	Scopes                  []string               `json:"scopes"`
	TokenEndpointAuthMethod *string                `json:"token_endpoint_auth_method"`
	Metadata                map[string]interface{} `json:"metadata"`
}

Jump to

Keyboard shortcuts

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