proxy

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIProxy

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

APIProxy is the main server that handles API requests.

func NewAPIProxy

func NewAPIProxy(
	ctx context.Context,
	cfg *config.Config,
	schwabClient schwabapi.ProviderClient,
	tokenService auth.TokenServicer,
	clientService *auth.ClientService,
	store *storage.Store,
	otelProviders *observability.OTelProviders,
) (*APIProxy, error)

NewAPIProxy creates a new API proxy server.

func (*APIProxy) GetServer

func (p *APIProxy) GetServer() *auth.Server

GetServer returns the OAuth2 server.

func (*APIProxy) ServeHTTP

func (p *APIProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface.

func (*APIProxy) Shutdown

func (p *APIProxy) Shutdown(ctx context.Context)

Shutdown gracefully stops the background token refresh and streaming manager.

type ApprovalListItem

type ApprovalListItem struct {
	ID        string `json:"id"`
	ClientID  string `json:"client_id"`
	CreatedAt string `json:"created_at"`
}

ApprovalListItem represents a minimal approval item in the list response.

type ClientResponse

type ClientResponse struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	RedirectURI string   `json:"redirect_uri"`
	Scopes      []string `json:"scopes"`
	Active      bool     `json:"active"`
	CreatedAt   string   `json:"created_at"`
	UpdatedAt   string   `json:"updated_at"`
}

type ClientWithSecretResponse

type ClientWithSecretResponse struct {
	ClientResponse

	Secret string `json:"secret"`
}

type CreateClientRequest

type CreateClientRequest struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	RedirectURI string   `json:"redirect_uri"`
	Scopes      []string `json:"scopes"`
}

type ResponseData added in v0.2.0

type ResponseData struct {
	StatusCode int
	Headers    http.Header
	Body       []byte
}

ResponseData holds the necessary data from an HTTP response.

type UpdateClientRequest

type UpdateClientRequest struct {
	Name        *string   `json:"name,omitempty"`
	Description *string   `json:"description,omitempty"`
	RedirectURI *string   `json:"redirect_uri,omitempty"`
	Scopes      *[]string `json:"scopes,omitempty"`
	Active      *bool     `json:"active,omitempty"`
}

Jump to

Keyboard shortcuts

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