Skip to content

Sensitive is a middleware for GoFiber to blind sensitive value like mobile no, citizen id, etc. by defined configuration. Useful for security policies.

Notifications You must be signed in to change notification settings

owlsome-official/sensitive

Repository files navigation

Sensitive

made-with-Go Watsize-Library CodeQL

Sensitive is a middleware for GoFiber to blind sensitive value like mobile no, citizen id, etc. by defined configuration. Useful for security policies.

./docs/hero.png

Table of Contents

Installation

  go get -u github.com/owlsome-official/sensitive

Versions

v0.2.3 - 2024-11-19

  • Updated dependencies version

v0.2.2 - 2024-09-13

  • Updated dependencies version
  • Transfer project to owlsome-official

v0.2.1 - 2024-04-17

  • Updated dependencies and module version

v0.2.0 - 2024-02-13

  • Updated dependencies and module version

v0.1.0 - 2023-02-14

  • Blind text from abcdefg into axxxxxg (just show only the first and the last character with "x" as mark in the middle)
  • Blinding by specific keys in response body
  • Supported custom mark (default: "x")
  • Debug Mode available via config sensitive.New(sensitive.Config{ DebugMode: true })

...more

Signatures

func New(config ...Config) fiber.Handler

Examples

func main() {
  app := fiber.New()

  app.Use(sensitive.New(sensitive.Config{}))
  
  // ... Handlers ...
}

Config

// Config defines the config for middleware.
type Config struct {
  // Optional. Default: nil
  Next func(c *fiber.Ctx) bool

  // Required. Default: []
  Keys []string

  // Optional. Default: "x"
  Mark string

  // Optional. Default: false
  DebugMode bool
}

Default Config

var ConfigDefault = Config{
  Next:      nil,
  Keys:      []string{},
  Mark:      "x",
  DebugMode: false,
}

Example Usage

Check it out! example/README.md


made by ❤️ owlsome-official

About

Sensitive is a middleware for GoFiber to blind sensitive value like mobile no, citizen id, etc. by defined configuration. Useful for security policies.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages