Context import / export

428 views
Skip to first unread message

psiinon

unread,
Jul 15, 2014, 12:42:31 PM7/15/14
to zaproxy...@googlegroups.com
I've just committed changes to support context import /export.
There are some known issues around importing users, these will be addressed asap.

To import or export a context you need to open the Session dialog and select the "Contexts" page.
Not sure if this is obvious enough - should there be an 'Import Context' in the File menu maybe? Other suggestions appreciated too :)

By default all contexts will be stored in a "contexts" directly underneath the 'user directory'. You can navigate away, but that will always be the default location.
I'm thinking of following the same approach for scan policies, as we can then present a simple pulldown of policies rather than always asking for them to be loaded from a file.
Shout if you dont like this approach!

Oh, and context import/export is also supported via the API :)

Cheers,

Simon

Cosmin Stefan-Dobrin

unread,
Jul 15, 2014, 12:56:38 PM7/15/14
to zaproxy...@googlegroups.com
Looks great.

Regarding starting this, I would vote for also adding an entry in the File menu as it's the place where, in most apps, you would find some 'Import/Export' functionality. In the future we might add more things to import/export and the only 'common' place for them would be there.

Thanks for this,
Cosmin

--
You received this message because you are subscribed to the Google Groups "OWASP ZAP Developer Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zaproxy-devel...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cosmin Stefan-Dobrin

unread,
Jul 15, 2014, 2:43:12 PM7/15/14
to zaproxy...@googlegroups.com
Hello again,

I've just realised there are 2 more aspect which  exist related to where the "Import/Export Context" actions are placed. The fact that they are placed in the Session Properties has some implications regarding the Save/Cancel state of the dialog:
  1. when importing a context, right now hitting Cancel after a successful import has no effect, as the Context was already imported. Also, there might be some sync issues because the Session Properties dialog is using some cloned contexts (named uiSharedContext or something like that) instead of the real (saved in the Session)  contexts. Changes are migrated from one to another on init and on pressing Save.
  2. when exporting a context, which state of the context is stored.The current one (uiSharedContext) or the one that was last saved/persisted (context)? Right now, the changes to the Context are persisted only when hitting Save, and the Export saves (probably) the persisted Context, so we might end up with a scenario where the user did some changes and exported right away (without hitting Save) and then, when importing, (s)he sees something different from the last thing.

The easy fix for these issues would be to remove the options completely from inside the Session Properties dialog. And, in a way, I _personally_ don't find it that annoying or un-intuitive to import/export the contexts from there and then just go to Session Properties to change things. Just as it happens when we are opening a Session.

The other alternative is to remove any possible synchronization issues due to the uiSharedContext/context aspect and make sure we have a consistent behaviour for Save/Cancel.

Cosmin

psiinon

unread,
Jul 15, 2014, 4:10:00 PM7/15/14
to zaproxy...@googlegroups.com
Hum, you've just convinced me to move the Context import/export from the Session dialog to the Files menu :)
I was a bit concerned about the lack of visibility of these options, but hadnt thought through the consistency problems with changes to the dialog fields.
Moving the options fixed both of these problems - I'll do that tomorrow unless anyone has some counter arguments...

Good call!

Simon
Cosmin


To unsubscribe from this group and stop receiving emails from it, send an email to zaproxy-develop+unsubscribe@googlegroups.com.

psiinon

unread,
Jul 16, 2014, 9:42:59 AM7/16/14
to zaproxy...@googlegroups.com
I've just committed the changes to move the Context import/export buttons to the File menu.
Any issues please let me know.

Simon
Reply all
Reply to author
Forward
0 new messages