On 2012/10/16 14:07:44, jiri.hnidek wrote: Hi, I use this for first time. There are some ...
12 years, 5 months ago
(2012-10-16 14:14:41 UTC)
#2
On 2012/10/16 14:07:44, jiri.hnidek wrote:
Hi,
I use this for first time. There are some additional informations. This patch
add new subtype PASSWORD used for typing text that should not be displayed in UI
(usually passwords :-)). It could be useful for many Python scripts.
Example of Python script using this new subtype:
- https://dl.dropbox.com/u/369894/draw_op_passwd.py
Screenshot of dialog using this new subtype:
- https://dl.dropbox.com/u/369894/blender-password.png
I added some comments to source code. https://codereview.appspot.com/6713044/diff/1/source/blender/editors/interface/interface_widgets.c File source/blender/editors/interface/interface_widgets.c (right): https://codereview.appspot.com/6713044/diff/1/source/blender/editors/interface/interface_widgets.c#newcode985 source/blender/editors/interface/interface_widgets.c:985: Following code ...
12 years, 5 months ago
(2012-10-22 10:09:16 UTC)
#3
On 2012/10/16 14:07:44, jiri.hnidek wrote: I was asked by Ton to add use cases and ...
12 years, 5 months ago
(2012-10-22 12:11:24 UTC)
#4
On 2012/10/16 14:07:44, jiri.hnidek wrote:
I was asked by Ton to add use cases and some security notes.
Use cases:
* This new subtype of string property is intended mostly for Add-on developers
writing Add-on which communicates with some server (http, sql, ftp, verse,
etc.). When this server requires user authentication and user has to type
username and password, then current API doesn't allow to type 'hidden' password,
e.g. when you want to demonstrate this script, then everybody can see this
security password. Some examples of Add-on which could use this new subtype:
- On-line database of textures
- Integration of render farm
- Integration of Verse (Yes, I just try to write some Verse2 Add-on :-))
Security Notes:
* You can copy paste string of property from text input using (Ctrl-C, Ctrl-V),
but you can do this in other GUI toolkits too (this behavior it is widely used).
* Text of string property is stored in plain text, but it is widely used. Look
at other GUI toolkits. They don't try to solve this issue too. Example of Qt
documentation: http://doc.qt.digia.com/3.3/qlineedit.html#EchoMode-enum
- Add-on developers expect string property in plain text.
- Look at this example using new subtype of string property:
https://dl.dropbox.com/u/369894/draw_op_passwd.py
- Add-on developer is responsible for sending password over network in secure
way, not Blender API.
- Each network protocol requires different password protection.
* Some evil Add-on can try to steal this plain text password, but it would be
complicated and useless to solve this issue, because Add-on developers expect
string property in plain text.
https://codereview.appspot.com/6713044/diff/1/source/blender/editors/interface/interface_widgets.c File source/blender/editors/interface/interface_widgets.c (right): https://codereview.appspot.com/6713044/diff/1/source/blender/editors/interface/interface_widgets.c#newcode953 source/blender/editors/interface/interface_widgets.c:953: * \brief This function convert password string that should ...
12 years, 5 months ago
(2012-10-22 17:16:42 UTC)
#5
On 2012/10/22 17:29:53, brechtvl wrote: > It seems that the 'bullet' character does work with ...
12 years, 5 months ago
(2012-10-22 19:39:32 UTC)
#7
On 2012/10/22 17:29:53, brechtvl wrote:
> It seems that the 'bullet' character does work with our font, which looks
pretty
> good to me typing it into a text field in blender.
> http://www.fileformat.info/info/unicode/char/2022/index.htm
Hi Brecht,
Thanks for review. I thought that Blender uses
release/datafiles/fonts/droidsans.ttf.gz in all parts of UI. BTW: Blender text
editor can display 'black circle' character, which would be IMHO better, because
'bullet' character looks too small.
Anyway, when any UTF-8 character longer then one byte is used, then this hack
doesn't work properly. Blender places cursor at wrong place and it can cause
crash of Blender. When simple 'asterisk' character is used, then this hack works
without any problem.
If there's issues placing the cursor, then I fear using an asterisk will not work ...
12 years, 5 months ago
(2012-10-22 20:02:46 UTC)
#8
If there's issues placing the cursor, then I fear using an asterisk will not
work when the user is typing UTF-8 characters longer than one byte? There would
still be a mismatch, just not as common.
It might be a tricky issue to solve though, and such passwords are probably not
common.
On 2012/10/22 20:02:46, brechtvl wrote: > If there's issues placing the cursor, then I fear ...
12 years, 5 months ago
(2012-10-22 20:22:30 UTC)
#9
On 2012/10/22 20:02:46, brechtvl wrote:
> If there's issues placing the cursor, then I fear using an asterisk will not
> work when the user is typing UTF-8 characters longer than one byte? There
would
> still be a mismatch, just not as common.
>
> It might be a tricky issue to solve though, and such passwords are probably
not
> common.
When user types UTF-8 character longer than one byte, then hack with 'asterisk'
character works without any problem.
I can still see issue when typing such UTF-8 characters, even with the asterisks, the ...
12 years, 5 months ago
(2012-10-25 20:18:23 UTC)
#10
I can still see issue when typing such UTF-8 characters, even with the
asterisks, the cursor position and selection are drawing wrong. Also placing the
cursor gives issue, but that's because ui_textedit_set_cursor_pos does not take
things into account.
Anyway, I modified the implementation, hope you don't mind, patch here:
http://www.pasteall.org/36595/diff
On 2012/10/25 20:18:23, brechtvl wrote: > I can still see issue when typing such UTF-8 ...
12 years, 5 months ago
(2012-10-26 12:35:40 UTC)
#11
On 2012/10/25 20:18:23, brechtvl wrote:
> I can still see issue when typing such UTF-8 characters, even with the
> asterisks, the cursor position and selection are drawing wrong. Also placing
the
> cursor gives issue, but that's because ui_textedit_set_cursor_pos does not
take
> things into account.
>
> Anyway, I modified the implementation, hope you don't mind, patch here:
> http://www.pasteall.org/36595/diff
Hi Brecht,
thanks for your patch. It seems that everybody use git for blender development
despite blender has official svn repository ;-). BTW: I found this tool very
helpful:
https://gist.github.com/721622
I uploaded your patch with small modifications to codereview. I hope that it was
uploaded corectly, because scripting for uploading was ended with some weired
errors. Anyway, I made BLI_strlen_utf8_char not static function and I added more
comments to source code.
Issue 6713044: Blender password text input
Created 12 years, 5 months ago by jiri.hnidek
Modified 12 years, 5 months ago
Reviewers: bf-codereview_blender.org, brechtvl
Base URL: https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Comments: 5