eve-hub 0.16.20 → 0.16.21
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.
|
@@ -7,6 +7,8 @@ import { isHubRequest } from "../hub-oidc.mjs";
|
|
|
7
7
|
// a local-dev request, or one from the hub (a deployed bot, see hub-oidc.mjs). Resolving it as a user lets user-scoped
|
|
8
8
|
// connections (open_pull_request's OAuth) key tokens to the configured human;
|
|
9
9
|
// `localDev()` alone is not a user, so eve fails them with principal_required.
|
|
10
|
+
// eve serves `GET /eve/v1/info` only to operator principals; the hub reads it as this user to learn the bot's
|
|
11
|
+
// schedules and tools (hosted-hub readDeployment), so a request that passed the hub check may read it too.
|
|
10
12
|
const dev = localDev();
|
|
11
13
|
async function rosterUser(req) {
|
|
12
14
|
const user = req.headers.get("x-roster-user");
|
|
@@ -14,7 +16,7 @@ async function rosterUser(req) {
|
|
|
14
16
|
return null;
|
|
15
17
|
if (!(await dev(req)) && !(await isHubRequest(req, getVercelOidcToken)))
|
|
16
18
|
return null;
|
|
17
|
-
return { authenticator: "roster", principalId: `roster:${user}`, principalType: "user", attributes: {} };
|
|
19
|
+
return { authenticator: "roster", principalId: `roster:${user}`, principalType: "user", attributes: {}, allowAgentInfo: true };
|
|
18
20
|
}
|
|
19
21
|
// No turnPolicy: eve's default steers a message into the running turn at its
|
|
20
22
|
// next step. The registry sends turnPolicy "queue" for a bot's message, so it
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eve-hub",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.21",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Bot-side code shared by every hub agent: registry tools, the roster hook, the eve channel, the host sandbox and browser, and model helpers.",
|
|
6
6
|
"type": "module",
|