• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Tip request: How to avoid coercing twice in NSValidation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tip request: How to avoid coercing twice in NSValidation


  • Subject: Re: Tip request: How to avoid coercing twice in NSValidation
  • From: Paul Hoadley <email@hidden>
  • Date: Wed, 24 May 2017 09:13:01 +0930

On 23 May 2017, at 19:56, email@hidden wrote:

My approach is to never bind directly to the password attribute.

With forms that persist a password value I bind to a component ivar, check validity on the raw string to whatever my password policy might dictate (in the component’s action method) then call the password attribute setter passing the digested string.

We use a similar approach. You can also add cover methods in User:

setPlaintextPassword(String): calls setPassword using the hash of the supplied String.
String plaintextPassword(): just returns null.

Then you can bind User.plaintextPassword in a form and get the expected behaviour: it hashes any password input, and never returns anything.


-- 
Paul Hoadley
http://logicsquad.net/
https://www.linkedin.com/company/logic-squad/



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Tip request: How to avoid coercing twice in NSValidation (From: Riccardo De Menna <email@hidden>)
 >Re: Tip request: How to avoid coercing twice in NSValidation (From: email@hidden)

  • Prev by Date: Re: Tip request: How to avoid coercing twice in NSValidation
  • Next by Date: Re: Tip request: How to avoid coercing twice in NSValidation
  • Previous by thread: Re: Tip request: How to avoid coercing twice in NSValidation
  • Next by thread: Re: Tip request: How to avoid coercing twice in NSValidation
  • Index(es):
    • Date
    • Thread