zaproxy icon indicating copy to clipboard operation
zaproxy copied to clipboard

added copy options rules feature

Open aayushhyadav opened this issue 3 years ago • 17 comments

related to #7767

aayushhyadav avatar Mar 15 '23 02:03 aayushhyadav

Will the Duplicate option be valid for all such dialogs? Might be better to have an allowDuplication option (as per allowModification) with the default as false. That way we can enable it per dialog and then double check it works. We dont really have any UI unit tests so we'd need to manually test these anyway...

psiinon avatar Mar 15 '23 11:03 psiinon

So will have to update AbstractMultipleOptionsBaseTablePanel( AbstractMultipleOptionsBaseTableModel<E> model, boolean allowModification) by adding another parameter of allowduplicate right? This currently has 3 usages, so do you mean that I should pass false from all 3 instances?

aayushhyadav avatar Mar 15 '23 14:03 aayushhyadav

Any idea how to resolve the build issue? I have tried to clean and build the project but the issue persists.

aayushhyadav avatar Mar 24 '23 16:03 aayushhyadav

You need to keep binary compatibility, e.g. add a new constructor instead of changing that one.

thc202 avatar Mar 24 '23 16:03 thc202

Will the Duplicate option be valid for all such dialogs? Might be better to have an allowDuplication option (as per allowModification) with the default as false. That way we can enable it per dialog and then double check it works. We dont really have any UI unit tests so we'd need to manually test these anyway...

I have added the allowDuplication option and passed the same value as that of allowModification at all instances

aayushhyadav avatar Mar 24 '23 16:03 aayushhyadav

You need to keep binary compatibility, e.g. add a new constructor instead of changing that one.

I am trying to add something like protected AbstractMultipleOptionsBaseTablePanel(boolean allowDuplicate). From where should I invoke this constructor? I cannot use the this(false) from public AbstractMultipleOptionsBaseTablePanel(AbstractMultipleOptionsBaseTableModel<E> model) or protected AbstractMultipleOptionsBaseTablePanel(AbstractMultipleOptionsBaseTableModel<E> model, boolean allowModification) as they already use this and super respectively.

aayushhyadav avatar Mar 25 '23 09:03 aayushhyadav

One more query, can't we use the allowModification flag for duplicate functionality? So duplicate will only be available when modify is present. Or is it necessary to have them independent of each other?

aayushhyadav avatar Mar 25 '23 09:03 aayushhyadav

They should be independent. There may be situations where modifying one is fine but duplicating isn’t and vice versa.

kingthorin avatar Mar 25 '23 10:03 kingthorin

https://github.com/zaproxy/zaproxy/pull/7783#issuecomment-1483781358

You can change the implementation of the existing constructors just not their signature.

thc202 avatar Mar 25 '23 20:03 thc202

#7783 (comment)

You can change the implementation of the existing constructors just not their signature.

Is the current approach fine?

aayushhyadav avatar Mar 26 '23 03:03 aayushhyadav

See https://github.com/zaproxy/zaproxy/pull/7783#discussion_r1148520421

thc202 avatar Mar 26 '23 10:03 thc202

Could anyone please review the changes? Are anymore changes required?

aayushhyadav avatar Apr 14 '23 10:04 aayushhyadav

I'd be happy to finish this, any further feedback?

kingthorin avatar Sep 06 '24 19:09 kingthorin


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


Posted by the CLA Assistant Lite bot.

github-actions[bot] avatar Apr 10 '25 15:04 github-actions[bot]

Logo Checkmarx One – Scan Summary & Details07d4f7f0-065d-4148-971c-2d68cfa25e88

Great job, no security vulnerabilities found in this Pull Request

psiinon avatar Apr 10 '25 16:04 psiinon

Closing the dialogue window should cancel the Duplicate operation, and the new entry should not appear, right?

tomaszn avatar Apr 11 '25 16:04 tomaszn

That seems logical to me.

kingthorin avatar Apr 11 '25 16:04 kingthorin