dsclient

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package dsclient defines the unified Data Storage client interface, composing the per-concern interfaces currently scattered across pkg/audit and pkg/authwebhook.

RF-3 (v1.1): This package is the target for consolidation. Today it serves as documentation of the intended unified interface. In v1.1, both pkg/audit.OpenAPIClientAdapter and pkg/authwebhook.DSClientAdapter will be replaced by a single adapter implementing this interface.

Current adapters wrapping *ogenclient.Client:

  • pkg/audit.OpenAPIClientAdapter (implements AuditBatchWriter)
  • pkg/authwebhook.DSClientAdapter (implements WorkflowCatalog + ActionTypeCatalog + WorkflowCounter)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionTypeCatalog

type ActionTypeCatalog interface {
	CreateActionType(ctx context.Context, name string, description ogenclient.ActionTypeDescription, registeredBy string) (ActionTypeResult, error)
	UpdateActionType(ctx context.Context, name string, description ogenclient.ActionTypeDescription, updatedBy string) (ActionTypeUpdateResult, error)
	DisableActionType(ctx context.Context, name string, disabledBy string) (ActionTypeDisableResult, error)
	// ForceDisableActionType disables the named orphaned workflows and then
	// attempts to disable the action type. Issue #512: orphan recovery.
	ForceDisableActionType(ctx context.Context, name string, disabledBy string, orphanedWorkflows []string) (ActionTypeDisableResult, error)
}

ActionTypeCatalog manages action type taxonomy CRUD in DS. Currently: pkg/authwebhook.ActionTypeCatalogClient (via DSClientAdapter)

type ActionTypeDisableResult

type ActionTypeDisableResult struct {
	Disabled               bool
	DependentWorkflowCount int
	DependentWorkflows     []string
}

ActionTypeDisableResult holds the DS response when disabling an action type.

type ActionTypeResult

type ActionTypeResult struct {
	ActionType   string
	Status       string
	WasReenabled bool
}

ActionTypeResult holds the DS response after registering or re-enabling an action type.

type ActionTypeUpdateResult

type ActionTypeUpdateResult struct {
	ActionType    string
	UpdatedFields []string
}

ActionTypeUpdateResult holds the DS response after updating an action type description.

type AuditBatchWriter

type AuditBatchWriter interface {
	StoreBatch(ctx context.Context, events []*ogenclient.AuditEventRequest) error
}

AuditBatchWriter writes audit event batches to DS. Currently: pkg/audit.DataStorageClient

type Client

Client is the unified DS client interface composing all per-concern interfaces. v1.1: A single adapter implementing this interface will replace the current two adapters (OpenAPIClientAdapter + DSClientAdapter).

type WorkflowCatalog

type WorkflowCatalog interface {
	CreateWorkflowInline(ctx context.Context, content, source, registeredBy string) (WorkflowResult, error)
	DisableWorkflow(ctx context.Context, workflowID, reason, updatedBy string) error
}

WorkflowCatalog manages workflow registration and lifecycle in DS. Currently: pkg/authwebhook.WorkflowCatalogClient (via DSClientAdapter)

type WorkflowCounter

type WorkflowCounter interface {
	GetActiveWorkflowCount(ctx context.Context, actionType string) (int, error)
}

WorkflowCounter queries active workflow counts for an action type. Currently: pkg/authwebhook.ActionTypeWorkflowCounter (via DSClientAdapter)

type WorkflowResult

type WorkflowResult struct {
	WorkflowID        string
	WorkflowName      string
	Version           string
	Status            string
	PreviouslyExisted bool
}

WorkflowResult holds the DS response after registering or re-enabling a workflow.

Jump to

Keyboard shortcuts

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