Skip to content

Update ZAP Go Package, Fix Generation Issues, and Autogenerate Interface#21

Open
alessiodallapiazza wants to merge 14 commits into
zaproxy:masterfrom
alessiodallapiazza:master
Open

Update ZAP Go Package, Fix Generation Issues, and Autogenerate Interface#21
alessiodallapiazza wants to merge 14 commits into
zaproxy:masterfrom
alessiodallapiazza:master

Conversation

@alessiodallapiazza

Copy link
Copy Markdown

Hello,

I would like to try the ZAP API, but I noticed that the Go package is not updated, which is discouraging for users who want to use it with Go. As a result, I decided to fork the repository and implement some updates and fixes. Here are the changes I made:

  • Readme Update:
    Updated the README file to reflect the latest changes and improvements.

  • Autogenerated Interface:
    Created a script to autogenerate the interface.go file to accommodate the updated interfaces.
    Ensured the interfaces reflect the current structure and functionality.

  • Folder Structure Changes:
    Adjusted the folder structure to align with the new generation process.

I hope these changes are helpful. Please let me know if there are any additional modifications or improvements needed.

Best regards,

@kingthorin

Copy link
Copy Markdown
Member

Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
Signed-off-by: Alessio Dalla Piazza <alessio.dallapiazza@gmail.com>
@alessiodallapiazza

Copy link
Copy Markdown
Author

Hello,
I have addressed the DCO requirement by signing off the commits.

Comment thread .gitignore
Comment on lines +25 to +27

zaproxy/
zap-extensions/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be removed, the repos should live at the same level as the zap-api-go not under it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we link these two projects as submodules instead? This way, users won't need to clone them manually into the correct location. I added them to the .gitignore file to ensure they are not committed accidentally.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repos are already cloned, per dev guide.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong, why are they prefixed with zap-api-go now? Was that because of the clone under the repo?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might have been some changes in the generation script. I followed the instructions in the README and executed the commands using Gradle.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case the instructions were not followed correctly.

@@ -1,264 +1,246 @@
// Zed Attack Proxy (ZAP) and its related class files.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be kept.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interface.go file is now automatically generated using a bash script. I will update the template to include the previous comments.

package zap

// Interface defines the interface a ZAP client should implement
type Interface interface {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should still be sorted.

@alessiodallapiazza alessiodallapiazza Jul 19, 2024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will sort them in the bash script 👍

@mieliespoor

Copy link
Copy Markdown

Anything we can do to progress this? I need this library updated for 2.15, so if we could complete this and tag the specific versions of ZAP, it would be great.

@mieliespoor

Copy link
Copy Markdown

@alessiodallapiazza Anything that can be done to try and resurrect this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants