mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 04:37:00 +00:00
feat: Add Prometheus metrics endpoint
This commit is contained in:
1 parent
ea96858c4a
commit
f14c401f39
25 files changed
+652
-46
No files matched your search
@@ -49,6 +49,17 @@ where
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// Compare two strings without short-circuiting on the first mismatch, for
|
||||
/// checking secrets.
|
||||
#[must_use]
|
||||
pub fn constant_time_eq(a: &str, b: &str) -> bool {
|
||||
a.len() == b.len()
|
||||
&& a.bytes()
|
||||
.zip(b.bytes())
|
||||
.fold(0_u8, |acc, (x, y)| acc | (x ^ y))
|
||||
== 0
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn camel_to_snake_string(s: &str) -> String {
|
||||
|
||||
Reference in new issue
Block a user