Skip to content

Commit

Permalink
Replace nanoid with crypto (#4769)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceciliaavila authored Oct 29, 2024
1 parent 6ef8274 commit d00038a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
3 changes: 1 addition & 2 deletions testing/botbuilder-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"@types/node-forge": "^1.3.11"
},
"dependencies": {
"eslint-plugin-only-warn": "^1.1.0",
"nanoid": "^3.3.7",
"eslint-plugin-only-warn": "^1.1.0",
"node-forge": "^1.3.1",
"zod": "^3.23.8"
}
Expand Down
6 changes: 3 additions & 3 deletions testing/botbuilder-test-utils/src/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import forge from 'node-forge';
import jwt, { Algorithm } from 'jsonwebtoken'; // eslint-disable-line import/no-extraneous-dependencies
import nock from 'nock'; // eslint-disable-line import/no-extraneous-dependencies
import url from 'url';
import { nanoid } from 'nanoid';
import { ok } from 'assert';
import { randomUUID } from 'crypto';

/**
* Registers mocha hooks for proper usage
Expand Down Expand Up @@ -62,10 +62,10 @@ export function stub(options: Partial<Options> = {}): Result {
algorithm = 'RS256',
bits = 2048,
expiresIn = 1000 * 60 * 5,
host = `https://${nanoid()}.jwt.localhost`,
host = `https://${randomUUID()}.jwt.localhost`,
issuer = 'iss',
jwks = { path: '/v1/.well-known/jwks' },
keyId = nanoid(),
keyId = randomUUID(),
metadata = { path: '/v1/.well-known/openid' },
} = options;

Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12010,11 +12010,6 @@ nanoid@^3.3.6:
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c"
integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==

nanoid@^3.3.7:
version "3.3.7"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==

napi-build-utils@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806"
Expand Down

0 comments on commit d00038a

Please sign in to comment.