urlsafe

package
v1.5.30 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: GPL-2.0, GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package urlsafe holds URL path segment safety predicates. It depends only on the standard library and on no other internal/* package so it can be imported from any layer without risking an import cycle. The predicate here is the single source of truth for "is this string safe to embed in a URL path segment"; every caller that builds a GitHub API URL from external input (the GITHUB_OWNER env var, repo names returned by the API) routes through this function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSafeURLSegment

func IsSafeURLSegment(s string) bool

IsSafeURLSegment returns true if s is safe to embed in a URL path segment: it must be non-empty, not a traversal element ("." or ".."), and consist solely of GitHub's permitted owner/repo characters ([A-Za-z0-9._-]). Every caller that builds a GitHub API URL from external input routes through this allowlist, the single source of truth for path-segment safety.

Types

This section is empty.

Jump to

Keyboard shortcuts

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