@deslop/auth 0.1.1222 → 0.1.1227
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -23
- package/dist/server.js +7 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,28 +1,13 @@
|
|
|
1
1
|
# Deslop Auth
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The sign-in for every Deslop app: GitHub, or a code approved from a browser, phone or agent.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```bash
|
|
6
|
+
npm install --global @deslop/auth
|
|
7
|
+
auth service install --url https://auth.mp281x.xyz --auth https://auth.mp281x.xyz --admins <github-id> --github-client-id <id>
|
|
8
|
+
```
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
- **Secret**: `GITHUB_CLIENT_SECRET` in `~/.deslop/auth.env`.
|
|
11
|
+
- **MCP** at `/mcp`: `answer_request` approves a sign-in by its code.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
| ------------------------------- | -------------------------------- | ---------------------------------- |
|
|
11
|
-
| App or harness | OAuth code at its callback | Browser, phone or `answer_request` |
|
|
12
|
-
| **Sign in with a code** browser | 30-day session, back to its page | A signed-in browser only |
|
|
13
|
-
| GitHub | One-year session | GitHub |
|
|
14
|
-
|
|
15
|
-
- **Waiting page** shows a QR code and the code; leave it open in the client's browser, which completes the localhost callback, never on the phone.
|
|
16
|
-
- **Lifetime**: 10 minutes, in memory; a restart ends the waiting ones. Workers' harness steps: environment skill, Maintenance.
|
|
17
|
-
- **Clients**: the id is the encoded registration, so registering stores nothing. The signed-in list shows `Client · Device`: a known worker, the User-Agent's platform, or the address.
|
|
18
|
-
- **Without `--auth`**, as in a preview, **Sign in with GitHub** returns at once as `dev` (`github:0`), an admin unless `--admins` says otherwise; the session stays on the preview's host. Every other app without `--auth` needs no sign-in.
|
|
19
|
-
- **Sign out** from any app's account menu arrives at `/?sign-out`, which ends the shared session and returns to that app.
|
|
20
|
-
- **Settings**: `--admins` and `--github-client-id` flags; `GITHUB_CLIENT_SECRET` in `~/.deslop/auth.env`.
|
|
21
|
-
- **Storage**: signed-in apps and browsers in its data directory; authorization codes in memory.
|
|
22
|
-
- **Rate limit**: registration, authorization, token, revocation, GitHub and code sign-in requests have a per-minute budget per address (IPv6 /64), 429 past it.
|
|
23
|
-
|
|
24
|
-
## MCP
|
|
25
|
-
|
|
26
|
-
- **Discovery**: each Deslop MCP server's `/.well-known/oauth-protected-resource/mcp` names Auth; no credentials → 401 challenge; rejected bearer → `error="invalid_token"`; Auth down → 503 with `Retry-After`.
|
|
27
|
-
- **Stored credentials prove nothing**: check the client's MCP status and tool discovery. `OAuth authorization required` at startup, or after an auth-store reset: sign the client in to the gateway again.
|
|
28
|
-
- **`answer_request`**: `https://auth.mp281x.xyz/mcp`'s one tool, reached through the [gateway](../gateway/README.md) as `auth__answer_request`.
|
|
13
|
+
Common flags and service commands: [Deslop app runtime](https://github.com/MP281X/deslop/blob/main/packages/runtime/README.md).
|
package/dist/server.js
CHANGED
|
@@ -89006,7 +89006,7 @@ function layerKeyValueStore(directory) {
|
|
|
89006
89006
|
const layerDataStore = unwrap$7(map$5(dataDirectory, layerKeyValueStore));
|
|
89007
89007
|
const layerProtocol = mergeAll$1(layerSchemaBinary(), succeed$6(MaxBodySize)(mebibytes(10)));
|
|
89008
89008
|
const layerTelemetry = unwrap$7(gen(function* () {
|
|
89009
|
-
const name = yield*
|
|
89009
|
+
const name = (yield* packageMetadata).name;
|
|
89010
89010
|
return match$8(yield* option(String$5("OTEL_URL")), {
|
|
89011
89011
|
onNone: () => empty$11,
|
|
89012
89012
|
onSome: (url) => layerOtlp(`${name}-server`, url, "server")
|
|
@@ -89152,17 +89152,20 @@ function systemctl(...args) {
|
|
|
89152
89152
|
const unitDirectory = gen(function* () {
|
|
89153
89153
|
return (yield* Path$1).join(yield* String$5("HOME"), ".config", "systemd", "user");
|
|
89154
89154
|
});
|
|
89155
|
-
const install = fnUntraced(function* (name, command) {
|
|
89155
|
+
const install = fnUntraced(function* (name, command, options) {
|
|
89156
89156
|
const fs = yield* FileSystem;
|
|
89157
89157
|
const path = yield* Path$1;
|
|
89158
89158
|
const home = yield* String$5("HOME");
|
|
89159
89159
|
const directory = yield* unitDirectory;
|
|
89160
89160
|
const unit = `deslop-${name}.service`;
|
|
89161
89161
|
yield* fs.makeDirectory(directory, { recursive: true });
|
|
89162
|
-
yield* fs.writeFileString(path.join(directory, unit), `[Unit]\nDescription=Deslop ${name}\nAfter=network-online.target\n\n[Service]\nType=simple\nEnvironment=NODE_ENV=production\nEnvironment=${systemdArgument(`PATH=${home}/.vite-plus/bin:/usr/local/bin:/usr/bin:/bin`)}\nEnvironmentFile=-${
|
|
89162
|
+
yield* fs.writeFileString(path.join(directory, unit), `[Unit]\nDescription=Deslop ${name}\nAfter=network-online.target\n\n[Service]\nType=simple\nEnvironment=NODE_ENV=production\nEnvironment=${systemdArgument(`PATH=${home}/.vite-plus/bin:/usr/local/bin:/usr/bin:/bin`)}\nEnvironmentFile=-${replaceAll("%", "%%")(`${home}/.deslop/${name}.env`)}\nExecStart=${join$2(map$8(command, systemdArgument), " ")}\nRestart=on-failure\nRestartSec=3\nUMask=0077\n\n[Install]\nWantedBy=default.target\n`, { mode: 384 });
|
|
89163
89163
|
yield* systemctl("daemon-reload");
|
|
89164
89164
|
yield* systemctl("enable", unit);
|
|
89165
|
-
yield* systemctl(
|
|
89165
|
+
yield* systemctl(match$1(options?.restart === false, {
|
|
89166
|
+
onFalse: () => "restart",
|
|
89167
|
+
onTrue: () => "start"
|
|
89168
|
+
}), unit);
|
|
89166
89169
|
return `${unit} installed\n`;
|
|
89167
89170
|
});
|
|
89168
89171
|
const installUpdates = fnUntraced(function* (name, command) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deslop/auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1227",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/MP281X/deslop",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=26"
|
|
34
34
|
},
|
|
35
|
-
"fingerprint": "
|
|
35
|
+
"fingerprint": "33c8e9ec656d6d0ecb755911d55e06fe8fda82c363e5486ab13351a45cae82ce"
|
|
36
36
|
}
|