Rename token to secret

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2024-07-10 14:18:28 +02:00
commit 407788af5a
No known key found for this signature in database
GPG key ID: DEDA74AEECA9D0F2
3 changed files with 17 additions and 17 deletions

View file

@ -56,9 +56,9 @@ struct Config {
#[serde(default = "default_nickname")]
nickname: String,
/// Token to match the one provided by the Webhook service
#[serde(rename = "webhook-token")]
webhook_token: String,
/// Secret that matches the one provided to the Webhook service
#[serde(rename = "secret")]
secret: String,
/// HTTP Webhook listening address and port, e.g., 127.0.0.1:1234 or [::1]:1234
#[serde(default = "default_addr")]
@ -140,8 +140,8 @@ async fn main() -> Result<!, Error> {
);
let tcp_bind = TcpListener::bind(config.addr).await?;
let token: &'static String =
unsafe { core::mem::transmute::<&String, &'static String>(&config.webhook_token) };
let secret: &'static String =
unsafe { core::mem::transmute::<&String, &'static String>(&config.secret) };
let value_tx = Arc::new(Mutex::new(value_tx));
loop {
@ -158,7 +158,7 @@ async fn main() -> Result<!, Error> {
.serve_connection(io, service_fn(|request| {
let value_tx = value_tx.clone();
async move {
hooks(request, token, value_tx).await
hooks(request, secret, value_tx).await
}
}))
.await