
br.com.softplan.security.zap.api.authentication.AuthenticationHandlerFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zap-client-api Show documentation
Show all versions of zap-client-api Show documentation
Java client API for the OWASP Zed Attack Proxy (ZAP), built on top of the official ZAP Java API
package br.com.softplan.security.zap.api.authentication;
import br.com.softplan.security.zap.api.model.AuthenticationInfo;
import br.com.softplan.security.zap.commons.ZapInfo;
import br.com.softplan.security.zap.zaproxy.clientapi.core.ClientApi;
/**
* Factory to create the correct {@link AuthenticationHandler} based on the given {@link AuthenticationInfo} instance.
*
* @author pdsec
*/
public final class AuthenticationHandlerFactory {
public static AuthenticationHandler makeHandler(ClientApi api, ZapInfo zapInfo, AuthenticationInfo authenticationInfo) {
if (authenticationInfo == null) {
return null;
}
switch (authenticationInfo.getType()) {
case FORM: return new FormAuthenticationHandler(api, zapInfo, authenticationInfo);
case CAS: return new CasAuthenticationHandler(api, zapInfo, authenticationInfo);
case SELENIUM: return new SeleniumAuthenticationHandler(api, zapInfo, authenticationInfo);
case HTTP: return new HttpAuthenticationHandler(api, zapInfo, authenticationInfo);
default: return null;
}
}
private AuthenticationHandlerFactory() {}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy