@adobe/helix-onedrive-support 11.0.1 → 11.0.3
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/CHANGELOG.md +14 -0
- package/package.json +2 -2
- package/src/OneDrive.js +2 -2
- package/src/OneDriveAuth.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [11.0.3](https://github.com/adobe/helix-onedrive-support/compare/v11.0.2...v11.0.3) (2023-10-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* report authenticate failures as 401 ([#454](https://github.com/adobe/helix-onedrive-support/issues/454)) ([26caba0](https://github.com/adobe/helix-onedrive-support/commit/26caba08586beecb08bf88ed5e0afe9032fbb9ae))
|
|
7
|
+
|
|
8
|
+
## [11.0.2](https://github.com/adobe/helix-onedrive-support/compare/v11.0.1...v11.0.2) (2023-10-20)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update dependency @adobe/helix-shared-tokencache to v1.3.12 ([f4ffa5f](https://github.com/adobe/helix-onedrive-support/commit/f4ffa5f89bf3857d0e6a9e233a95962f9af36994))
|
|
14
|
+
|
|
1
15
|
## [11.0.1](https://github.com/adobe/helix-onedrive-support/compare/v11.0.0...v11.0.1) (2023-10-18)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-onedrive-support",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.3",
|
|
4
4
|
"description": "Helix OneDrive Support",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"homepage": "https://github.com/adobe/helix-onedrive-support#readme",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@adobe/fetch": "4.1.0",
|
|
31
|
-
"@adobe/helix-shared-tokencache": "1.3.
|
|
31
|
+
"@adobe/helix-shared-tokencache": "1.3.12",
|
|
32
32
|
"@azure/msal-node": "2.2.0",
|
|
33
33
|
"jose": "4.15.4"
|
|
34
34
|
},
|
package/src/OneDrive.js
CHANGED
|
@@ -218,7 +218,7 @@ export class OneDrive {
|
|
|
218
218
|
try {
|
|
219
219
|
return await this.doFetch(`/shares/${link}/driveItem`);
|
|
220
220
|
} catch (e) {
|
|
221
|
-
if (e.statusCode === 401 || e.statusCode === 403) {
|
|
221
|
+
if ((e.statusCode === 401 && e.details?.code !== 'silentAcquireFailed') || e.statusCode === 403) {
|
|
222
222
|
// an inexistent share returns either 401 or 403, we prefer to just say it wasn't found
|
|
223
223
|
throw new StatusCodeError(e.message, 404, e.details);
|
|
224
224
|
}
|
|
@@ -535,7 +535,7 @@ export class OneDrive {
|
|
|
535
535
|
log: this.log,
|
|
536
536
|
});
|
|
537
537
|
} catch (e) {
|
|
538
|
-
if (e.statusCode === 401) {
|
|
538
|
+
if (e.statusCode === 401 && e.details?.code !== 'silentAcquireFailed') {
|
|
539
539
|
// an inexistant share returns 401, we prefer to just say it wasn't found
|
|
540
540
|
throw new StatusCodeError(e.message, 404, e.details);
|
|
541
541
|
}
|
package/src/OneDriveAuth.js
CHANGED
|
@@ -15,6 +15,7 @@ import { keepAliveNoCache } from '@adobe/fetch';
|
|
|
15
15
|
import { ConfidentialClientApplication, LogLevel, PublicClientApplication } from '@azure/msal-node';
|
|
16
16
|
import { MemCachePlugin } from '@adobe/helix-shared-tokencache';
|
|
17
17
|
import { decodeJwt } from 'jose';
|
|
18
|
+
import { StatusCodeError } from './StatusCodeError.js';
|
|
18
19
|
|
|
19
20
|
const AZ_AUTHORITY_HOST_URL = 'https://login.windows.net';
|
|
20
21
|
const AZ_COMMON_TENANT = 'common';
|
|
@@ -343,7 +344,8 @@ export class OneDriveAuth {
|
|
|
343
344
|
throw e;
|
|
344
345
|
}
|
|
345
346
|
|
|
346
|
-
|
|
347
|
+
const message = 'Unable to acquire token silently and no other acquire method supplied';
|
|
348
|
+
throw new StatusCodeError(message, 401, { code: 'silentAcquireFailed', message });
|
|
347
349
|
}
|
|
348
350
|
|
|
349
351
|
/**
|