requestidentity

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package requestidentity extracts trusted Core account identity from module proxy headers.

Module HTTP ports must not be exposed directly to untrusted clients because the identity headers are trusted only when requests come through Core.

Index

Constants

View Source
const (
	// HeaderAccountID contains the authenticated Core account identifier.
	HeaderAccountID = "X-ProcessModule-Account-ID"

	// HeaderSystemAdministrator indicates whether the Core account is a
	// system administrator.
	HeaderSystemAdministrator = "X-ProcessModule-System-Administrator"
)

Variables

This section is empty.

Functions

func RequireAuthenticated

func RequireAuthenticated() echo.MiddlewareFunc

RequireAuthenticated requires a valid Core account identity.

func RequireSystemAdministrator

func RequireSystemAdministrator() echo.MiddlewareFunc

RequireSystemAdministrator requires a valid Core system administrator identity.

Types

type Identity

type Identity struct {
	AccountID           int64
	SystemAdministrator bool
}

Identity describes the authenticated Core account forwarded to a module.

func From

func From(c *echo.Context) (Identity, bool)

From returns the Core account identity stored in the Echo request context.

Jump to

Keyboard shortcuts

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