Skip to content

Support for generic masking methods #16

@naeem-shaikh-tw

Description

@naeem-shaikh-tw

Hello,
I want to mask all the characters in a field in my struct that is not a password. https://play.golang.org/p/xAdDleuk1KN

type personalDetails struct {
	SSN   string `mask:"password"`
}

While this works fine, but masking it as a type password does not make sense to the reader. It sounds more like SSN is a password when I read the code.

I was wondering if we can solve this by any of the two approaches:

  1. If we can have some Generic types that can be used, such as mask:"all" and even more types such as mask:"first-3" or mask:"last-5"

  2. Or if we can add more specific types such as mask:"ssn" or mask:"dob"

Having more specialised types just makes is rigid to use, so if we can add some generic types like mentioned in approach 1 above?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions