sensitive

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 4 Imported by: 0

README

sensitive

logo!

This is a lib which can be used to hide sensitive values in struct.Mostly in microservices/applications config is managed via external (json/yaml) files. The values are parsed and mapped to struct. Some applications which speaks to external APIs will

require key to be provided. These keys can be managed in config value fields.When logging the config values in public these secrets can be exposed and cause data leaks.

Focus of the lib is to manage data leaks,the lib has a CreateStruct method which is

used to perform this operation.

There are 2 input fields required for the operation

  1. data structure

  2. list of fields which are required to be masked or hidden

usage

refer to example/main.go for how to use

Todo
  • expand the functionality to non exported columns
contributing

please feel free to raise a PR with your changes

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateStruct

func CreateStruct(d any, fields ...string) (string, error)

CreateStruct used to hide/mask sensitive fields in input. This currently supports only `struct` and `string` fields when an `int` field is provided for masking an error is emitted.When no fields are provided for masking it emits an error with informative message

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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