extract

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecretValue

func SecretValue(cid string, secret *entity.SecretStored) string

SecretValue determines the appropriate representation of a secret's value to use, giving precedence to a transformed value over the raw values. This function supports both current implementations and backward compatibility by handling secrets with multiple values or transformed values.

Parameters:

  • cid (string): Correlation ID for operation tracing and logging.
  • secret (*entity.SecretStored): A pointer to the secret entity from which the value is to be retrieved.

Returns:

  • string: The selected representation of the secret's value. This could be the transformed value, a single raw value, a JSON-encoded string of multiple values, or an empty string in case of an error.

func WorkloadIDAndParts

func WorkloadIDAndParts(spiffeid string) (string, []string)

WorkloadIDAndParts extracts the workload identifier and its constituent parts from a SPIFFE ID string, based on a predefined prefix that is removed from the SPIFFE ID.

Parameters:

  • spiffeid (string): The SPIFFE ID string from which the workload identifier and parts are to be extracted.

Returns:

  • (string, []string): The first return value is the workload identifier, which is essentially the first part of the SPIFFE ID after removing the prefix. The second return value is a slice of strings representing all parts of the SPIFFE ID after the prefix removal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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