Skip to content

Add word/profanity filter for random_pet #576

@garretth9

Description

@garretth9

Terraform CLI and Provider Versions

Terraform v1.5.7
on darwin_arm64

  • provider registry.terraform.io/hashicorp/azuread v2.46.0
  • provider registry.terraform.io/hashicorp/random v3.6.0

Use Cases or Problem Statement

In some cases random_pet names may be used in user-facing scenarios. For example we use random_pet to generate initial passwords for certain types of accounts. With the current list of words that are being used by the provider it's possible to generate pets that some would consider inappropriate, such as "primarily-witty-jackass" (a real-world example).

Proposal

A couple possible options.

  1. Add an "excluded_words = list(string)" parameter. If a pet name is generated containing any of these words a new one should be generated instead.
  2. Add an "exclude_profanity = bool" parameter. This could potentially use a libarary such as https://github.com/TwiN/go-away to detect words that could be considered inappropriate without the user needing to manually specify them and generate a new pet name if an inappropriate word is detected.

How much impact is this issue causing?

Low

Additional Information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementwaiting-responseIssues or pull requests waiting for an external response

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions