Skip to content

Commit

Permalink
script template updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kberg committed Jun 12, 2020
1 parent 90eb898 commit 911eca6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,27 @@ import org.parosproxy.paros.network.HttpRequestHeader
import org.zaproxy.zap.authentication.AuthenticationHelper
import org.zaproxy.zap.authentication.GenericAuthenticationCredentials

val PARAM_TARGET_URL = "targetUrl"

fun authenticate(
helper: AuthenticationHelper,
paramsValues: Map<String, String>,
credentials: GenericAuthenticationCredentials): HttpMessage {

println("Kotlin auth template")
println("creds: $credentials")
println("PARAM: ${paramsValues["exampleParam1"]}")

println("TARGET_URL: ${paramsValues[PARAM_TARGET_URL]}")
val msg = helper.prepareMessage()
msg.requestHeader = HttpRequestHeader(HttpRequestHeader.GET, URI("http://localhost:3000", true), HttpHeader.HTTP11)
msg.requestHeader = HttpRequestHeader(HttpRequestHeader.GET, URI(paramsValues[PARAM_TARGET_URL], true),
HttpHeader.HTTP11)
println("msg: $msg ${msg.requestHeader.headers.size}")
msg.requestHeader.headers.forEach { println(it) }
helper.sendAndReceive(msg)
return msg
}

fun getRequiredParamsNames(): Array<String> {
return arrayOf("exampleParam1")
return arrayOf(PARAM_TARGET_URL)
}

fun getOptionalParamsNames(): Array<String> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
import org.parosproxy.paros.network.HttpMessage

val msg = HttpMessage()
println(msg)
println("freedom")
println("KaaKaawwtlin!!")

0 comments on commit 911eca6

Please sign in to comment.