httpadapter

package
v7.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Overview

Package httpadapter exposes authenticated root-scoped REST and signed transfers. Handler projects public identities according to each root's capabilities and binds direct transfers to their authorized path, execution scope and optional file identity. The application remains responsible for user authorization.

Index

Constants

View Source
const ExecutionHeader = "X-Filegate-Execution"

ExecutionHeader is accepted only on backend-authenticated operations. Direct transfers use the identity authenticated by their capability instead.

View Source
const MaxHeaderBytes = 64 << 10

MaxHeaderBytes is the daemon's combined request-line and header limit. Listing responses reserve additional space for client-added headers.

Variables

This section is empty.

Functions

func ValidateDownloadName

func ValidateDownloadName(name string) error

ValidateDownloadName validates one presentation filename, never a filesystem path. Empty optional request fields select the original path's basename.

Types

type Handler

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

func New

func New(roots []*domain.Root, o Options) *Handler

func (*Handler) Drain

func (h *Handler) Drain()

Drain prevents state from closing while a handler still publishes a file.

func (*Handler) Maintain

func (h *Handler) Maintain(ctx context.Context)

func (*Handler) ServeHTTP

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

type Options

type Options struct {
	Token     string
	PublicURL string
	Origins   []string
	Version   string
}

Jump to

Keyboard shortcuts

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