Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Password property
Password property [message #406875] Tue, 06 February 2007 19:31 Go to next message
Eclipse UserFriend
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 #406877 is a reply to message #406875] Tue, 06 February 2007 19:38 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30457
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070004070107090808090307
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

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


--------------070004070107090808090307
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Marcus,<br>
<br>
No, we've never provided such a feature.
Re: Password property [message #406885 is a reply to message #406877] Wed, 07 February 2007 09:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: marcus.tangermann.web.de

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 #406889 is a reply to message #406885] Wed, 07 February 2007 12:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30457
Registered: July 2009
Senior Member
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 #406915 is a reply to message #406889] Wed, 07 February 2007 17:59 Go to previous messageGo to next message
Steve Blass is currently offline Steve BlassFriend
Messages: 276
Registered: July 2009
Senior Member
....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 #406916 is a reply to message #406915] Wed, 07 February 2007 19:39 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30457
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
>
>
Re: Password property [message #406937 is a reply to message #406915] Fri, 09 February 2007 07:49 Go to previous messageGo to next message
Eclipse UserFriend
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 #406938 is a reply to message #406937] Fri, 09 February 2007 11:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30457
Registered: July 2009
Senior Member
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 #406943 is a reply to message #406938] Fri, 09 February 2007 14:53 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
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 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30457
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 ;)
>>> >
>
>
Previous Topic:How to use *.ecore2ecore file?
Next Topic:Help for EMF reading from C#
Goto Forum:
  


Current Time: Sat Sep 21 01:12:08 GMT 2019

Powered by FUDForum. Page generated in 0.03269 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top