utils

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: BSD-3-Clause-Clear Imports: 11 Imported by: 0

Documentation

Overview

pkg/utils/identifier.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient added in v0.27.0

func NewHTTPClient(tlsNoVerify bool) *http.Client

func NormalizeEndpoint

func NormalizeEndpoint(endpoint string) (*url.URL, error)

func ReadBytesFromFile added in v0.18.0

func ReadBytesFromFile(filePath string, maxBytes int64) ([]byte, error)

func ValidatePublicKeyPEM added in v0.26.0

func ValidatePublicKeyPEM(pemBytes []byte, expected policy.Algorithm) error

ValidatePublicKeyPEM validates a PEM-encoded public key block and ensures it matches the expected algorithm. The input should be raw PEM bytes (not base64).

Types

type IdentifierStringType added in v0.21.0

type IdentifierStringType int

IdentifierStringType defines the type of string identified.

const (
	// StringTypeUnknown indicates the string type could not be determined or is empty.
	StringTypeUnknown IdentifierStringType = iota
	// StringTypeUUID indicates the string is a valid UUID.
	StringTypeUUID
	// StringTypeURI indicates the string is a valid absolute URI.
	StringTypeURI
	// StringTypeGeneric indicates the string is not a UUID or URI, and can be treated as a generic identifier (e.g., a name).
	StringTypeGeneric
)

func ClassifyString added in v0.21.0

func ClassifyString(input string) IdentifierStringType

ClassifyString attempts to determine if the input string is a UUID, an absolute URI, or a generic string. It prioritizes UUID, then URI, then defaults to Generic.

func (IdentifierStringType) String added in v0.21.0

func (it IdentifierStringType) String() string

String returns a string representation of the IdentifierStringType.

Jump to

Keyboard shortcuts

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