common

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthzListToMap

func AuthzListToMap(paths []string) map[string][]string

AuthzListToMap converts a list of resource-path strings (for example "/organization/org/project/proj" or legacy "/programs/org/projects/proj") to the wire-format org→projects map.

func AuthzMapFromScope

func AuthzMapFromScope(org, project string) map[string][]string

AuthzMapFromScope builds the wire-format authorizations map from an org and project. Empty project means org-wide access (value is empty slice).

func AuthzMapToControlledAccess added in v0.2.8

func AuthzMapToControlledAccess(authzMap map[string][]string) []string

func AuthzMapToList

func AuthzMapToList(authzMap map[string][]string) []string

AuthzMapToList converts the wire-format org→projects map back to a list of canonical resource-path strings for internal storage.

func ControlledAccessToAuthzMap added in v0.2.8

func ControlledAccessToAuthzMap(claims []string) map[string][]string

func NormalizeAccessResource added in v0.2.8

func NormalizeAccessResource(raw string) string

NormalizeAccessResource converts GA4GH controlled_access URL claims and accepted resource path aliases into the canonical resource form used for privilege checks: /organization/<organization>[/project/<project>].

func NormalizeAccessResources added in v0.2.8

func NormalizeAccessResources(resources []string) []string

func NormalizeChecksum

func NormalizeChecksum(raw string) string

NormalizeChecksum trims whitespace and an optional sha256: prefix.

func NormalizeOid

func NormalizeOid(oid string) string

NormalizeOid strips an optional "sha256:" prefix, lowercases, and validates that the result is a 64-character hex string. Returns "" for invalid input.

func ResourcePath

func ResourcePath(org, project string) (string, error)

ResourcePath returns the canonical resource path for an org/project scope, e.g. "/organization/myorg/project/myproject".

func ResourceScope added in v0.2.8

func ResourceScope(resource string) (string, string, bool)

ResourceScope parses a canonical or raw access resource into (organization, project). It accepts "/organization/org", "/organization/org/project/proj", and legacy "/programs/org/projects/proj" alias forms.

Types

This section is empty.

Jump to

Keyboard shortcuts

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