@fluidframework/odsp-driver 2.1.0-274160 → 2.1.0-276326
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/api-report/{odsp-driver.alpha.api.md → odsp-driver.legacy.alpha.api.md} +1 -1
- package/dist/checkUrl.d.ts +1 -0
- package/dist/checkUrl.d.ts.map +1 -1
- package/dist/checkUrl.js +1 -0
- package/dist/checkUrl.js.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -1
- package/dist/contractsPublic.d.ts +1 -0
- package/dist/contractsPublic.d.ts.map +1 -1
- package/dist/contractsPublic.js.map +1 -1
- package/dist/createFile.d.ts +3 -3
- package/dist/createFile.d.ts.map +1 -1
- package/dist/createFile.js +11 -9
- package/dist/createFile.js.map +1 -1
- package/dist/createNewContainerOnExistingFile.d.ts +1 -1
- package/dist/createNewContainerOnExistingFile.d.ts.map +1 -1
- package/dist/createNewContainerOnExistingFile.js +2 -2
- package/dist/createNewContainerOnExistingFile.js.map +1 -1
- package/dist/createNewUtils.d.ts +1 -1
- package/dist/createNewUtils.d.ts.map +1 -1
- package/dist/createNewUtils.js +22 -17
- package/dist/createNewUtils.js.map +1 -1
- package/dist/createOdspCreateContainerRequest.d.ts +1 -0
- package/dist/createOdspCreateContainerRequest.d.ts.map +1 -1
- package/dist/createOdspCreateContainerRequest.js +1 -0
- package/dist/createOdspCreateContainerRequest.js.map +1 -1
- package/dist/createOdspUrl.d.ts +1 -0
- package/dist/createOdspUrl.d.ts.map +1 -1
- package/dist/createOdspUrl.js +1 -0
- package/dist/createOdspUrl.js.map +1 -1
- package/dist/epochTracker.d.ts +4 -0
- package/dist/epochTracker.d.ts.map +1 -1
- package/dist/epochTracker.js +1 -0
- package/dist/epochTracker.js.map +1 -1
- package/dist/fetchSnapshot.d.ts +7 -9
- package/dist/fetchSnapshot.d.ts.map +1 -1
- package/dist/fetchSnapshot.js +23 -21
- package/dist/fetchSnapshot.js.map +1 -1
- package/dist/getFileLink.js +14 -8
- package/dist/getFileLink.js.map +1 -1
- package/dist/getUrlAndHeadersWithAuth.d.ts +2 -5
- package/dist/getUrlAndHeadersWithAuth.d.ts.map +1 -1
- package/dist/getUrlAndHeadersWithAuth.js +7 -28
- package/dist/getUrlAndHeadersWithAuth.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/odspCache.d.ts +4 -0
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/odspCache.js.map +1 -1
- package/dist/odspDelayLoadedDeltaStream.d.ts +3 -4
- package/dist/odspDelayLoadedDeltaStream.d.ts.map +1 -1
- package/dist/odspDelayLoadedDeltaStream.js +4 -5
- package/dist/odspDelayLoadedDeltaStream.js.map +1 -1
- package/dist/odspDeltaStorageService.d.ts +2 -2
- package/dist/odspDeltaStorageService.d.ts.map +1 -1
- package/dist/odspDeltaStorageService.js +9 -8
- package/dist/odspDeltaStorageService.js.map +1 -1
- package/dist/odspDocumentService.d.ts +4 -4
- package/dist/odspDocumentService.d.ts.map +1 -1
- package/dist/odspDocumentService.js +9 -9
- package/dist/odspDocumentService.js.map +1 -1
- package/dist/odspDocumentServiceFactory.d.ts +2 -0
- package/dist/odspDocumentServiceFactory.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactory.js +2 -0
- package/dist/odspDocumentServiceFactory.js.map +1 -1
- package/dist/odspDocumentServiceFactoryCore.d.ts +1 -0
- package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactoryCore.js +7 -4
- package/dist/odspDocumentServiceFactoryCore.js.map +1 -1
- package/dist/odspDocumentStorageManager.d.ts +2 -2
- package/dist/odspDocumentStorageManager.d.ts.map +1 -1
- package/dist/odspDocumentStorageManager.js +25 -19
- package/dist/odspDocumentStorageManager.js.map +1 -1
- package/dist/odspDriverUrlResolver.d.ts +1 -0
- package/dist/odspDriverUrlResolver.d.ts.map +1 -1
- package/dist/odspDriverUrlResolver.js +1 -0
- package/dist/odspDriverUrlResolver.js.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.d.ts +2 -0
- package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.js +1 -0
- package/dist/odspDriverUrlResolverForShareLink.js.map +1 -1
- package/dist/odspFluidFileLink.d.ts +4 -0
- package/dist/odspFluidFileLink.d.ts.map +1 -1
- package/dist/odspFluidFileLink.js +4 -0
- package/dist/odspFluidFileLink.js.map +1 -1
- package/dist/odspPublicUtils.d.ts +2 -0
- package/dist/odspPublicUtils.d.ts.map +1 -1
- package/dist/odspPublicUtils.js +1 -0
- package/dist/odspPublicUtils.js.map +1 -1
- package/dist/odspSummaryUploadManager.d.ts +2 -3
- package/dist/odspSummaryUploadManager.d.ts.map +1 -1
- package/dist/odspSummaryUploadManager.js +6 -5
- package/dist/odspSummaryUploadManager.js.map +1 -1
- package/dist/odspUtils.d.ts +12 -3
- package/dist/odspUtils.d.ts.map +1 -1
- package/dist/odspUtils.js +10 -6
- package/dist/odspUtils.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/prefetchLatestSnapshot.d.ts +2 -1
- package/dist/prefetchLatestSnapshot.d.ts.map +1 -1
- package/dist/prefetchLatestSnapshot.js +6 -5
- package/dist/prefetchLatestSnapshot.js.map +1 -1
- package/dist/vroom.d.ts +2 -2
- package/dist/vroom.d.ts.map +1 -1
- package/dist/vroom.js +7 -9
- package/dist/vroom.js.map +1 -1
- package/lib/checkUrl.d.ts +1 -0
- package/lib/checkUrl.d.ts.map +1 -1
- package/lib/checkUrl.js +1 -0
- package/lib/checkUrl.js.map +1 -1
- package/lib/constants.d.ts +2 -0
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +2 -0
- package/lib/constants.js.map +1 -1
- package/lib/contractsPublic.d.ts +1 -0
- package/lib/contractsPublic.d.ts.map +1 -1
- package/lib/contractsPublic.js.map +1 -1
- package/lib/createFile.d.ts +3 -3
- package/lib/createFile.d.ts.map +1 -1
- package/lib/createFile.js +12 -10
- package/lib/createFile.js.map +1 -1
- package/lib/createNewContainerOnExistingFile.d.ts +1 -1
- package/lib/createNewContainerOnExistingFile.d.ts.map +1 -1
- package/lib/createNewContainerOnExistingFile.js +2 -2
- package/lib/createNewContainerOnExistingFile.js.map +1 -1
- package/lib/createNewUtils.d.ts +1 -1
- package/lib/createNewUtils.d.ts.map +1 -1
- package/lib/createNewUtils.js +23 -18
- package/lib/createNewUtils.js.map +1 -1
- package/lib/createOdspCreateContainerRequest.d.ts +1 -0
- package/lib/createOdspCreateContainerRequest.d.ts.map +1 -1
- package/lib/createOdspCreateContainerRequest.js +1 -0
- package/lib/createOdspCreateContainerRequest.js.map +1 -1
- package/lib/createOdspUrl.d.ts +1 -0
- package/lib/createOdspUrl.d.ts.map +1 -1
- package/lib/createOdspUrl.js +1 -0
- package/lib/createOdspUrl.js.map +1 -1
- package/lib/epochTracker.d.ts +4 -0
- package/lib/epochTracker.d.ts.map +1 -1
- package/lib/epochTracker.js +1 -0
- package/lib/epochTracker.js.map +1 -1
- package/lib/fetchSnapshot.d.ts +7 -9
- package/lib/fetchSnapshot.d.ts.map +1 -1
- package/lib/fetchSnapshot.js +24 -22
- package/lib/fetchSnapshot.js.map +1 -1
- package/lib/getFileLink.js +15 -9
- package/lib/getFileLink.js.map +1 -1
- package/lib/getUrlAndHeadersWithAuth.d.ts +2 -5
- package/lib/getUrlAndHeadersWithAuth.d.ts.map +1 -1
- package/lib/getUrlAndHeadersWithAuth.js +5 -26
- package/lib/getUrlAndHeadersWithAuth.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/odspCache.d.ts +4 -0
- package/lib/odspCache.d.ts.map +1 -1
- package/lib/odspCache.js.map +1 -1
- package/lib/odspDelayLoadedDeltaStream.d.ts +3 -4
- package/lib/odspDelayLoadedDeltaStream.d.ts.map +1 -1
- package/lib/odspDelayLoadedDeltaStream.js +4 -5
- package/lib/odspDelayLoadedDeltaStream.js.map +1 -1
- package/lib/odspDeltaStorageService.d.ts +2 -2
- package/lib/odspDeltaStorageService.d.ts.map +1 -1
- package/lib/odspDeltaStorageService.js +9 -8
- package/lib/odspDeltaStorageService.js.map +1 -1
- package/lib/odspDocumentService.d.ts +4 -4
- package/lib/odspDocumentService.d.ts.map +1 -1
- package/lib/odspDocumentService.js +9 -9
- package/lib/odspDocumentService.js.map +1 -1
- package/lib/odspDocumentServiceFactory.d.ts +2 -0
- package/lib/odspDocumentServiceFactory.d.ts.map +1 -1
- package/lib/odspDocumentServiceFactory.js +2 -0
- package/lib/odspDocumentServiceFactory.js.map +1 -1
- package/lib/odspDocumentServiceFactoryCore.d.ts +1 -0
- package/lib/odspDocumentServiceFactoryCore.d.ts.map +1 -1
- package/lib/odspDocumentServiceFactoryCore.js +7 -4
- package/lib/odspDocumentServiceFactoryCore.js.map +1 -1
- package/lib/odspDocumentStorageManager.d.ts +2 -2
- package/lib/odspDocumentStorageManager.d.ts.map +1 -1
- package/lib/odspDocumentStorageManager.js +26 -20
- package/lib/odspDocumentStorageManager.js.map +1 -1
- package/lib/odspDriverUrlResolver.d.ts +1 -0
- package/lib/odspDriverUrlResolver.d.ts.map +1 -1
- package/lib/odspDriverUrlResolver.js +1 -0
- package/lib/odspDriverUrlResolver.js.map +1 -1
- package/lib/odspDriverUrlResolverForShareLink.d.ts +2 -0
- package/lib/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
- package/lib/odspDriverUrlResolverForShareLink.js +1 -0
- package/lib/odspDriverUrlResolverForShareLink.js.map +1 -1
- package/lib/odspFluidFileLink.d.ts +4 -0
- package/lib/odspFluidFileLink.d.ts.map +1 -1
- package/lib/odspFluidFileLink.js +4 -0
- package/lib/odspFluidFileLink.js.map +1 -1
- package/lib/odspPublicUtils.d.ts +2 -0
- package/lib/odspPublicUtils.d.ts.map +1 -1
- package/lib/odspPublicUtils.js +1 -0
- package/lib/odspPublicUtils.js.map +1 -1
- package/lib/odspSummaryUploadManager.d.ts +2 -3
- package/lib/odspSummaryUploadManager.d.ts.map +1 -1
- package/lib/odspSummaryUploadManager.js +7 -6
- package/lib/odspSummaryUploadManager.js.map +1 -1
- package/lib/odspUtils.d.ts +12 -3
- package/lib/odspUtils.d.ts.map +1 -1
- package/lib/odspUtils.js +11 -7
- package/lib/odspUtils.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/prefetchLatestSnapshot.d.ts +2 -1
- package/lib/prefetchLatestSnapshot.d.ts.map +1 -1
- package/lib/prefetchLatestSnapshot.js +6 -5
- package/lib/prefetchLatestSnapshot.js.map +1 -1
- package/lib/vroom.d.ts +2 -2
- package/lib/vroom.d.ts.map +1 -1
- package/lib/vroom.js +7 -9
- package/lib/vroom.js.map +1 -1
- package/package.json +13 -13
- package/src/checkUrl.ts +1 -0
- package/src/constants.ts +2 -0
- package/src/contractsPublic.ts +1 -0
- package/src/createFile.ts +15 -21
- package/src/createNewContainerOnExistingFile.ts +2 -2
- package/src/createNewUtils.ts +32 -24
- package/src/createOdspCreateContainerRequest.ts +1 -0
- package/src/createOdspUrl.ts +1 -0
- package/src/epochTracker.ts +4 -0
- package/src/fetchSnapshot.ts +36 -34
- package/src/getFileLink.ts +27 -20
- package/src/getUrlAndHeadersWithAuth.ts +6 -31
- package/src/odspCache.ts +4 -0
- package/src/odspDelayLoadedDeltaStream.ts +4 -5
- package/src/odspDeltaStorageService.ts +11 -7
- package/src/odspDocumentService.ts +8 -8
- package/src/odspDocumentServiceFactory.ts +2 -0
- package/src/odspDocumentServiceFactoryCore.ts +6 -3
- package/src/odspDocumentStorageManager.ts +36 -33
- package/src/odspDriverUrlResolver.ts +1 -0
- package/src/odspDriverUrlResolverForShareLink.ts +2 -0
- package/src/odspFluidFileLink.ts +4 -0
- package/src/odspPublicUtils.ts +2 -0
- package/src/odspSummaryUploadManager.ts +9 -9
- package/src/odspUtils.ts +20 -6
- package/src/packageVersion.ts +1 -1
- package/src/prefetchLatestSnapshot.ts +10 -5
- package/src/vroom.ts +11 -11
package/src/fetchSnapshot.ts
CHANGED
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
} from "./contracts.js";
|
|
46
46
|
import { EpochTracker } from "./epochTracker.js";
|
|
47
47
|
import { getQueryString } from "./getQueryString.js";
|
|
48
|
-
import {
|
|
48
|
+
import { getHeadersWithAuth } from "./getUrlAndHeadersWithAuth.js";
|
|
49
49
|
import { convertOdspSnapshotToSnapshotTreeAndBlobs } from "./odspSnapshotParser.js";
|
|
50
50
|
import {
|
|
51
51
|
IOdspResponse,
|
|
@@ -57,11 +57,13 @@ import {
|
|
|
57
57
|
measure,
|
|
58
58
|
measureP,
|
|
59
59
|
useLegacyFlowWithoutGroupsForSnapshotFetch,
|
|
60
|
+
type TokenFetchOptionsEx,
|
|
60
61
|
} from "./odspUtils.js";
|
|
61
62
|
import { pkgVersion } from "./packageVersion.js";
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
65
|
* Enum to support different types of snapshot formats.
|
|
66
|
+
* @legacy
|
|
65
67
|
* @alpha
|
|
66
68
|
*/
|
|
67
69
|
export enum SnapshotFormatSupportType {
|
|
@@ -73,25 +75,19 @@ export enum SnapshotFormatSupportType {
|
|
|
73
75
|
/**
|
|
74
76
|
* Fetches a snapshot from the server with a given version id.
|
|
75
77
|
* @param snapshotUrl - snapshot url from where the odsp snapshot will be fetched
|
|
76
|
-
* @param token - token used for authorization in the request
|
|
77
|
-
* @param storageFetchWrapper - Implementation of the get/post methods used to fetch the snapshot
|
|
78
78
|
* @param versionId - id of specific snapshot to be fetched
|
|
79
79
|
* @param fetchFullSnapshot - whether we want to fetch full snapshot(with blobs)
|
|
80
|
-
* @param forceAccessTokenViaAuthorizationHeader -
|
|
80
|
+
* @param forceAccessTokenViaAuthorizationHeader - @deprecated Not used, true value always used instead. Whether to force passing given token via authorization header
|
|
81
|
+
* @param snapshotDownloader - Implementation of the get/post methods used to fetch the snapshot. snapshotDownloader is responsible for generating the appropriate headers (including Authorization header) as well as handling any token refreshes before retrying.
|
|
81
82
|
* @returns A promise of the snapshot and the status code of the response
|
|
82
83
|
*/
|
|
83
84
|
export async function fetchSnapshot(
|
|
84
85
|
snapshotUrl: string,
|
|
85
|
-
// eslint-disable-next-line @rushstack/no-new-null
|
|
86
|
-
token: string,
|
|
87
86
|
versionId: string,
|
|
88
87
|
fetchFullSnapshot: boolean,
|
|
89
88
|
forceAccessTokenViaAuthorizationHeader: boolean,
|
|
90
89
|
logger: ITelemetryLoggerExt,
|
|
91
|
-
snapshotDownloader: (
|
|
92
|
-
url: string,
|
|
93
|
-
fetchOptions: { [index: string]: RequestInit },
|
|
94
|
-
) => Promise<IOdspResponse<unknown>>,
|
|
90
|
+
snapshotDownloader: (url: string) => Promise<IOdspResponse<unknown>>,
|
|
95
91
|
): Promise<ISnapshot> {
|
|
96
92
|
const path = `/trees/${versionId}`;
|
|
97
93
|
let queryParams: ISnapshotOptions = {};
|
|
@@ -101,17 +97,13 @@ export async function fetchSnapshot(
|
|
|
101
97
|
}
|
|
102
98
|
|
|
103
99
|
const queryString = getQueryString(queryParams);
|
|
104
|
-
const
|
|
105
|
-
`${snapshotUrl}${path}${queryString}`,
|
|
106
|
-
token,
|
|
107
|
-
forceAccessTokenViaAuthorizationHeader,
|
|
108
|
-
);
|
|
100
|
+
const url = `${snapshotUrl}${path}${queryString}`;
|
|
109
101
|
const response = (await PerformanceEvent.timedExecAsync(
|
|
110
102
|
logger,
|
|
111
103
|
{
|
|
112
104
|
eventName: "fetchSnapshot",
|
|
113
105
|
},
|
|
114
|
-
async () => snapshotDownloader(url
|
|
106
|
+
async () => snapshotDownloader(url),
|
|
115
107
|
)) as IOdspResponse<IOdspSnapshot>;
|
|
116
108
|
return convertOdspSnapshotToSnapshotTreeAndBlobs(response.content);
|
|
117
109
|
}
|
|
@@ -124,7 +116,8 @@ export async function fetchSnapshotWithRedeem(
|
|
|
124
116
|
logger: ITelemetryLoggerExt,
|
|
125
117
|
snapshotDownloader: (
|
|
126
118
|
finalOdspResolvedUrl: IOdspResolvedUrl,
|
|
127
|
-
|
|
119
|
+
getAuthHeader: InstrumentedStorageTokenFetcher,
|
|
120
|
+
tokenFetchOptions: TokenFetchOptionsEx,
|
|
128
121
|
loadingGroupIds: string[] | undefined,
|
|
129
122
|
snapshotOptions: ISnapshotOptions | undefined,
|
|
130
123
|
controller?: AbortController,
|
|
@@ -217,7 +210,7 @@ export async function fetchSnapshotWithRedeem(
|
|
|
217
210
|
|
|
218
211
|
async function redeemSharingLink(
|
|
219
212
|
odspResolvedUrl: IOdspResolvedUrl,
|
|
220
|
-
|
|
213
|
+
getAuthHeader: InstrumentedStorageTokenFetcher,
|
|
221
214
|
logger: ITelemetryLoggerExt,
|
|
222
215
|
forceAccessTokenViaAuthorizationHeader: boolean,
|
|
223
216
|
): Promise<void> {
|
|
@@ -239,15 +232,16 @@ async function redeemSharingLink(
|
|
|
239
232
|
let redeemUrl: string | undefined;
|
|
240
233
|
async function callSharesAPI(baseUrl: string): Promise<void> {
|
|
241
234
|
await getWithRetryForTokenRefresh(async (tokenFetchOptions) => {
|
|
242
|
-
const storageToken = await storageTokenFetcher(tokenFetchOptions, "RedeemShareLink");
|
|
243
235
|
redeemUrl = `${baseUrl}/_api/v2.0/shares/${encodedShareUrl}`;
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
236
|
+
const url = redeemUrl;
|
|
237
|
+
const method = "GET";
|
|
238
|
+
const authHeader = await getAuthHeader(
|
|
239
|
+
{ ...tokenFetchOptions, request: { url, method } },
|
|
240
|
+
"RedeemShareLink",
|
|
248
241
|
);
|
|
242
|
+
const headers = getHeadersWithAuth(authHeader);
|
|
249
243
|
headers.prefer = "redeemSharingLink";
|
|
250
|
-
await fetchAndParseAsJSONHelper(url, { headers });
|
|
244
|
+
await fetchAndParseAsJSONHelper(url, { headers, method });
|
|
251
245
|
});
|
|
252
246
|
}
|
|
253
247
|
|
|
@@ -271,7 +265,7 @@ async function redeemSharingLink(
|
|
|
271
265
|
shareLinkUrlLength: odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem.length,
|
|
272
266
|
queryParamsLength: new URL(odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem)
|
|
273
267
|
.search.length,
|
|
274
|
-
useHeaders:
|
|
268
|
+
useHeaders: true,
|
|
275
269
|
}),
|
|
276
270
|
},
|
|
277
271
|
error,
|
|
@@ -285,12 +279,13 @@ async function redeemSharingLink(
|
|
|
285
279
|
|
|
286
280
|
async function fetchLatestSnapshotCore(
|
|
287
281
|
odspResolvedUrl: IOdspResolvedUrl,
|
|
288
|
-
|
|
282
|
+
getAuthHeader: InstrumentedStorageTokenFetcher,
|
|
289
283
|
snapshotOptions: ISnapshotOptions | undefined,
|
|
290
284
|
logger: ITelemetryLoggerExt,
|
|
291
285
|
snapshotDownloader: (
|
|
292
286
|
finalOdspResolvedUrl: IOdspResolvedUrl,
|
|
293
|
-
|
|
287
|
+
getAuthHeader: InstrumentedStorageTokenFetcher,
|
|
288
|
+
tokenFetchOptions: TokenFetchOptionsEx,
|
|
294
289
|
loadingGroupIds: string[] | undefined,
|
|
295
290
|
snapshotOptions: ISnapshotOptions | undefined,
|
|
296
291
|
controller?: AbortController,
|
|
@@ -302,7 +297,6 @@ async function fetchLatestSnapshotCore(
|
|
|
302
297
|
return getWithRetryForTokenRefresh(async (tokenFetchOptions) => {
|
|
303
298
|
const fetchSnapshotForLoadingGroup = isSnapshotFetchForLoadingGroup(loadingGroupIds);
|
|
304
299
|
const eventName = fetchSnapshotForLoadingGroup ? "TreesLatestForGroup" : "TreesLatest";
|
|
305
|
-
const storageToken = await storageTokenFetcher(tokenFetchOptions, eventName, true);
|
|
306
300
|
|
|
307
301
|
const perfEvent = {
|
|
308
302
|
eventName,
|
|
@@ -331,7 +325,8 @@ async function fetchLatestSnapshotCore(
|
|
|
331
325
|
const [response, fetchTime] = await measureP(async () =>
|
|
332
326
|
snapshotDownloader(
|
|
333
327
|
odspResolvedUrl,
|
|
334
|
-
|
|
328
|
+
getAuthHeader,
|
|
329
|
+
tokenFetchOptions,
|
|
335
330
|
loadingGroupIds,
|
|
336
331
|
snapshotOptions,
|
|
337
332
|
controller,
|
|
@@ -594,7 +589,7 @@ export interface ISnapshotRequestAndResponseOptions {
|
|
|
594
589
|
|
|
595
590
|
function getFormBodyAndHeaders(
|
|
596
591
|
odspResolvedUrl: IOdspResolvedUrl,
|
|
597
|
-
|
|
592
|
+
authHeader: string,
|
|
598
593
|
headers?: { [index: string]: string },
|
|
599
594
|
): {
|
|
600
595
|
body: string;
|
|
@@ -606,7 +601,7 @@ function getFormBodyAndHeaders(
|
|
|
606
601
|
const formParams: string[] = [];
|
|
607
602
|
formParams.push(
|
|
608
603
|
`--${formBoundary}`,
|
|
609
|
-
`Authorization:
|
|
604
|
+
`Authorization: ${authHeader}`,
|
|
610
605
|
`X-HTTP-Method-Override: GET`,
|
|
611
606
|
);
|
|
612
607
|
|
|
@@ -690,7 +685,8 @@ function getTreeStatsCore(snapshotTree: ISnapshotTree, stats: ITreeStats): void
|
|
|
690
685
|
*/
|
|
691
686
|
export async function downloadSnapshot(
|
|
692
687
|
odspResolvedUrl: IOdspResolvedUrl,
|
|
693
|
-
|
|
688
|
+
getAuthHeader: InstrumentedStorageTokenFetcher,
|
|
689
|
+
tokenFetchOptions: TokenFetchOptionsEx,
|
|
694
690
|
loadingGroupIds: string[] | undefined,
|
|
695
691
|
snapshotOptions: ISnapshotOptions | undefined,
|
|
696
692
|
snapshotFormatFetchType?: SnapshotFormatSupportType,
|
|
@@ -724,17 +720,23 @@ export async function downloadSnapshot(
|
|
|
724
720
|
|
|
725
721
|
const queryString = getQueryString(queryParams);
|
|
726
722
|
const url = `${snapshotUrl}/trees/latest${queryString}`;
|
|
723
|
+
const method = "POST";
|
|
727
724
|
// The location of file can move on Spo in which case server returns 308(Permanent Redirect) error.
|
|
728
725
|
// Adding below header will make VROOM API return 404 instead of 308 and browser can intercept it.
|
|
729
726
|
// This error thrown by server will contain the new redirect location. Look at the 404 error parsing
|
|
730
727
|
// for further reference here: \packages\utils\odsp-doclib-utils\src\odspErrorUtils.ts
|
|
731
728
|
const header = { prefer: "manualredirect" };
|
|
732
|
-
const
|
|
729
|
+
const authHeader = await getAuthHeader(
|
|
730
|
+
{ ...tokenFetchOptions, request: { url, method } },
|
|
731
|
+
"downloadSnapshot",
|
|
732
|
+
);
|
|
733
|
+
assert(authHeader !== null, 0x1e5 /* "Storage token should not be null" */);
|
|
734
|
+
const { body, headers } = getFormBodyAndHeaders(odspResolvedUrl, authHeader, header);
|
|
733
735
|
const fetchOptions = {
|
|
734
736
|
body,
|
|
735
737
|
headers,
|
|
736
738
|
signal: controller?.signal,
|
|
737
|
-
method
|
|
739
|
+
method,
|
|
738
740
|
};
|
|
739
741
|
// Decide what snapshot format to fetch as per the feature gate.
|
|
740
742
|
switch (snapshotFormatFetchType) {
|
package/src/getFileLink.ts
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
isFluidError,
|
|
20
20
|
} from "@fluidframework/telemetry-utils/internal";
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import { getHeadersWithAuth } from "./getUrlAndHeadersWithAuth.js";
|
|
23
23
|
import {
|
|
24
24
|
fetchHelper,
|
|
25
25
|
getWithRetryForTokenRefresh,
|
|
@@ -111,6 +111,7 @@ export async function getFileLink(
|
|
|
111
111
|
* @param odspUrlParts - parts of odsp resolved url.
|
|
112
112
|
* @param logger - logger to send events.
|
|
113
113
|
* @returns Response from the API call.
|
|
114
|
+
* @legacy
|
|
114
115
|
* @alpha
|
|
115
116
|
*/
|
|
116
117
|
async function getFileLinkWithLocationRedirectionHandling(
|
|
@@ -165,12 +166,11 @@ async function getFileLinkCore(
|
|
|
165
166
|
let additionalProps;
|
|
166
167
|
const fileLink = await getWithRetryForTokenRefresh(async (options) => {
|
|
167
168
|
attempts++;
|
|
168
|
-
const
|
|
169
|
+
const getAuthHeader = toInstrumentedOdspStorageTokenFetcher(
|
|
169
170
|
logger,
|
|
170
171
|
odspUrlParts,
|
|
171
172
|
getToken,
|
|
172
173
|
);
|
|
173
|
-
const storageToken = await storageTokenFetcher(options, "GetFileLinkCore");
|
|
174
174
|
|
|
175
175
|
// IMPORTANT: In past we were using GetFileByUrl() API to get to the list item that was corresponding
|
|
176
176
|
// to the file. This was intentionally replaced with GetFileById() to solve the following issue:
|
|
@@ -178,17 +178,19 @@ async function getFileLinkCore(
|
|
|
178
178
|
// where webDavUrl is constructed using legacy ODC format for backward compatibility reasons.
|
|
179
179
|
// GetFileByUrl() does not understand that format and thus fails. GetFileById() relies on file item
|
|
180
180
|
// unique guid (sharepointIds.listItemUniqueId) and it works uniformly across Consumer and Commercial.
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
181
|
+
const url = `${
|
|
182
|
+
odspUrlParts.siteUrl
|
|
183
|
+
}/_api/web/GetFileById(@a1)/ListItemAllFields/GetSharingInformation?@a1=guid${encodeURIComponent(
|
|
184
|
+
`'${fileItem.sharepointIds.listItemUniqueId}'`,
|
|
185
|
+
)}`;
|
|
186
|
+
const method = "POST";
|
|
187
|
+
const authHeader = await getAuthHeader(
|
|
188
|
+
{ ...options, request: { url, method } },
|
|
189
|
+
"GetFileLinkCore",
|
|
189
190
|
);
|
|
191
|
+
const headers = getHeadersWithAuth(authHeader);
|
|
190
192
|
const requestInit = {
|
|
191
|
-
method
|
|
193
|
+
method,
|
|
192
194
|
headers: {
|
|
193
195
|
"Content-Type": "application/json;odata=verbose",
|
|
194
196
|
"Accept": "application/json;odata=verbose",
|
|
@@ -262,20 +264,25 @@ async function getFileItemLite(
|
|
|
262
264
|
const fileItem = await getWithRetryForTokenRefresh(async (options) => {
|
|
263
265
|
attempts++;
|
|
264
266
|
const { siteUrl, driveId, itemId } = odspUrlParts;
|
|
265
|
-
const
|
|
267
|
+
const getAuthHeader = toInstrumentedOdspStorageTokenFetcher(
|
|
266
268
|
logger,
|
|
267
269
|
odspUrlParts,
|
|
268
270
|
getToken,
|
|
269
271
|
);
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
272
|
+
const url = `${siteUrl}/_api/v2.0/drives/${driveId}/items/${itemId}?select=webUrl,webDavUrl,sharepointIds`;
|
|
273
|
+
const method = "GET";
|
|
274
|
+
const authHeader = await getAuthHeader(
|
|
275
|
+
{ ...options, request: { url, method } },
|
|
276
|
+
"GetFileItemLite",
|
|
277
|
+
);
|
|
278
|
+
assert(
|
|
279
|
+
authHeader !== null,
|
|
280
|
+
0x2bc /* "Instrumented token fetcher with throwOnNullToken =true should never return null" */,
|
|
276
281
|
);
|
|
282
|
+
|
|
283
|
+
const headers = getHeadersWithAuth(authHeader);
|
|
277
284
|
headers.redirect = "manual";
|
|
278
|
-
const requestInit = { method
|
|
285
|
+
const requestInit = { method, headers };
|
|
279
286
|
const response = await fetchHelper(url, requestInit);
|
|
280
287
|
additionalProps = response.propsToLog;
|
|
281
288
|
|
|
@@ -5,38 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
|
|
8
|
-
export function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
assert(token.length > 0, 0x936 /* should be token */);
|
|
14
|
-
|
|
15
|
-
if (!forceAccessTokenViaAuthorizationHeader) {
|
|
16
|
-
// Pass access token via query string: this will make request be treated as 'simple' request
|
|
17
|
-
// which does not require OPTIONS call as part of CORS check.
|
|
18
|
-
const urlWithAccessTokenInQueryString = new URL(url);
|
|
19
|
-
// IMPORTANT: Do not apply encodeURIComponent to token, param value is automatically encoded
|
|
20
|
-
// when set via URLSearchParams class
|
|
21
|
-
urlWithAccessTokenInQueryString.searchParams.set("access_token", token);
|
|
22
|
-
// ODSP APIs have a limitation that the query string cannot exceed 2048 characters.
|
|
23
|
-
// If the query string exceeds 2048, we have to fall back to sending the access token as a header, which
|
|
24
|
-
// has a negative performance implication as it adds a performance overhead.
|
|
25
|
-
// NOTE: URL.search.length value includes '?' symbol and it is unclear whether backend logic which enforces
|
|
26
|
-
// query length limit accounts for it. This logic errs on side of caution and includes that key in overall
|
|
27
|
-
// query length.
|
|
28
|
-
if (urlWithAccessTokenInQueryString.search.length <= 2048) {
|
|
29
|
-
return {
|
|
30
|
-
headers: {},
|
|
31
|
-
url: urlWithAccessTokenInQueryString.href,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
8
|
+
export function getHeadersWithAuth(
|
|
9
|
+
// eslint-disable-next-line @rushstack/no-new-null
|
|
10
|
+
authHeader: string | null,
|
|
11
|
+
): { [index: string]: string } {
|
|
12
|
+
assert(!!authHeader, 0x936 /* authHeader should not be null or empty */);
|
|
35
13
|
|
|
36
14
|
return {
|
|
37
|
-
|
|
38
|
-
Authorization: `Bearer ${token}`,
|
|
39
|
-
},
|
|
40
|
-
url,
|
|
15
|
+
Authorization: authHeader,
|
|
41
16
|
};
|
|
42
17
|
}
|
package/src/odspCache.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Similar to IPersistedCache, but exposes cache interface for single file
|
|
20
|
+
* @legacy
|
|
20
21
|
* @alpha
|
|
21
22
|
*/
|
|
22
23
|
export interface IPersistedFileCache {
|
|
@@ -95,6 +96,7 @@ export class PromiseCacheWithOneHourSlidingExpiry<T> extends PromiseCache<string
|
|
|
95
96
|
|
|
96
97
|
/**
|
|
97
98
|
* Internal cache interface used within driver only
|
|
99
|
+
* @legacy
|
|
98
100
|
* @alpha
|
|
99
101
|
*/
|
|
100
102
|
export interface INonPersistentCache {
|
|
@@ -120,6 +122,7 @@ export interface INonPersistentCache {
|
|
|
120
122
|
|
|
121
123
|
/**
|
|
122
124
|
* Internal cache interface used within driver only
|
|
125
|
+
* @legacy
|
|
123
126
|
* @alpha
|
|
124
127
|
*/
|
|
125
128
|
export interface IOdspCache extends INonPersistentCache {
|
|
@@ -144,6 +147,7 @@ export class NonPersistentCache implements INonPersistentCache {
|
|
|
144
147
|
}
|
|
145
148
|
|
|
146
149
|
/**
|
|
150
|
+
* @legacy
|
|
147
151
|
* @alpha
|
|
148
152
|
*/
|
|
149
153
|
export interface IPrefetchSnapshotContents extends ISnapshot {
|
|
@@ -70,7 +70,7 @@ export class OdspDelayLoadedDeltaStream {
|
|
|
70
70
|
/**
|
|
71
71
|
* @param odspResolvedUrl - resolved url identifying document that will be managed by this service instance.
|
|
72
72
|
* @param policies - Document service policies.
|
|
73
|
-
* @param
|
|
73
|
+
* @param getAuthHeader - function that can provide the Authentication header value. This is is also referred to as
|
|
74
74
|
* the "Vroom" token in SPO.
|
|
75
75
|
* @param getWebsocketToken - function that can provide a token for accessing the web socket. This is also referred
|
|
76
76
|
* to as the "Push" token in SPO. If undefined then websocket token is expected to be returned with joinSession
|
|
@@ -85,13 +85,13 @@ export class OdspDelayLoadedDeltaStream {
|
|
|
85
85
|
public constructor(
|
|
86
86
|
public readonly odspResolvedUrl: IOdspResolvedUrl,
|
|
87
87
|
public policies: IDocumentServicePolicies,
|
|
88
|
-
private readonly
|
|
88
|
+
private readonly getAuthHeader: InstrumentedStorageTokenFetcher,
|
|
89
89
|
private readonly getWebsocketToken:
|
|
90
90
|
| ((options: TokenFetchOptions) => Promise<string | null>)
|
|
91
91
|
| undefined,
|
|
92
92
|
private readonly mc: MonitoringContext,
|
|
93
93
|
private readonly cache: IOdspCache,
|
|
94
|
-
|
|
94
|
+
_hostPolicy: HostStoragePolicy,
|
|
95
95
|
private readonly epochTracker: EpochTracker,
|
|
96
96
|
private readonly opsReceived: (ops: ISequencedDocumentMessage[]) => void,
|
|
97
97
|
private readonly metadataUpdateHandler: (metadata: Record<string, string>) => void,
|
|
@@ -391,13 +391,12 @@ export class OdspDelayLoadedDeltaStream {
|
|
|
391
391
|
"opStream/joinSession",
|
|
392
392
|
"POST",
|
|
393
393
|
this.mc.logger,
|
|
394
|
-
this.
|
|
394
|
+
this.getAuthHeader,
|
|
395
395
|
this.epochTracker,
|
|
396
396
|
requestSocketToken,
|
|
397
397
|
options,
|
|
398
398
|
disableJoinSessionRefresh,
|
|
399
399
|
isRefreshingJoinSession,
|
|
400
|
-
this.hostPolicy.sessionOptions?.unauthenticatedUserDisplayName,
|
|
401
400
|
);
|
|
402
401
|
// Emit event only in case it is fetched from the network.
|
|
403
402
|
if (joinSessionResponse.sensitivityLabelsInfo !== undefined) {
|
|
@@ -31,7 +31,7 @@ import { getWithRetryForTokenRefresh } from "./odspUtils.js";
|
|
|
31
31
|
export class OdspDeltaStorageService {
|
|
32
32
|
constructor(
|
|
33
33
|
private readonly deltaFeedUrl: string,
|
|
34
|
-
private readonly
|
|
34
|
+
private readonly getAuthHeader: InstrumentedStorageTokenFetcher,
|
|
35
35
|
private readonly epochTracker: EpochTracker,
|
|
36
36
|
private readonly logger: ITelemetryLoggerExt,
|
|
37
37
|
) {}
|
|
@@ -52,9 +52,13 @@ export class OdspDeltaStorageService {
|
|
|
52
52
|
): Promise<IDeltasFetchResult> {
|
|
53
53
|
return getWithRetryForTokenRefresh(async (options) => {
|
|
54
54
|
// Note - this call ends up in getSocketStorageDiscovery() and can refresh token
|
|
55
|
-
// Thus it needs to be done before we call
|
|
56
|
-
const
|
|
57
|
-
const
|
|
55
|
+
// Thus it needs to be done before we call getAuthHeader() to reduce extra calls
|
|
56
|
+
const url = this.buildUrl(from, to);
|
|
57
|
+
const method = "POST";
|
|
58
|
+
const authHeader = await this.getAuthHeader(
|
|
59
|
+
{ ...options, request: { url, method } },
|
|
60
|
+
"DeltaStorage",
|
|
61
|
+
);
|
|
58
62
|
|
|
59
63
|
return PerformanceEvent.timedExecAsync(
|
|
60
64
|
this.logger,
|
|
@@ -69,7 +73,7 @@ export class OdspDeltaStorageService {
|
|
|
69
73
|
async (event) => {
|
|
70
74
|
const formBoundary = uuid();
|
|
71
75
|
let postBody = `--${formBoundary}\r\n`;
|
|
72
|
-
postBody += `Authorization:
|
|
76
|
+
postBody += `Authorization: ${authHeader}\r\n`;
|
|
73
77
|
postBody += `X-HTTP-Method-Override: GET\r\n`;
|
|
74
78
|
|
|
75
79
|
postBody += `_post: 1\r\n`;
|
|
@@ -88,11 +92,11 @@ export class OdspDeltaStorageService {
|
|
|
88
92
|
|
|
89
93
|
const response =
|
|
90
94
|
await this.epochTracker.fetchAndParseAsJSON<IDeltaStorageGetResponse>(
|
|
91
|
-
|
|
95
|
+
url,
|
|
92
96
|
{
|
|
93
97
|
headers,
|
|
94
98
|
body: postBody,
|
|
95
|
-
method
|
|
99
|
+
method,
|
|
96
100
|
signal: abort.signal,
|
|
97
101
|
},
|
|
98
102
|
"ops",
|
|
@@ -64,7 +64,7 @@ export class OdspDocumentService
|
|
|
64
64
|
* Creates a new OdspDocumentService instance.
|
|
65
65
|
*
|
|
66
66
|
* @param resolvedUrl - resolved url identifying document that will be managed by returned service instance.
|
|
67
|
-
* @param
|
|
67
|
+
* @param getAuthHeader - function that can provide the Authentication header value. This is is also referred to as
|
|
68
68
|
* the "Vroom" token in SPO.
|
|
69
69
|
* @param getWebsocketToken - function that can provide a token for accessing the web socket. This is also referred
|
|
70
70
|
* to as the "Push" token in SPO. If undefined then websocket token is expected to be returned with joinSession
|
|
@@ -77,7 +77,7 @@ export class OdspDocumentService
|
|
|
77
77
|
*/
|
|
78
78
|
public static async create(
|
|
79
79
|
resolvedUrl: IResolvedUrl,
|
|
80
|
-
|
|
80
|
+
getAuthHeader: InstrumentedStorageTokenFetcher,
|
|
81
81
|
// eslint-disable-next-line @rushstack/no-new-null
|
|
82
82
|
getWebsocketToken: ((options: TokenFetchOptions) => Promise<string | null>) | undefined,
|
|
83
83
|
logger: ITelemetryLoggerExt,
|
|
@@ -89,7 +89,7 @@ export class OdspDocumentService
|
|
|
89
89
|
): Promise<IDocumentService> {
|
|
90
90
|
return new OdspDocumentService(
|
|
91
91
|
getOdspResolvedUrl(resolvedUrl),
|
|
92
|
-
|
|
92
|
+
getAuthHeader,
|
|
93
93
|
getWebsocketToken,
|
|
94
94
|
logger,
|
|
95
95
|
cache,
|
|
@@ -110,7 +110,7 @@ export class OdspDocumentService
|
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* @param odspResolvedUrl - resolved url identifying document that will be managed by this service instance.
|
|
113
|
-
* @param
|
|
113
|
+
* @param getAuthHeader - function that can provide the Authentication header value. This is is also referred to as
|
|
114
114
|
* the "Vroom" token in SPO.
|
|
115
115
|
* @param getWebsocketToken - function that can provide a token for accessing the web socket. This is also referred
|
|
116
116
|
* to as the "Push" token in SPO. If undefined then websocket token is expected to be returned with joinSession
|
|
@@ -124,7 +124,7 @@ export class OdspDocumentService
|
|
|
124
124
|
*/
|
|
125
125
|
private constructor(
|
|
126
126
|
public readonly odspResolvedUrl: IOdspResolvedUrl,
|
|
127
|
-
private readonly
|
|
127
|
+
private readonly getAuthHeader: InstrumentedStorageTokenFetcher,
|
|
128
128
|
private readonly getWebsocketToken:
|
|
129
129
|
| ((options: TokenFetchOptions) => Promise<string | null>)
|
|
130
130
|
| undefined,
|
|
@@ -175,7 +175,7 @@ export class OdspDocumentService
|
|
|
175
175
|
if (!this.storageManager) {
|
|
176
176
|
this.storageManager = new OdspDocumentStorageService(
|
|
177
177
|
this.odspResolvedUrl,
|
|
178
|
-
this.
|
|
178
|
+
this.getAuthHeader,
|
|
179
179
|
this.mc.logger,
|
|
180
180
|
true,
|
|
181
181
|
this.cache,
|
|
@@ -208,7 +208,7 @@ export class OdspDocumentService
|
|
|
208
208
|
const snapshotOps = this.storageManager?.ops ?? [];
|
|
209
209
|
const service = new OdspDeltaStorageService(
|
|
210
210
|
this.odspResolvedUrl.endpoints.deltaStorageUrl,
|
|
211
|
-
this.
|
|
211
|
+
this.getAuthHeader,
|
|
212
212
|
this.epochTracker,
|
|
213
213
|
this.mc.logger,
|
|
214
214
|
);
|
|
@@ -285,7 +285,7 @@ export class OdspDocumentService
|
|
|
285
285
|
this.odspDelayLoadedDeltaStream = new module.OdspDelayLoadedDeltaStream(
|
|
286
286
|
this.odspResolvedUrl,
|
|
287
287
|
this._policies,
|
|
288
|
-
this.
|
|
288
|
+
this.getAuthHeader,
|
|
289
289
|
this.getWebsocketToken,
|
|
290
290
|
this.mc,
|
|
291
291
|
this.cache,
|
|
@@ -18,6 +18,7 @@ import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore
|
|
|
18
18
|
/**
|
|
19
19
|
* Factory for creating the sharepoint document service. Use this if you want to
|
|
20
20
|
* use the sharepoint implementation.
|
|
21
|
+
* @legacy
|
|
21
22
|
* @alpha
|
|
22
23
|
*/
|
|
23
24
|
export class OdspDocumentServiceFactory extends OdspDocumentServiceFactoryCore {
|
|
@@ -37,6 +38,7 @@ export class OdspDocumentServiceFactory extends OdspDocumentServiceFactoryCore {
|
|
|
37
38
|
* @remarks Use if you don't want to connect to any kind of external/internal storages and want to provide
|
|
38
39
|
* content directly.
|
|
39
40
|
*
|
|
41
|
+
* @legacy
|
|
40
42
|
* @alpha
|
|
41
43
|
*/
|
|
42
44
|
export function createLocalOdspDocumentServiceFactory(
|
|
@@ -57,6 +57,7 @@ import {
|
|
|
57
57
|
*
|
|
58
58
|
* This constructor should be used by environments that support dynamic imports and that wish
|
|
59
59
|
* to leverage code splitting as a means to keep bundles as small as possible.
|
|
60
|
+
* @legacy
|
|
60
61
|
* @alpha
|
|
61
62
|
*/
|
|
62
63
|
export class OdspDocumentServiceFactoryCore
|
|
@@ -167,7 +168,7 @@ export class OdspDocumentServiceFactoryCore
|
|
|
167
168
|
this.hostPolicy.enableSingleRequestForShareLinkWithCreate,
|
|
168
169
|
},
|
|
169
170
|
async (event) => {
|
|
170
|
-
const
|
|
171
|
+
const getAuthHeader = toInstrumentedOdspStorageTokenFetcher(
|
|
171
172
|
odspLogger,
|
|
172
173
|
resolvedUrlData,
|
|
173
174
|
this.getStorageToken,
|
|
@@ -188,7 +189,7 @@ export class OdspDocumentServiceFactoryCore
|
|
|
188
189
|
});
|
|
189
190
|
const _odspResolvedUrl = isNewFileInfo(fileInfo)
|
|
190
191
|
? await module.createNewFluidFile(
|
|
191
|
-
|
|
192
|
+
getAuthHeader,
|
|
192
193
|
fileInfo,
|
|
193
194
|
odspLogger,
|
|
194
195
|
createNewSummary,
|
|
@@ -200,7 +201,7 @@ export class OdspDocumentServiceFactoryCore
|
|
|
200
201
|
this.hostPolicy.enableSingleRequestForShareLinkWithCreate,
|
|
201
202
|
)
|
|
202
203
|
: await module.createNewContainerOnExistingFile(
|
|
203
|
-
|
|
204
|
+
getAuthHeader,
|
|
204
205
|
fileInfo,
|
|
205
206
|
odspLogger,
|
|
206
207
|
createNewSummary,
|
|
@@ -300,11 +301,13 @@ export class OdspDocumentServiceFactoryCore
|
|
|
300
301
|
this.getWebsocketToken === undefined
|
|
301
302
|
? undefined
|
|
302
303
|
: async (options: TokenFetchOptions): Promise<string | null> =>
|
|
304
|
+
// websocket expects a plain token
|
|
303
305
|
toInstrumentedOdspTokenFetcher(
|
|
304
306
|
extLogger,
|
|
305
307
|
resolvedUrlData,
|
|
306
308
|
this.getWebsocketToken!,
|
|
307
309
|
false /* throwOnNullToken */,
|
|
310
|
+
true /* returnPlainToken */,
|
|
308
311
|
)(options, "GetWebsocketToken");
|
|
309
312
|
|
|
310
313
|
return OdspDocumentService.create(
|