app

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound  = errors.New("not found")
	ErrForbidden = errors.New("forbidden")
)

Functions

This section is empty.

Types

type OIDCTokens added in v0.17.10

type OIDCTokens struct {
	IDToken     string
	AccessToken string
}

type OptOptionsSetter

type OptOptionsSetter func(o *Options)

type Options

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

func NewOptions

func NewOptions(
	logger *slog.Logger,
	targets []config.Target,
	users config.UsersProviderOIDC,
	authorizer policy.Authorizer,
	storage *storage.Service,
	options ...OptOptionsSetter,
) Options

func (*Options) Validate

func (o *Options) Validate() error

type QueryResults added in v0.13.0

type QueryResults struct {
	ID        string
	UserID    string
	TargetID  string
	CreatedAt time.Time
	Query     string
	QTable    structs.QTable
	Meta      structs.QMeta
}

type Service

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

func New

func New(opts Options) (*Service, error)

func (*Service) AddBookmark added in v0.17.1

func (s *Service) AddBookmark(
	ctx context.Context,
	user structs.User,
	targetID config.TargetID,
	title string,
	query string,
) error

func (*Service) AuthByAccessToken added in v0.17.14

func (s *Service) AuthByAccessToken(ctx context.Context, token string) (*structs.User, error)

func (*Service) BuildOIDCLogoutURL added in v0.17.10

func (s *Service) BuildOIDCLogoutURL(idTokenHint, postLogoutRedirectURL string) (string, error)

func (*Service) CompleteOIDC added in v0.9.0

func (s *Service) CompleteOIDC(
	ctx context.Context,
	code, expectedState, receivedState string,
) (*structs.User, time.Time, *OIDCTokens, error)

func (*Service) DeleteBookmark added in v0.17.1

func (s *Service) DeleteBookmark(ctx context.Context, uid config.UserID, bookmarkID uuid6.UUID) error

func (*Service) GetQueryResults added in v0.13.0

func (s *Service) GetQueryResults(ctx context.Context, user structs.User, qid uuid6.UUID) (*QueryResults, error)

func (*Service) GetTargetByID

func (s *Service) GetTargetByID(ctx context.Context, user structs.User, tID config.TargetID) (*structs.Server, error)

func (*Service) GetTargets

func (s *Service) GetTargets(_ context.Context, user structs.User) ([]structs.Server, error)

GetTargets return targets that available for this user.

func (*Service) InitOIDC added in v0.9.0

func (s *Service) InitOIDC(_ context.Context) (string, string, error)

func (*Service) ListAdminRequests added in v0.17.11

func (s *Service) ListAdminRequests(
	ctx context.Context,
	user structs.User,
	page, pageSize int64,
) ([]structs.AdminRequest, bool, error)

func (*Service) ListAllBookmarks added in v0.17.1

func (s *Service) ListAllBookmarks(ctx context.Context, uid config.UserID) ([]structs.Bookmark, error)

func (*Service) ListBookmarks added in v0.17.1

func (s *Service) ListBookmarks(ctx context.Context, user structs.User, targetID config.TargetID) ([]structs.Bookmark, error)

func (*Service) ListRecentQueries added in v0.17.3

func (s *Service) ListRecentQueries(ctx context.Context, uid config.UserID, limit int64) ([]structs.Query, error)

func (*Service) RevokeOIDCToken added in v0.17.10

func (s *Service) RevokeOIDCToken(ctx context.Context, token string) error

func (*Service) RunQuery

func (s *Service) RunQuery(
	ctx context.Context,
	user structs.User,
	srvID config.TargetID,
	query string,
) (uuid6.UUID, *structs.QTable, error)

Jump to

Keyboard shortcuts

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