Refactor: Simplify user authentication flow

- Remove redundant password validation logic
 - Integrate JWT-based session management for improved security and scalability
This commit is contained in:
Eric Coissac
2026-04-29 08:45:49 +02:00
parent 97e65bd831
commit 4e26e3bd40
8 changed files with 1030 additions and 2 deletions
+23 -1
View File
@@ -32,7 +32,7 @@
use std::io::{self, Write};
use obikseq::{kmer::Kmer, superkmer::SuperKmer};
use obikseq::{kmer::Kmer, superkmer::SuperKmer, unitig::Unitig};
use xxhash_rust::xxh64::xxh64;
// ── public API ────────────────────────────────────────────────────────────────
@@ -118,6 +118,28 @@ pub fn write_count<W: Write>(
out.write_all(b"\n")
}
/// Write one unitig in FASTA format.
///
/// Header annotation (JSON):
/// ```text
/// >HASH {"seq_length":<seql>,"kmer_size":<k>,"n_kmers":<seql-k+1>}
/// ```
///
/// `HASH` is the xxHash-64 of the ASCII sequence (16 uppercase hex digits).
/// `n_kmers` is the number of distinct k-mers covered by this unitig.
pub fn write_unitig<W: Write>(unitig: &Unitig, k: usize, out: &mut W) -> io::Result<()> {
let ascii = unitig.to_ascii();
let id = seq_id(&ascii);
let seql = unitig.seql();
let n_kmers = seql - k + 1;
writeln!(
out,
">{id} {{\"seq_length\":{seql},\"kmer_size\":{k},\"n_kmers\":{n_kmers}}}",
)?;
out.write_all(&ascii)?;
out.write_all(b"\n")
}
// ── internal helpers ──────────────────────────────────────────────────────────
/// xxHash-64 of the ASCII sequence, formatted as 16 uppercase hex digits.