middleware

package
v0.34.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 0 Imported by: 8 modules, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package middleware provides components that integrate Aserto authorization to gRPC or HTTP servers.

1. middleware/grpc provides middleware for "google.golang.org/grpc" servers.

2. middleware/http provides middleware for servers based on "net/http".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity interface {
	// JWT indicates that ID should be interpreted as a JWT token.
	JWT() Identity

	// Subject indicates that ID should be interpreted as a subject name (e.g. username, account ID, email, etc.).
	Subject() Identity

	// Manual indicates that the identity value is set manually and isn't resolved to a user by the authorizer.
	Manual() Identity

	// None indicates that this Identity represents an unauthenticated caller.
	None() Identity

	// ID sets the identity value - a string that represents a user ID or a JWT token.
	ID(identity string) Identity
}

Identity provides methods to set caller identity parameters.

There are three kinds of identities:

1. None - Anonymous access. No user ID.

2. JWT - The identity string is interpreted as a JWT token.

3. Subject - The identity string represents a user identifier (e.g. account ID, email, etc.).

type Policy

type Policy struct {
	// Name is the Name of the policy being queried for authorization.
	Name string

	// Path is the package name of the rego policy to evaluate.
	// If left empty, a policy mapper must be attached to the middleware to provide
	// the policy path from incoming messages.
	Path string

	// Decision is the authorization rule to use.
	Decision string

	// Root is an optional prefix shared by all policy modules being evaluated.
	Root string
}

Policy holds authorization options that apply to all requests.

Directories

Path Synopsis
ginz module
gorillaz module
grpcz module
httpz module
humaz module

Jump to

Keyboard shortcuts

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