api

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 24 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: AGPL-3.0-or-later

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(cfg RouterConfig) *chi.Mux

NewRouter creates and configures the API v1 router

Types

type RouterConfig

type RouterConfig struct {
	// Database for RLS middleware
	DB             *sql.DB         // Required for RLS transaction management
	TenantProvider tenant.Provider // Required for tenant context

	// Capability providers
	// AuthProvider handles all auth methods (sessions, OIDC, MagicLink) dynamically
	AuthProvider providers.AuthProvider // Required - unified auth provider
	Authorizer   providers.Authorizer   // Required for authorization decisions

	// Services
	SignatureService signatureService
	DocumentService  documentService
	AdminService     adminService
	ReminderService  reminderService
	WebhookService   webhookService
	WebhookPublisher webhookPublisher
	ConfigService    configService

	// Storage
	StorageProvider  storage.Provider // Optional, for document file storage
	StorageMaxSizeMB int64            // Maximum upload size in MB

	// Configuration
	BaseURL           string
	AuthRateLimit     int // Global auth rate limit (requests per minute), default: 5
	DocumentRateLimit int // Document creation rate limit (requests per minute), default: 10
	GeneralRateLimit  int // General API rate limit (requests per minute), default: 100
	ImportMaxSigners  int // Maximum signers per CSV import, default: 500
}

RouterConfig holds configuration for the API router

Directories

Path Synopsis
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later

Jump to

Keyboard shortcuts

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