The LineWebhook plugin is used to verify the signature of incoming webhooks. This ensures that the webhooks are from a trusted source.
implementation("io.github.cotrin8672:ktor-line-webhook-plugin:1.5.0")
Install this plugin only on endpoints that receive webhooks.
route("/callback") {
install(DoubleReceive)
install(LineSignatureVerification) {
channelSecret = System.getenv("CHANNEL_SECRET")
}
post {
call.respond(HttpStatusCode.OK)
}
}