Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to add/remove authentication and session management methods #7857

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

forgedhallpass
Copy link

@forgedhallpass forgedhallpass commented May 9, 2023

Implemented option to dynamically add AuthenticationMethodTypes and SessionManagementMethodTypes from extensions to be used through the REST API.

Closes #2620

Signed-off-by: forgedhallpass <13679401+forgedhallpass@users.noreply.github.com>
@thc202
Copy link
Member

thc202 commented May 10, 2023

I guess this is WIP since only addresses part of the referenced issue?

@thc202
Copy link
Member

thc202 commented May 10, 2023

Please, check this comment as well: #6218 (comment) (to make sure it addresses those cases).

@thc202 thc202 changed the title Allow to add/remove authentication methods #2620 Allow to add/remove authentication methods May 10, 2023
@forgedhallpass
Copy link
Author

I guess this is WIP since only addresses part of the referenced issue?

For this particular PR the scope was only the authentication, as the title suggests. That is why the ticket was only referenced via its ID, but without any of the fixes, closes etc. keywords.

That being said, if I'll have time I might consider looking into the other part as well, because it should be fairly similar. Will get back to you on this.

Signed-off-by: forgedhallpass <13679401+forgedhallpass@users.noreply.github.com>
* reformat code with spotless

Signed-off-by: forgedhallpass <13679401+forgedhallpass@users.noreply.github.com>
@forgedhallpass forgedhallpass changed the title Allow to add/remove authentication methods Allow to add/remove authentication and session management methods May 18, 2023
forgedhallpass added a commit to forgedhallpass/zap-extensions that referenced this pull request May 18, 2023
…es through API

* related PR on ZAP: zaproxy/zaproxy#7857

Signed-off-by: forgedhallpass <13679401+forgedhallpass@users.noreply.github.com>
@forgedhallpass
Copy link
Author

@kingthorin @thc202 the second part, related to session management has also been added to the PR.

@@ -106,8 +113,9 @@ public String getUIName() {
@Override
public void hook(ExtensionHook extensionHook) {
super.hook(extensionHook);
this.extensionHook = extensionHook;
Copy link
Member

Choose a reason for hiding this comment

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

This will not work, once the hook phase is done any additions to the extensionHook have no effect.

Copy link
Author

Choose a reason for hiding this comment

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

I am not entirely sure I understand what do you mean. Adding a new AbstractAuthenticationMethodOptionsPanel to the UI from a ZAP extension through a dynamically added AuthenticationMethodType was working.

Copy link
Member

Choose a reason for hiding this comment

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

The class AbstractAuthenticationMethodOptionsPanel is unrelated to the ExtensionHook (that's part of the method itself), change your method to use the extensionHook. Start ZAP, install your add-on, and see if it works properly.

@thc202
Copy link
Member

thc202 commented May 20, 2023

This is now closing the issue but it still lacks necessary functionality (most of the points mentioned in #6218 (comment)).

@forgedhallpass
Copy link
Author

This is now closing the issue but it still lacks necessary functionality (most of the points mentioned in #6218 (comment)).

I believe the PR covers what the ticket is asking for. I've tested it and it's working. Your points around the contexts, together with the support for reloading add-ons is a separate topic itself.

Please note that first time contributors might not have the full picture of the project. If you create a follow-up ticket and provide clear requirements I might give it a shot.

@thc202
Copy link
Member

thc202 commented May 23, 2023

They are not separate topics, the authentication and session management methods are an integral part of the contexts (see Context class, fields authenticationMethod and sessionManagementMethod). The add-ons can be dynamically installed/updated/removed at anytime so the core code must properly support dynamically adding/removing the methods.

I don't expect anyone to know everything, if the issue is not clear enough just ask. I linked the other comment because it mentions what needs to be considered to address the issue. If you prefer that I update the issue with those points I can do that as well.

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

Successfully merging this pull request may close these issues.

Allow to add/remove authentication and session management methods
3 participants