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

Introduce PasswordElement class #57

Merged
merged 5 commits into from Dec 9, 2021
Merged

Conversation

yhabteab
Copy link
Member

No description provided.

@cla-bot
Copy link

cla-bot bot commented Nov 22, 2021

Thank you for your pull request. Before we can look at it, you'll need to sign a Contributor License Agreement (CLA).

Please follow instructions at https://icinga.com/company/contributor-agreement to sign the CLA.

After that, please reply here with a comment and we'll verify.

Contributors that have not signed yet: @yhabteab

  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Please contact us if you think this is the case.

  • If you signed the CLA as a corporation, your GitHub username may not have been submitted to us. Please reach out to the responsible person in your organization.

@yhabteab
Copy link
Member Author

@cla-bot check

@cla-bot cla-bot bot added the cla/signed label Nov 22, 2021
Copy link
Member

@nilmerg nilmerg left a comment

Choose a reason for hiding this comment

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

Web 2's ResourceConfigForm doesn't include the stored password in the DOM. I think we should do the same but natively in the element itself. I believe this should work, since ipl\Html\Form can be (and in this case is) always being populated with the configuration:

  • Don't use property $value of ipl\Html\FormElement\Password to render the value attribute, use a constant dummy password instead
    • Use an attribute callback for this
  • Don't accept the dummy password as value for property $value (otherwise the real password is overridden and cannot be retrieved again by getValue())

This should ensure that:

  • A call to setValue() with the real password still stores it in property $value (Done by FormElements::populate())
  • A call to getValue() still returns the real password, if one got set by setValue() (Done by FormElements::getValues())
  • The form doesn't render the real password in the DOM, but shows that a password is set
  • The form accepts a new password

@yhabteab yhabteab force-pushed the introduce-password-form-element branch from ea62e59 to 40869ad Compare November 30, 2021 13:57
src/FormElement/FormElements.php Outdated Show resolved Hide resolved
src/FormElement/FormElements.php Outdated Show resolved Hide resolved
src/FormElement/PasswordElement.php Outdated Show resolved Hide resolved
src/FormElement/PasswordElement.php Outdated Show resolved Hide resolved
@yhabteab yhabteab force-pushed the introduce-password-form-element branch from cb1a960 to 0ffc5fd Compare November 30, 2021 18:11
@yhabteab yhabteab requested a review from nilmerg December 1, 2021 09:54
@yhabteab yhabteab force-pushed the introduce-password-form-element branch from 11b02d6 to 18b5bc5 Compare December 1, 2021 09:58
Copy link
Member

@nilmerg nilmerg left a comment

Choose a reason for hiding this comment

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

There's more, but I'd like to tackle that in person.

src/FormElement/FormElements.php Outdated Show resolved Hide resolved
src/Form.php Outdated Show resolved Hide resolved
@yhabteab yhabteab requested a review from nilmerg December 8, 2021 11:29
@yhabteab yhabteab force-pushed the introduce-password-form-element branch from 37f616b to 14563d9 Compare December 8, 2021 13:42
@yhabteab yhabteab requested review from nilmerg and removed request for nilmerg December 8, 2021 13:43
@yhabteab yhabteab force-pushed the introduce-password-form-element branch from 14563d9 to e95c6f5 Compare December 8, 2021 13:47
src/FormElement/PasswordElement.php Outdated Show resolved Hide resolved
@yhabteab yhabteab force-pushed the introduce-password-form-element branch from e95c6f5 to ec26482 Compare December 8, 2021 15:40
@yhabteab yhabteab requested a review from nilmerg December 8, 2021 15:41
@nilmerg nilmerg added the enhancement New feature or request label Dec 9, 2021
@nilmerg nilmerg added this to the v0.5.0 milestone Dec 9, 2021
@nilmerg nilmerg merged commit 1257dc4 into master Dec 9, 2021
@nilmerg nilmerg deleted the introduce-password-form-element branch December 9, 2021 07:43
@nilmerg nilmerg modified the milestones: v0.5.0, v0.4.3 Feb 9, 2022
@nilmerg nilmerg modified the milestones: v0.4.3, v0.5.0 Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants