@openneuro/server 4.39.3 → 4.40.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openneuro/server",
3
- "version": "4.39.3",
3
+ "version": "4.40.0",
4
4
  "description": "Core service for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "src/server.js",
@@ -21,7 +21,7 @@
21
21
  "@elastic/elasticsearch": "8.13.1",
22
22
  "@graphql-tools/schema": "^10.0.0",
23
23
  "@keyv/redis": "^4.5.0",
24
- "@openneuro/search": "^4.39.3",
24
+ "@openneuro/search": "^4.40.0",
25
25
  "@sentry/node": "^8.25.0",
26
26
  "@sentry/profiling-node": "^8.25.0",
27
27
  "base64url": "^3.0.0",
@@ -89,5 +89,5 @@
89
89
  "publishConfig": {
90
90
  "access": "public"
91
91
  },
92
- "gitHead": "3e1759c268a8d8fdcfefec51958ff76523998174"
92
+ "gitHead": "baf55d83b1f1e148cf68e281a89ec8b2b2f003e9"
93
93
  }
@@ -135,9 +135,6 @@ describe("contributors (core functionality)", () => {
135
135
  })
136
136
 
137
137
  expect(result).toEqual([])
138
- expect(mockSentryCaptureMessage).toHaveBeenCalledWith(
139
- `Datacite file for ${MOCK_DATASET_ID}:${MOCK_REV_SHORT} is Dataset type but provided no contributors.`,
140
- )
141
138
  expect(mockSentryCaptureException).not.toHaveBeenCalled()
142
139
  })
143
140
 
@@ -168,9 +165,6 @@ describe("contributors (core functionality)", () => {
168
165
  expect(mockSentryCaptureMessage).toHaveBeenCalledWith(
169
166
  `Datacite file for ${MOCK_DATASET_ID}:${MOCK_REV_SHORT} served with unexpected Content-Type: text/plain. Attempting YAML parse anyway.`,
170
167
  )
171
- expect(mockSentryCaptureMessage).toHaveBeenCalledWith(
172
- `Datacite file for ${MOCK_DATASET_ID}:${MOCK_REV_SHORT} is Dataset type but provided no contributors.`,
173
- )
174
168
  expect(mockSentryCaptureException).not.toHaveBeenCalled()
175
169
  expect(result).toEqual([])
176
170
  })
@@ -66,18 +66,6 @@ export const contributors = async (
66
66
  .sort((a, b) => (a.order ?? 0) - (b.order ?? 0))
67
67
  }
68
68
 
69
- // --- Dataset type but no contributors ---
70
- // Only log if a Datacite file actually exists
71
- if (
72
- dataciteData?.data?.attributes &&
73
- resourceType === "Dataset" &&
74
- !attributes?.contributors?.length
75
- ) {
76
- Sentry.captureMessage(
77
- `Datacite file for ${datasetId}:${revisionShort} is Dataset type but provided no contributors.`,
78
- )
79
- }
80
-
81
69
  // --- Fallback: dataset_description.json authors ---
82
70
  const datasetDescription = await description(obj)
83
71
  if (datasetDescription?.Authors?.length) {
@@ -95,6 +95,10 @@ export const checkDatasetRead = async (datasetId, userId, userInfo) => {
95
95
  return true
96
96
  }
97
97
  }
98
+ // Allow worker scoped tokens to read specific datasets
99
+ if (userId && userInfo?.worker && datasetId === userInfo?.dataset) {
100
+ return true
101
+ }
98
102
  // Check that dataset exists.
99
103
  await checkDatasetExists(datasetId)
100
104
  // Look for any matching datasets