authval

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package authval holds the configuration checks the auth and oauth2 packages share, written after Powertools Python's auth_alpha validation helpers so that both accept and reject the same values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPSURL

func HTTPSURL(raw string, issuer bool) bool

HTTPSURL reports whether raw is a URL Powertools trusts with credentials: the https scheme, a host, no user information, no fragment, a valid port, and neither whitespace nor control characters anywhere. An issuer must not carry a query either, since it is compared byte for byte with the iss claim.

func NonBlank

func NonBlank(s string) bool

NonBlank reports whether s holds valid UTF-8 with something other than whitespace in it.

func ScopeToken

func ScopeToken(s string) bool

ScopeToken reports whether s is a scope token as RFC 6749 section 3.3 defines it: printable ASCII except the double quote and the backslash.

func Scopes

func Scopes(values []string) ([]string, bool)

Scopes checks that every value is an OAuth scope token, and returns them without duplicates, in their first-seen order.

func Strings

func Strings(values []string) ([]string, bool)

Strings checks that every value holds something other than whitespace, and returns them without duplicates, in their first-seen order. It reports false when a value is blank.

Types

This section is empty.

Jump to

Keyboard shortcuts

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