Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

nestedpkg source pure

Package nestedpkg provides helpers for package-path based access control. It is useful for upgrade patterns relying o...

Overview

Package nestedpkg provides helpers for package-path based access control. It is useful for upgrade patterns relying on namespaces.

SECURITY: every exported helper takes `rlm realm` and reads both `rlm.PkgPath()` and `rlm.Previous().PkgPath()` to make an authorization decision. To close Class-2 designation forgery (a hostile realm stashes a captured realm value and passes it back to spoof identity), every helper gates on `rlm.IsCurrent()` first. The Is* predicates return false on stale rlm (fail-closed); the Assert* helpers panic. See docs/resources/gno-security.md.

Functions 6

func AssertCallerIsParentPath

1func AssertCallerIsParentPath(_ int, rlm realm)
source

AssertCallerIsParentPath panics if IsCallerParentPath returns false.

func AssertCallerIsSubPath

1func AssertCallerIsSubPath(_ int, rlm realm)
source

AssertCallerIsSubPath panics if IsCallerSubPath returns false.

func AssertIsSameNamespace

1func AssertIsSameNamespace(_ int, rlm realm)
source

AssertIsSameNamespace panics if IsSameNamespace returns false.

func IsCallerParentPath

1func IsCallerParentPath(_ int, rlm realm) bool
source

IsCallerParentPath checks if the caller realm is located in a parent location of the current realm.

func IsCallerSubPath

1func IsCallerSubPath(_ int, rlm realm) bool
source

IsCallerSubPath checks if the caller realm is located in a subfolder of the current realm.

func IsSameNamespace

1func IsSameNamespace(_ int, rlm realm) bool
source

IsSameNamespace checks if the caller realm and the current realm are in the same namespace.

Imports 1

  • strings stdlib

Source Files 2