Skip to content

Allow for defaulting to private attributes #192

@bianchidotdev

Description

@bianchidotdev

Hey hey 👋

Is your feature request related to a problem? Please describe.
No. We would like to be able to assume user attributes are private unless explicitly marked public. This would reduce the likelihood of accidentally exposing customer data.

Describe the solution you'd like
Some mechanism to have all attributes defaulted to private attributes with the ability to mark something as public.

Specifically, we could still use the all_attributes_private configuration setting, but add in additional logic in LaunchDarkly::UserFilter#private_attr? to allow for an attribute to be explicitly marked as public.

Example Usage:

config = LaunchDarkly::Config.new(all_attributes_private: true)
client = LaunchDarkly::LDClient.new("SDK_KEY", config)
user = { key: "somekey", custom: { ssn: "xxx-xx-xxxx", totally_ok_attr: "benign!" }, publicAttributeNames: [:totally_ok_attr] }
client.variation("feature_flag_name", user, false)   # sends totally_ok_attr, but not ssn

Describe alternatives you've considered
Unsure. The existing model either relies too much on any given developer's perfection or doesn't allow for any metrics in LD at all.

Additional context
N/A - But I'd be willing to help with a PR to push this through. For now, we are creating a custom class inheriting from LDClient and injecting this behavior in a sub-optimal way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions