- Rust 85%
- JavaScript 15%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| examples | ||
| scripts | ||
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE.md | ||
| README.md | ||
@unilim/biome
Biome profile bindings for Unilim, compiled from Rust to WebAssembly.
Install
npm install @unilim/biome @unilim/cas
A Biome session is opened from a CAS session: @unilim/biome receives a CAS
object from @unilim/cas across the
JS boundary, so install both.
Usage
import { CAS } from "@unilim/cas";
import { Biome } from "@unilim/biome";
// any CAS session (restore / initialize+2FA / temporary)
const cas = await CAS.restore(username, password, connection, key);
const biome = await Biome.fromCAS(cas);
console.log(biome.username, biome.roles);
console.log(await biome.profile());
How the CAS object is shared
Biome.fromCAS(cas) takes the live CAS object, not a cookie string. This crate
depends on unilim-cas and sources the CAS type from it:
- wasm —
unilim_cas::boundary(extern declarations of@unilim/cas'sCAS/OAuth2); biome calls the object's methods across the JS boundary and links no CAS client. - native —
unilim_cas::client::Cas(the real Rust client);from_castakes a&Casand calls its methods directly, so it works off-wasm too.