security

package
v0.2.19 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetServiceMethodsByPolicyNames

func GetServiceMethodsByPolicyNames(names ...string) map[string]struct{}

GetServiceMethodsByPolicyNames returns a map of service methods that have any of the given policy names. This function provides a convenient way to access pre-filtered lists of code-defined policies. It's intended for static, compile-time defined policies, not for dynamic, user-editable policies.

func RegisterPolicies

func RegisterPolicies(policies []Policy)

RegisterPolicies is a public function called by generated code in init() functions. It appends a slice of policies to the global unifiedPolicies registry.

Types

type Policy

type Policy struct {
	ServiceMethod string // gRPC full method name, e.g., "/user.v1.UserService/GetUser"
	GatewayPath   string // HTTP path and method, e.g., "GET:/api/v1/users/{id}"
	Name          string // The policy name/definition string from the proto annotation, e.g., "admin-only"
	VersionID     string // A hash representing the version of this policy definition
}

Policy holds all information for a single resource's policy. This struct is created by generated code and registered via init().

func RegisteredPolicies

func RegisteredPolicies() []Policy

RegisteredPolicies returns a copy of all policy registrations. This is called once at application startup to sync policies to the database (the "Resource").

Jump to

Keyboard shortcuts

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