Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pilcrowOnPaper/oslo
A collection of auth-related utilities
https://github.com/pilcrowOnPaper/oslo
Last synced: 11 days ago
JSON representation
A collection of auth-related utilities
- Host: GitHub
- URL: https://github.com/pilcrowOnPaper/oslo
- Owner: pilcrowonpaper
- License: mit
- Created: 2023-10-15T12:58:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-20T14:23:31.000Z (27 days ago)
- Last Synced: 2024-10-30T13:05:11.208Z (17 days ago)
- Language: TypeScript
- Homepage: https://oslo.js.org
- Size: 424 KB
- Stars: 1,086
- Watchers: 6
- Forks: 35
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# `oslo`
> [!IMPORTANT]
> **This package will be deprecated by the end of 2024.** Please use the packages published under the [Oslo project](https://oslojs.dev) instead.A collection of auth-related utilities, including:
- `oslo/cookie`: Cookie parsing and serialization
- `oslo/crypto`: Generate hashes, signatures, and random values
- `oslo/encoding`: Encode base64, base64url, base32, hex
- `oslo/jwt`: Create and verify JWTs
- `oslo/oauth2`: OAuth2 helpers
- `oslo/otp`: HOTP, TOTP
- `oslo/password`: Password hashing
- `oslo/request`: CSRF protection
- `oslo/webauthn`: Verify Web Authentication API attestations and assertionsAside from `oslo/password`, every module works in any environment, including Node.js, Cloudflare Workers, Deno, and Bun.
Documentation: https://oslo.js.org
## Installation
```
npm i oslo
pnpm add oslo
yarn add oslo
```## Node.js
For Node.js 16 & 18, you need to polyfill the Web Crypto API. This is not required in Node.js 20.
```ts
import { webcrypto } from "node:crypto";globalThis.crypto = webcrypto;
```Alternatively, add the `--experimental-global-webcrypto` flag when running Node.
```
node --experimental-global-webcrypto index.js
```