# Packages
Package cache contains cache utilities and implementations.
Package cli contains utility for the cli.
Package cursor provides a way to encode and decode cursors for paginated queries.
Package jsonyaml contains utility functions for converting to/from json and yaml.
Package ptr contains the Ptr function.
Package rand contains utility functions largely for unit testing.
Package schemaupdate contains utility functions to compare two schemas for updates.
Package schemavalidate provides utilities for validating JSON schemas.
Package testqueue contains queue utilities for testing.
# Functions
ExpandFileArgs expands a list of file arguments into a list of files.
FromRpcError convert a grpc status.Status to a nice status for formatting.
GenerateCurlCommand generates a curl command from a method, apiBaseURL, endpoint, and body this is useful to provide a dry-run for remediations.
GetBytesFromProto given a proto message, formats into bytes.
GetConfigDirPath returns the path to the config directory.
GetGrpcConnection is a helper for getting a testing connection for grpc.
GetJsonFromProto given a proto message, formats into json.
GetNiceStatus get a nice status from the code.
GetToken retrieves the access token from the credentials file and refreshes it if necessary.
GetYamlFromProto given a proto message, formats into yaml.
HttpMethodFromString returns the HTTP method from a string based on upprecase inMeth, defaulting to dfl.
Int32FromString converts a string to an int32.
JQEvalBoolExpression evaluates the given path on the object and returns the string value the path is the accessor path in jq format which must return a boolean value.
JQReadConstant gets the typed value from the given constant.
JQReadFrom gets the typed value from the given accessor.
LoadCredentials loads the credentials from a file.
NewLimitedWriter creates a new LimitedWriter.
NewSafeHTMLTemplate creates a new SafeTemplate for HTML templates.
NewSafeTextTemplate creates a new SafeTemplate for text templates.
OpenFileArg opens a file argument and returns a descriptor, closer, and error If the file is "-", it will return whatever is passed in as dashOpen and a no-op closer.
RefreshCredentials uses a refresh token to get and save a new set of credentials.
RemoveCredentials removes the local credentials file.
RevokeOfflineToken revokes the given offline token using OAuth2.0's Token Revocation endpoint from RFC 7009.
RevokeToken revokes the given token using OAuth2.0's Token Revocation endpoint from RFC 7009.
SanitizingInterceptor sanitized error statuses which do not conform to NiceStatus, ensuring that we don't accidentally leak implementation details over gRPC.
SaveCredentials saves the credentials to a file.
UserVisibleError returns a status error where message is visible to the user, rather than being filtered to generic advice.
ViperLogLevelToZerologLevel converts a viper log level to a zerolog log level.
# Constants
CurlCmdMaxSize is the maximum size of the rendered curl command.
# Variables
ErrExceededSizeLimit is returned when the size limit is exceeded.
ErrGettingRefreshToken is an error for when we can't get a refresh token.
ErrNoValueFound is an error that is returned when the accessor doesn't find anything.
MinderAuthTokenEnvVar is the environment variable for the minder auth tokennolint:gosec // This is not a hardcoded credential.
PyRequestsNameRegexp is a regexp to match a line in a requirements.txt file, parsing out the package name.
PyRequestsVersionRegexp is a regexp to match a line in a requirements.txt file, including the package version and the comparison operators.
TemplateFuncs is a map of functions that can be used in templates It introduces two custom functions: - asMap: converts a structpb (or anything that implements the AsMap function call) to a map - mapGet: returns the value of a key in a map.
# Structs
ExpandedFile is a struct to hold a file path and whether it was expanded.
JWTTokenCredentials is a helper struct for grpc.
LimitedWriter is an io.Writer that limits the number of bytes written.
NiceStatus A wrapper around a status to give a better description.
OpenIdCredentials is a struct to hold the access and refresh tokens.
SafeTemplate is a `template` wrapper that ensures that the template is rendered in a safe and secure manner.
TestWriter is a helper struct for testing.