Skip to content

feat(derive): add mask attribute to hide sensitive fields - #151

Open
ldseraph wants to merge 1 commit into
tokio-rs:masterfrom
ldseraph:feature/mask-attr
Open

feat(derive): add mask attribute to hide sensitive fields#151
ldseraph wants to merge 1 commit into
tokio-rs:masterfrom
ldseraph:feature/mask-attr

Conversation

@ldseraph

Copy link
Copy Markdown

Add support for #[valuable(mask)] and #[valuable(mask = "fn")] attributes to mask sensitive field values in the Valuable output.

  • #[valuable(mask)]: replaces field value with ""
  • #[valuable(mask = "my_fn")]: applies custom function to field value

Example:
#[derive(Valuable)]
struct User {
name: String,
#[valuable(mask)]
password: String,
}

Add support for `#[valuable(mask)]` and `#[valuable(mask = "fn")]`
attributes to mask sensitive field values in the Valuable output.

- `#[valuable(mask)]`: replaces field value with "<redacted>"
- `#[valuable(mask = "my_fn")]`: applies custom function to field value

Example:
    #[derive(Valuable)]
    struct User {
        name: String,
        #[valuable(mask)]
        password: String,
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant