open-index/open-npm huggingface dataset:
npm package: @opencast/jwtify
Description: Authenticate Opencast static file requests with JWT via service workers
Author: The Opencast project
Latest version: 0.1.3

# jwtify ("jotify")

A TypeScript library for injecting JWTs into static file requests via service workers.
Can be used by applications that wish to use static files from Opencast, authorized via JWTs.
This library intercepts all Opencast requests, injecting a JWT as appropriate.
The JWT must be supplied by you (via specified callback).
Supports batching and caching.

> **Note**: still in early development!

TOOD: explain more, describe how to use.
npm package: @opencast/tobira-authkit
Description: Helper library to implement your own auth logic for Tobira
Author: The Opencast project
Latest version: 0.2.0

# `@opencast/tobira-authkit`: Helper for building your own Tobira auth handler

This library enables you to build your own login handler that can be used with Tobira.
Useful mostly for using the login callbacks or for intercepting login requests.
See [the documentation](https://elan-ev.github.io/tobira/next/setup/auth/user/tobira-session) for context and more information.

## API

The API is described only very briefly here as all public functions and types are documented in code.
There are two main entry points: `runLoginCallbackServer` (for `login-callback`) and `runLoginProxyServer` (for intercepting login requests).

```typescript
import { runLoginCallbackServer, LoginCheck } from "@opencast/tobira-authkit";

await runLoginCallbackServer({
    check: myCheckFunction,
    // ... other options
});

const myCheckFunction: LoginCheck = async ({ userid, password }) => { ... };
```

This starts an HTTP server that handles login requests by calling the provided `check` function.
Said function can either return `"forbidden"` or an object describing the user.