Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SensitiveString type #5678

Closed
qfrank opened this issue Aug 8, 2024 · 1 comment · Fixed by #6190
Closed

Implement SensitiveString type #5678

qfrank opened this issue Aug 8, 2024 · 1 comment · Fixed by #6190

Comments

@qfrank
Copy link
Contributor

qfrank commented Aug 8, 2024

Though I there's a drawback here. Adding a field that should be logged, will require user to keep in mind to add it to Marshal function.

I googled this solution, it looks much cleaner and scalable:

type SensitiveString string {}

func (SensitiveString s) String () string {
    return "****"
}

func (SensitiveString s) Value() string {
    return s
}

I guess we can merge as is and open an issue to fix all places for to use such approach.
cc @osmaczko

Originally posted by @igor-sirotin in #5677 (review)

@igor-sirotin igor-sirotin changed the title Drawback for sensitive fields Implement SensitiveString type Aug 11, 2024
@friofry
Copy link
Contributor

friofry commented Aug 20, 2024

as discussed on status-go guild: (https://docs.google.com/spreadsheets/d/1CerD7oQZVt0kYeSve9IGOtnIgJZ0MPLyTKwoKC77Dtc/edit?gid=0#gid=0)

We can have a 'sensitive string' data type, which will also log nothing in any production build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants