Emil Kantis
11/08/2022, 10:48 AMvishesh
11/08/2022, 10:57 AMAndrew O'Hara
11/08/2022, 1:42 PMinstall(Authentication) {
basic("auth-basic") {
realm = "Access to the '/' path"
validate { credentials ->
if (credentials.name == "jetbrains" && credentials.password == "foobar") {
UserIdPrincipal(credentials.name)
} else {
null
}
}
}
}
Each of the assignment operations in basic
is mutating the config, and then when the lambda ends, the config is used to construct the actual implementation. Interesting way to go about it.