Home » Modeling » EMF » Password property
Password property [message #406875] |
Tue, 06 February 2007 19:31 |
Eclipse User |
|
|
|
Originally posted by: marcus.tangermann.web.de
Hi,
more than one year ago there was a question about password-like feature.
Meanwhile, is it possible to show a password as '*****' in properties view?
Best regards
Marcus
|
|
| | | | |
Re: Password property [message #406916 is a reply to message #406915] |
Wed, 07 February 2007 19:39 |
Miles Parker Messages: 1341 Registered: July 2009 |
Senior Member |
|
|
...not to mention encrypting it so someone can't just grab it from the
backing store. :) :)
On 2007-02-07 12:59:58 -0500, Steve Blass <sblass@acm.org> said:
> ...and once you change getPropertyValue you'll probably want to provide
> a method for retrieving the actual value when you need the real
> password rather than ****'s ;)
>
> Ed Merks wrote:
>> Marcus,
>>
>> Yes, you'll have to fiddle with ItemPropertyDescriptor.getProperyValue.
>>
>>
>> Marcus Tangermann wrote:
>>> Ed,
>>>
>>> thanks for you advice. I've got the cell editor working (shows ***
>>> instead of text when editing).
>>> Now I have to check how to display '****' when cell editor is not
>>> active. I guess this will somehow work using getEditableValue of
>>> PropertySource.
>>>
>>> Marcus
>>>
>>> Ed Merks schrieb:
>>>> Marcus,
>>>>
>>>> No, we've never provided such a feature. I assume you'd want to show
>>>> "*" even as the user typed their password. If that's the case, you'd
>>>> need to create a specialized cell editor; there are quite a few answers
>>>> to the question of how to do that:
>>>>
>>>>
>>>> http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&cmd=Search%21&form=extended&wf=574a74&ps=1 0&m=all&t=5&ul=%2Fnewslists%2Fnews.eclipse.tools .emf&wm=wrd&t=News&t=Mail
>>>>
>>>>
>>>> < http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&cmd=Search%21&form=extended&wf=574a74&ps=1 0&m=all&t=5&ul=%2Fnewslists%2Fnews.eclipse.tools .emf&wm=wrd&t=News&t=Mail>
Marcus
>>>>
>>>> Tangermann wrote:
>>>>> Hi,
>>>>>
>>>>> more than one year ago there was a question about password-like feature.
>>>>> Meanwhile, is it possible to show a password as '*****' in properties view?
>>>>>
>>>>> Best regards
>>>>> Marcus
|
|
|
Re: Password property [message #406917 is a reply to message #406916] |
Wed, 07 February 2007 19:44 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Miles,
I wondered about that too. :-)
Resource supports the load and save option, OPTION_CIPHER. With 2.2.x,
you can use CryptoCipherImpl or in 2.3.0 you can use AESCipherImpl or
DESCipherImpl. This encrypts the entire resource though...
Miles Parker wrote:
>
> ..not to mention encrypting it so someone can't just grab it from the
> backing store. :) :)
>
> On 2007-02-07 12:59:58 -0500, Steve Blass <sblass@acm.org> said:
>
>> ...and once you change getPropertyValue you'll probably want to
>> provide a method for retrieving the actual value when you need the
>> real password rather than ****'s ;)
>>
>> Ed Merks wrote:
>>> Marcus,
>>>
>>> Yes, you'll have to fiddle with ItemPropertyDescriptor.getProperyValue.
>>>
>>>
>>> Marcus Tangermann wrote:
>>>> Ed,
>>>>
>>>> thanks for you advice. I've got the cell editor working (shows ***
>>>> instead of text when editing).
>>>> Now I have to check how to display '****' when cell editor is not
>>>> active. I guess this will somehow work using getEditableValue of
>>>> PropertySource.
>>>>
>>>> Marcus
>>>>
>>>> Ed Merks schrieb:
>>>>> Marcus,
>>>>>
>>>>> No, we've never provided such a feature. I assume you'd want to
>>>>> show "*" even as the user typed their password. If that's the
>>>>> case, you'd need to create a specialized cell editor; there are
>>>>> quite a few answers to the question of how to do that:
>>>>>
>>>>>
>>>>> http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&cmd=Search%21&form=extended&wf=574a74&ps=1 0&m=all&t=5&ul=%2Fnewslists%2Fnews.eclipse.tools .emf&wm=wrd&t=News&t=Mail
>>>>>
>
>>>>>
>>>>>
>>>>> < http://www.eclipse.org/search/search.cgi?q=custom+cell+edito r&cmd=Search%21&form=extended&wf=574a74&ps=1 0&m=all&t=5&ul=%2Fnewslists%2Fnews.eclipse.tools .emf&wm=wrd&t=News&t=Mail>
>>>>>
>
>
> Marcus
>>>>>
>>>>> Tangermann wrote:
>>>>>> Hi,
>>>>>>
>>>>>> more than one year ago there was a question about password-like
>>>>>> feature.
>>>>>> Meanwhile, is it possible to show a password as '*****' in
>>>>>> properties view?
>>>>>>
>>>>>> Best regards
>>>>>> Marcus
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Password property [message #406937 is a reply to message #406915] |
Fri, 09 February 2007 07:49 |
Eclipse User |
|
|
|
Originally posted by: marcus.tangermann.web.de
Hi,
finally...it works :-)
This is propably an ugly implementation...but hey, it works ;-)
So, for all of you who face the same problem:
1. Extend AdapterFactoryContentProvider and implement
createPropertySource
2. Extend PropertySource and implement createPropertyDescriptor
3. Extend PropertyDescriptor and implement createPropertyEditor
4. If the second parameter of the constructor is a derived property
descriptor (PasswordItemPropertyDescriptor), save the reference to
the descriptor a variable
5. In createPropertyEditor create new instance of TextCellEditor and set
style to SWT.PASSWORD
6. Extend ItemPropertyDescriptor and override createPropertyValueWrapper
Name it e.g. PasswordItemPropertyDescriptor
7. Extend PropertyValueWrapper and name it e.g. PasswordValueWrapper
8. In the createPropertyValueWrapper method save the "real" value in a
variable (second parameter of the method)
9. Overwrite the doSetValue method of the TextCellEditor created above.
Call super.doSetValue with the real value from the
PasswordItemPropertyDescriptor
10. Finally change the createItemPropertyDescriptor in the model edit
code to instantiate the PasswordItemPropertyDescriptor
Steve Blass schrieb:
> ...and once you change getPropertyValue you'll probably want to >provide
> a method for retrieving the actual value when you need the real
>password
> rather than ****'s ;)
>
|
|
| |
Re: Password property [message #406943 is a reply to message #406938] |
Fri, 09 February 2007 14:53 |
Miles Parker Messages: 1341 Registered: July 2009 |
Senior Member |
|
|
Couldn't one provide a derived method that provides and sets the plain
text version of the password, persisting that to the actual encrypted
EReference string? You might want to make sure that notifications etc..
are disabled so that people can't register for notifications at
runtime. Not to mention providing new adapters and what not. Or perhaps
you could actually use a SetCommand to manage this.. Still a relativly
niave solution, but..
On 2007-02-09 06:32:32 -0500, Ed Merks <merks@ca.ibm.com> said:
> Marcus,
>
> Thanks for publishing your results! Perhaps we should consider
> providing support for something like this using a setting on the
> GenFeature (perhaps as new Property Type choice). If someone wants to
> open a feature request for that, feel free.
> I wonder how you are storing this password in a way that keeps it
> secure? I'm not even sure if it's possible or sensible to define an
> EDataType that does encryption and decryption automatically; of course
> it wouldn't be very useful for the cell editor to be editing the
> encrypted value, so such a data type would need special handling in the
> cell editor, but then it already does...
>
>
> Marcus Tangermann wrote:
>> Hi,
>>
>> finally...it works :-)
>> This is propably an ugly implementation...but hey, it works ;-)
>> So, for all of you who face the same problem:
>>
>> 1. Extend AdapterFactoryContentProvider and implement
>> createPropertySource
>> 2. Extend PropertySource and implement createPropertyDescriptor
>> 3. Extend PropertyDescriptor and implement createPropertyEditor
>> 4. If the second parameter of the constructor is a derived property
>> descriptor (PasswordItemPropertyDescriptor), save the reference to
>> the descriptor a variable
>> 5. In createPropertyEditor create new instance of TextCellEditor and set
>> style to SWT.PASSWORD
>> 6. Extend ItemPropertyDescriptor and override createPropertyValueWrapper
>> Name it e.g. PasswordItemPropertyDescriptor
>> 7. Extend PropertyValueWrapper and name it e.g. PasswordValueWrapper
>> 8. In the createPropertyValueWrapper method save the "real" value in a
>> variable (second parameter of the method)
>> 9. Overwrite the doSetValue method of the TextCellEditor created above.
>> Call super.doSetValue with the real value from the
>> PasswordItemPropertyDescriptor
>> 10. Finally change the createItemPropertyDescriptor in the model edit
>> code to instantiate the PasswordItemPropertyDescriptor
>>
>> Steve Blass schrieb:
>> > ...and once you change getPropertyValue you'll probably want to >provide
>> > a method for retrieving the actual value when you need the real >password
>> > rather than ****'s ;)
>> >
|
|
|
Re: Password property [message #406946 is a reply to message #406943] |
Fri, 09 February 2007 15:53 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Miles,
One approach I've heard people use is to set an encrypted version of the
password to the model and to decrypt it when it's fetched. So within
the model itself, you can never just see the plain value...
Miles Parker wrote:
>
> Couldn't one provide a derived method that provides and sets the plain
> text version of the password, persisting that to the actual encrypted
> EReference string? You might want to make sure that notifications
> etc.. are disabled so that people can't register for notifications at
> runtime. Not to mention providing new adapters and what not. Or
> perhaps you could actually use a SetCommand to manage this.. Still a
> relativly niave solution, but..
>
> On 2007-02-09 06:32:32 -0500, Ed Merks <merks@ca.ibm.com> said:
>
>> Marcus,
>>
>> Thanks for publishing your results! Perhaps we should consider
>> providing support for something like this using a setting on the
>> GenFeature (perhaps as new Property Type choice). If someone wants
>> to open a feature request for that, feel free.
>> I wonder how you are storing this password in a way that keeps it
>> secure? I'm not even sure if it's possible or sensible to define an
>> EDataType that does encryption and decryption automatically; of
>> course it wouldn't be very useful for the cell editor to be editing
>> the encrypted value, so such a data type would need special handling
>> in the cell editor, but then it already does...
>>
>>
>> Marcus Tangermann wrote:
>>> Hi,
>>>
>>> finally...it works :-)
>>> This is propably an ugly implementation...but hey, it works ;-)
>>> So, for all of you who face the same problem:
>>>
>>> 1. Extend AdapterFactoryContentProvider and implement
>>> createPropertySource
>>> 2. Extend PropertySource and implement createPropertyDescriptor
>>> 3. Extend PropertyDescriptor and implement createPropertyEditor
>>> 4. If the second parameter of the constructor is a derived property
>>> descriptor (PasswordItemPropertyDescriptor), save the reference to
>>> the descriptor a variable
>>> 5. In createPropertyEditor create new instance of TextCellEditor and
>>> set
>>> style to SWT.PASSWORD
>>> 6. Extend ItemPropertyDescriptor and override
>>> createPropertyValueWrapper
>>> Name it e.g. PasswordItemPropertyDescriptor
>>> 7. Extend PropertyValueWrapper and name it e.g. PasswordValueWrapper
>>> 8. In the createPropertyValueWrapper method save the "real" value in a
>>> variable (second parameter of the method)
>>> 9. Overwrite the doSetValue method of the TextCellEditor created above.
>>> Call super.doSetValue with the real value from the
>>> PasswordItemPropertyDescriptor
>>> 10. Finally change the createItemPropertyDescriptor in the model edit
>>> code to instantiate the PasswordItemPropertyDescriptor
>>>
>>> Steve Blass schrieb:
>>> > ...and once you change getPropertyValue you'll probably want to
>>> >provide
>>> > a method for retrieving the actual value when you need the real
>>> >password
>>> > rather than ****'s ;)
>>> >
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Mon Sep 23 07:38:25 GMT 2024
Powered by FUDForum. Page generated in 0.24624 seconds
|