Skip to content

Commit 11d7bf3

Browse files
committed
merge: merge branch 'THU/replace_guid_dependency'
2 parents 5a01761 + b92eefc commit 11d7bf3

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

api/GetEmbedInfo/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Cosmo Tech.
22
// Licensed under the MIT license.
33

4-
const guid = require('guid');
4+
const uuid = require('uuid');
55
const jwt = require('jsonwebtoken');
66
const jwksClient = require('jwks-rsa');
77
const { MSAL_CONFIG, GUID_PARAMETERS, REQUIRED_PARAMETERS, getConfigValue } = require('./config');
@@ -19,7 +19,7 @@ const sanitizeAndValidateConfig = () => {
1919

2020
for (const parameter of GUID_PARAMETERS) {
2121
const sanitizedValue = getConfigValue(parameter);
22-
if (sanitizedValue && !guid.isGuid(sanitizedValue))
22+
if (sanitizedValue && !uuid.validate(sanitizedValue))
2323
throw new ServiceAccountError(
2424
500,
2525
'Configuration error',
@@ -88,7 +88,7 @@ const validateQuery = async (req) => {
8888
);
8989

9090
for (const reportId of reportsIds) {
91-
if (!guid.isGuid(reportId))
91+
if (!uuid.validate(reportId))
9292
throw new ServiceAccountError(
9393
400,
9494
'Bad request',
@@ -98,7 +98,7 @@ const validateQuery = async (req) => {
9898

9999
// Check PowerBI workspace id parameter
100100
const workspaceId = req?.body?.workspaceId;
101-
if (workspaceId != null && !guid.isGuid(workspaceId))
101+
if (workspaceId != null && !uuid.validate(workspaceId))
102102
throw new ServiceAccountError(
103103
400,
104104
'Bad request',

api/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
},
1010
"dependencies": {
1111
"@azure/msal-node": "^2.16.2",
12-
"guid": "0.0.12",
1312
"jsonwebtoken": "^9.0.2",
14-
"jwks-rsa": "^3.2.0"
13+
"jwks-rsa": "^3.2.0",
14+
"uuid": "^11.1.0"
1515
},
1616
"engines": {
1717
"node": "^18"

api/yarn.lock

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ __metadata:
146146
resolution: "api@workspace:."
147147
dependencies:
148148
"@azure/msal-node": "npm:^2.16.2"
149-
guid: "npm:0.0.12"
150149
jsonwebtoken: "npm:^9.0.2"
151150
jwks-rsa: "npm:^3.2.0"
151+
uuid: "npm:^11.1.0"
152152
languageName: unknown
153153
linkType: soft
154154

@@ -180,13 +180,6 @@ __metadata:
180180
languageName: node
181181
linkType: hard
182182

183-
"guid@npm:0.0.12":
184-
version: 0.0.12
185-
resolution: "guid@npm:0.0.12"
186-
checksum: 10c0/e7db93917a7fce9871f7d02651a5c250691213a7c97f3943e04e8c73885122e61289c833d10aa35b6eea253a11a2c3431100c3b5b5ecfdbdb8f58340211efae0
187-
languageName: node
188-
linkType: hard
189-
190183
"jose@npm:^4.15.4":
191184
version: 4.15.9
192185
resolution: "jose@npm:4.15.9"
@@ -366,6 +359,15 @@ __metadata:
366359
languageName: node
367360
linkType: hard
368361

362+
"uuid@npm:^11.1.0":
363+
version: 11.1.0
364+
resolution: "uuid@npm:11.1.0"
365+
bin:
366+
uuid: dist/esm/bin/uuid
367+
checksum: 10c0/34aa51b9874ae398c2b799c88a127701408cd581ee89ec3baa53509dd8728cbb25826f2a038f9465f8b7be446f0fbf11558862965b18d21c993684297628d4d3
368+
languageName: node
369+
linkType: hard
370+
369371
"uuid@npm:^8.3.0":
370372
version: 8.3.2
371373
resolution: "uuid@npm:8.3.2"

0 commit comments

Comments
 (0)