secretstring

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecretString

type SecretString struct {
	Value string `json:"-"` // Never serialize the actual value
}

SecretString wraps sensitive string data and prevents accidental exposure in logs/JSON

func New

func New(v string) SecretString

New creates a new SecretString with the given string

func (SecretString) IsEmpty

func (s SecretString) IsEmpty() bool

IsEmpty returns true if the secret string has no value

func (SecretString) IsEqual

func (s SecretString) IsEqual(n SecretString) bool

IsEqual returns true if the give secret string is the same as the one.

func (SecretString) MarshalJSON

func (s SecretString) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler to hide the value during JSON serialization

func (SecretString) String

func (s SecretString) String() string

String implements fmt.Stringer to hide the actual value in string representations

func (*SecretString) UnmarshalJSON

func (s *SecretString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler to accept a JSON string. The deserialized value is stored as-is; callers that round-trip through JSON (e.g. Temporal workflow input) will receive a placeholder "******" rather than the original secret. This is intentional — use the proper architectural fix (see docs/WORKFLOW_EXECUTION_INFO_PLAN.md) to avoid passing secrets through serialization boundaries altogether.

Jump to

Keyboard shortcuts

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