Sensitive is a middleware for GoFiber to blind sensitive value like mobile no, citizen id, etc. by defined configuration. Useful for security policies.
go get -u github.com/owlsome-official/sensitive
- Updated dependencies version
- Updated dependencies version
- Transfer project to
owlsome-official
- Updated dependencies and module version
- Updated dependencies and module version
- Blind text from
abcdefg
intoaxxxxxg
(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 })
func New(config ...Config) fiber.Handler
func main() {
app := fiber.New()
app.Use(sensitive.New(sensitive.Config{}))
// ... Handlers ...
}
// 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
}
var ConfigDefault = Config{
Next: nil,
Keys: []string{},
Mark: "x",
DebugMode: false,
}
Check it out! example/README.md
made by ❤️ owlsome-official