@openneuro/search 4.12.6 → 4.13.0-alpha.0

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/dist/auth.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Create a dataset:indexing scoped token for search indexing */
2
- export declare function indexingToken(): string;
2
+ export declare function indexingToken(secret: string): string;
3
3
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,wBAAgB,aAAa,IAAI,MAAM,CAQtC"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQpD"}
package/dist/auth.js CHANGED
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.indexingToken = void 0;
7
7
  const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
8
8
  /** Create a dataset:indexing scoped token for search indexing */
9
- function indexingToken() {
9
+ function indexingToken(secret) {
10
10
  return jsonwebtoken_1.default.sign({
11
11
  scopes: ['dataset:indexing'],
12
- }, process.env.JWT_SECRET || process.env.JEST_WORKER_ID, { expiresIn: 60 * 60 * 3 });
12
+ }, secret, { expiresIn: 60 * 60 * 3 });
13
13
  }
14
14
  exports.indexingToken = indexingToken;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openneuro/search",
3
- "version": "4.12.6",
3
+ "version": "4.13.0-alpha.0",
4
4
  "description": "OpenNeuro search client functions.",
5
5
  "main": "dist/index.js",
6
6
  "browser": "src/index.ts",
@@ -22,14 +22,12 @@
22
22
  "devDependencies": {
23
23
  "@babel/runtime-corejs3": "^7.13.10",
24
24
  "@types/jsonwebtoken": "^8",
25
- "@types/node": "16.11.13",
26
- "core-js": "^3.10.1"
27
- },
28
- "jest": {
29
- "testEnvironment": "node"
25
+ "@types/node": "18.11.9",
26
+ "core-js": "^3.10.1",
27
+ "vitest": "^0.25.2"
30
28
  },
31
29
  "publishConfig": {
32
30
  "access": "public"
33
31
  },
34
- "gitHead": "fd4d356ca0e88b7a061e0c1feceb07968feed50d"
32
+ "gitHead": "fe4c230250d73e24a758a0bce058b23aa93d0aee"
35
33
  }
package/src/auth.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import jwt from 'jsonwebtoken'
2
2
 
3
3
  /** Create a dataset:indexing scoped token for search indexing */
4
- export function indexingToken(): string {
4
+ export function indexingToken(secret: string): string {
5
5
  return jwt.sign(
6
6
  {
7
7
  scopes: ['dataset:indexing'],
8
8
  },
9
- process.env.JWT_SECRET || process.env.JEST_WORKER_ID,
9
+ secret,
10
10
  { expiresIn: 60 * 60 * 3 }, // 3 hours
11
11
  )
12
12
  }