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

Add more secret string fields #10149

Merged
merged 3 commits into from
Oct 4, 2021
Merged

Add more secret string fields #10149

merged 3 commits into from
Oct 4, 2021

Conversation

ludeeus
Copy link
Member

@ludeeus ludeeus commented Oct 4, 2021

Breaking change

Proposed change

Add "client_secret" and "access_secret" as maskable keys

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

image

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

balloob
balloob previously approved these changes Oct 4, 2021
src/components/ha-form/ha-form-string.ts Outdated Show resolved Hide resolved
@@ -12,6 +12,8 @@ import type {
HaFormStringSchema,
} from "./ha-form";

const SECRET_FIELDS = ["password", "client_secret", "access_secret", "secret"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need client_secret and access_secret because we check with includes, so secret matches both.

Suggested change
const SECRET_FIELDS = ["password", "client_secret", "access_secret", "secret"];
const SECRET_FIELDS = ["password", "secret"];

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha, no. That was the old logic but you changed it. We should change that back.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, yeah
Should "token" also be checked?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure. 🤷

@@ -33,7 +35,7 @@ export class HaFormString extends LitElement implements HaFormElement {
}

protected render(): TemplateResult {
return this.schema.name.includes("password")
return SECRET_FIELDS.includes(this.schema.name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old check was "name includes password", new check is "name == password". We should do the original check again.

@balloob balloob merged commit 784e5e6 into dev Oct 4, 2021
@balloob balloob deleted the more-secret-fields branch October 4, 2021 15:42
@github-actions github-actions bot locked and limited conversation to collaborators Oct 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants