diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index bf20e14a438b..3df37c100915 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -190,7 +190,6 @@ specifiers: '@rush-temp/core-auth': file:./projects/core-auth.tgz '@rush-temp/core-client': file:./projects/core-client.tgz '@rush-temp/core-client-1': file:./projects/core-client-1.tgz - '@rush-temp/core-crypto': file:./projects/core-crypto.tgz '@rush-temp/core-http': file:./projects/core-http.tgz '@rush-temp/core-http-compat': file:./projects/core-http-compat.tgz '@rush-temp/core-lro': file:./projects/core-lro.tgz @@ -467,7 +466,6 @@ dependencies: '@rush-temp/core-auth': file:projects/core-auth.tgz '@rush-temp/core-client': file:projects/core-client.tgz '@rush-temp/core-client-1': file:projects/core-client-1.tgz - '@rush-temp/core-crypto': file:projects/core-crypto.tgz '@rush-temp/core-http': file:projects/core-http.tgz '@rush-temp/core-http-compat': file:projects/core-http-compat.tgz '@rush-temp/core-lro': file:projects/core-lro.tgz @@ -939,7 +937,7 @@ packages: resolution: {integrity: sha512-Q71Buur3RMcg6lCnisLL8Im562DBw+ybzgm+YQj/FbAaI8ZNu/zl/5z1fE4k3Q9LSIzYrz6HLRzlhdSBXpydlQ==} engines: {node: '>=8.0.0'} dependencies: - '@azure/core-http': 1.2.3 + '@azure/core-http': 1.2.6 '@azure/core-tracing': 1.0.0-preview.9 '@azure/logger': 1.0.3 '@azure/msal-node': 1.0.0-beta.6_debug@4.3.4 @@ -2405,7 +2403,7 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/chai-as-promised/7.1.5: @@ -2431,7 +2429,7 @@ packages: /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/cookie/0.4.1: @@ -2466,7 +2464,7 @@ packages: /@types/express-serve-static-core/4.17.28: resolution: {integrity: sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 dev: false @@ -2483,26 +2481,26 @@ packages: /@types/fs-extra/8.1.2: resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 3.0.5 - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/is-buffer/2.0.0: resolution: {integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/json-schema/7.0.11: @@ -2516,13 +2514,13 @@ packages: /@types/jsonwebtoken/8.5.8: resolution: {integrity: sha512-zm6xBQpFDIDM6o9r6HSgDeIcLy82TKWctCXEPbJJcXb5AKmi5BNNdLXneixK4lplX3PqIVcwLBCGE/kAGnlD4A==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/jws/3.2.4: resolution: {integrity: sha512-aqtH4dPw1wUjFZaeMD1ak/pf8iXlu/odFe+trJrvw0g1sTh93i+SCykg0Ek8C6B7rVK3oBORbfZAsKO7P10etg==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/long/4.0.2: @@ -2562,13 +2560,13 @@ packages: /@types/mock-fs/4.13.1: resolution: {integrity: sha512-m6nFAJ3lBSnqbvDZioawRvpLXSaPyn52Srf7OfzjubYbYX8MTUdIgDxQl0wEapm4m/pNYSd9TXocpQ0TvZFlYA==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/mock-require/2.0.1: resolution: {integrity: sha512-O7U5DVGboY/Crueb5/huUCIRjKtRVRaLmRDbZJBlDQgJn966z3aiFDN+6AtYviu2ExwMkl34LjT/IiC0OPtKuQ==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/ms/0.7.31: @@ -2582,7 +2580,7 @@ packages: /@types/node-fetch/2.6.1: resolution: {integrity: sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 form-data: 3.0.1 dev: false @@ -2625,7 +2623,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/semaphore/1.1.1: @@ -2636,7 +2634,7 @@ packages: resolution: {integrity: sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==} dependencies: '@types/mime': 1.3.2 - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/sinon/10.0.11: @@ -2658,7 +2656,7 @@ packages: /@types/stoppable/1.1.1: resolution: {integrity: sha512-b8N+fCADRIYYrGZOcmOR8ZNBOqhktWTB/bMUl5LvGtT201QKJZOOH5UsFyI3qtteM6ZAJbJqZoBcLqqxKIwjhw==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/tough-cookie/4.0.2: @@ -2668,13 +2666,13 @@ packages: /@types/tunnel/0.0.1: resolution: {integrity: sha512-AOqu6bQu5MSWwYvehMXLukFHnupHrpZ8nvgae5Ggie9UwzDR1CCwoXgSSWNZJuyOlCdfdsWMA5F2LlmvyoTv8A==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/tunnel/0.0.3: resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/underscore/1.11.4: @@ -2692,26 +2690,26 @@ packages: /@types/ws/7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/ws/8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/xml2js/0.4.11: resolution: {integrity: sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==} dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false /@types/yauzl/2.10.0: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 12.20.50 + '@types/node': 17.0.31 dev: false optional: true @@ -3684,7 +3682,7 @@ packages: resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) dependencies: - ms: 2.1.1 + ms: 2.1.3 dev: false /debug/3.2.7: @@ -3930,7 +3928,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.12 - '@types/node': 12.20.50 + '@types/node': 17.0.31 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -4837,7 +4835,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: false @@ -8647,7 +8645,7 @@ packages: /wide-align/1.1.5: resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} dependencies: - string-width: 1.0.2 + string-width: 4.2.3 dev: false /word-wrap/1.2.3: @@ -14619,50 +14617,6 @@ packages: - utf-8-validate dev: false - file:projects/core-crypto.tgz: - resolution: {integrity: sha512-EpPnh43ug3uTZ84p3dlS9i2Lt81pXx9xraXu4rJZo/iOSjSdtKALhK3Ogf9o93NZumFWQGJjujM17hblE4egfA==, tarball: file:projects/core-crypto.tgz} - name: '@rush-temp/core-crypto' - version: 0.0.0 - dependencies: - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.1.0_rollup@2.72.0 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.72.0 - '@rollup/plugin-replace': 2.4.2_rollup@2.72.0 - '@types/chai': 4.3.1 - '@types/mocha': 7.0.2 - '@types/node': 12.20.50 - '@types/sinon': 9.0.11 - chai: 4.3.6 - cross-env: 7.0.3 - downlevel-dts: 0.8.0 - eslint: 7.32.0 - karma: 6.3.19 - karma-chrome-launcher: 3.1.1 - karma-coverage: 2.2.0 - karma-edge-launcher: 0.4.2_karma@6.3.19 - karma-env-preprocessor: 0.1.1 - karma-firefox-launcher: 1.3.0 - karma-ie-launcher: 1.0.0_karma@6.3.19 - karma-junit-reporter: 2.0.1_karma@6.3.19 - karma-mocha: 2.0.1 - karma-mocha-reporter: 2.2.5_karma@6.3.19 - karma-sourcemap-loader: 0.3.8 - mocha: 7.2.0 - mocha-junit-reporter: 2.0.2_mocha@7.2.0 - prettier: 2.6.2 - rimraf: 3.0.2 - rollup: 2.72.0 - rollup-plugin-sourcemaps: 0.6.3_eeb73d508383ab8a3c8f840a27f46c4e - sinon: 9.2.4 - tslib: 2.4.0 - typescript: 4.6.4 - transitivePeerDependencies: - - bufferutil - - debug - - supports-color - - utf-8-validate - dev: false - file:projects/core-http-compat.tgz: resolution: {integrity: sha512-Sk1riwGJW9D2B0n8WU3eqR3Cz/qhkvopkdOlkK4/qu0v6bWnQk+X3mIE5ylzsFEaxnSd0iOXoynhvC3rYn3ZSQ==, tarball: file:projects/core-http-compat.tgz} name: '@rush-temp/core-http-compat' diff --git a/dataplane.code-workspace b/dataplane.code-workspace index f14270a02928..99796bb0b127 100644 --- a/dataplane.code-workspace +++ b/dataplane.code-workspace @@ -68,10 +68,6 @@ "name": "agrifood-farming", "path": "sdk/agrifood/agrifood-farming-rest" }, - { - "name": "core-crypto", - "path": "sdk/core/core-crypto" - }, { "name": "core-http", "path": "sdk/core/core-http" diff --git a/rush.json b/rush.json index f84a2f4bd05b..f051c1fab022 100644 --- a/rush.json +++ b/rush.json @@ -456,11 +456,6 @@ "projectFolder": "sdk/core/core-client", "versionPolicyName": "core" }, - { - "packageName": "@azure/core-crypto", - "projectFolder": "sdk/core/core-crypto", - "versionPolicyName": "core" - }, { "packageName": "@azure/core-http", "projectFolder": "sdk/core/core-http", diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index 637ccffa94f5..abf5389f4ee1 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -48,8 +48,6 @@ extends: safeName: azurecoreclient - name: azure-rest-core-client safeName: azurerestcoreclient - - name: azure-core-crypto - safeName: azurecorecrypto - name: azure-core-http safeName: azurecorehttp - name: azure-core-rest-pipeline diff --git a/sdk/core/core-crypto/.eslintrc.json b/sdk/core/core-crypto/.eslintrc.json deleted file mode 100644 index 1a065ea7f1a3..000000000000 --- a/sdk/core/core-crypto/.eslintrc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugins": ["@azure/azure-sdk"], - "extends": ["plugin:@azure/azure-sdk/azure-sdk-base"], - "rules": { - "sort-imports": "error" - } -} diff --git a/sdk/core/core-crypto/CHANGELOG.md b/sdk/core/core-crypto/CHANGELOG.md deleted file mode 100644 index 46314a46d180..000000000000 --- a/sdk/core/core-crypto/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# Release History - -## 1.0.0 (Unreleased) - - diff --git a/sdk/core/core-crypto/LICENSE b/sdk/core/core-crypto/LICENSE deleted file mode 100644 index ea8fb1516028..000000000000 --- a/sdk/core/core-crypto/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2020 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/sdk/core/core-crypto/README.md b/sdk/core/core-crypto/README.md deleted file mode 100644 index f609cf210dfc..000000000000 --- a/sdk/core/core-crypto/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Azure Core Crypto client library for JavaScript (Experimental) - -This library is primarily intended to contain cryptographic helper functions for use by the Azure SDK for JavaScript. - -## Getting started - -### Requirements - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. - -### Installation - -This package is not meant to be consumed directly by end users. - -## Key concepts - -This package currently supports the following protocols: - -- SHA-256 HMAC -- SHA-256 HASH - -## Examples - -Examples can be found in the `samples` folder. - -## Next steps - -TODO: ??? - -## Troubleshooting - -If you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new). - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Fcore-crypto%2FREADME.png) diff --git a/sdk/core/core-crypto/api-extractor.json b/sdk/core/core-crypto/api-extractor.json deleted file mode 100644 index 9625253284e5..000000000000 --- a/sdk/core/core-crypto/api-extractor.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "types/latest/src/index.d.ts", - "docModel": { - "enabled": true - }, - "apiReport": { - "enabled": true, - "reportFolder": "./review" - }, - "dtsRollup": { - "enabled": true, - "untrimmedFilePath": "", - "publicTrimmedFilePath": "./types/latest/core-crypto.d.ts" - }, - "messages": { - "tsdocMessageReporting": { - "default": { - "logLevel": "none" - } - }, - "extractorMessageReporting": { - "ae-missing-release-tag": { - "logLevel": "none" - }, - "ae-unresolved-link": { - "logLevel": "none" - } - } - } -} diff --git a/sdk/core/core-crypto/karma.conf.js b/sdk/core/core-crypto/karma.conf.js deleted file mode 100644 index 5d8ab620091a..000000000000 --- a/sdk/core/core-crypto/karma.conf.js +++ /dev/null @@ -1,110 +0,0 @@ -// https://github.com/karma-runner/karma-chrome-launcher -process.env.CHROME_BIN = require("puppeteer").executablePath(); - -module.exports = function (config) { - config.set({ - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: "./", - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ["mocha"], - - plugins: [ - "karma-mocha", - "karma-mocha-reporter", - "karma-chrome-launcher", - "karma-edge-launcher", - "karma-firefox-launcher", - "karma-ie-launcher", - "karma-env-preprocessor", - "karma-coverage", - "karma-sourcemap-loader", - "karma-junit-reporter", - ], - - // list of files / patterns to load in the browser - files: ["dist-test/index.browser.js", "dist-test/webworker.js"], - - // list of files / patterns to exclude - exclude: [], - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - "dist-test/index.browser.js": ["env"], - // IMPORTANT: COMMENT following line if you want to debug in your browsers!! - // Preprocess source file to calculate code coverage, however this will make source file unreadable - "dist-test/index.browser.js": ["sourcemap", "coverage"], - }, - - // inject following environment values into browser testing with window.__env__ - // environment values MUST be exported or set with same console running "karma start" - // https://www.npmjs.com/package/karma-env-preprocessor - // EXAMPLE: envPreprocessor: ["ACCOUNT_NAME", "ACCOUNT_SAS"], - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ["mocha", "coverage", "junit"], - - coverageReporter: { - // specify a common output directory - dir: "coverage-browser/", - reporters: [ - { type: "json", subdir: ".", file: "coverage.json" }, - { type: "lcovonly", subdir: ".", file: "lcov.info" }, - { type: "html", subdir: "html" }, - { type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" }, - ], - }, - - junitReporter: { - outputDir: "", // results will be saved as $outputDir/$browserName.xml - outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile - suite: "", // suite will become the package name attribute in xml testsuite element - useBrowserName: false, // add browser name to report and classes names - nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element - classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element - properties: {}, // key value pair of properties to add to the section of the report - }, - - // web server port - port: 9876, - - // enable / disable colors in the output (reporters and logs) - colors: true, - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: false, - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - // 'ChromeHeadless', 'Chrome', 'Firefox', 'Edge', 'IE' - browsers: ["ChromeHeadless"], - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: true, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: 1, - - browserNoActivityTimeout: 600000, - browserDisconnectTimeout: 10000, - browserDisconnectTolerance: 3, - - client: { - mocha: { - // change Karma's debug.html to the mocha web reporter - reporter: "html", - timeout: "600000", - }, - }, - }); -}; diff --git a/sdk/core/core-crypto/package.json b/sdk/core/core-crypto/package.json deleted file mode 100644 index 0f9bb6120e4c..000000000000 --- a/sdk/core/core-crypto/package.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "name": "@azure/core-crypto", - "version": "1.0.0", - "description": "Core library for exposing crypto helpers.", - "sdk-type": "client", - "main": "dist/index.js", - "module": "dist-esm/src/index.js", - "browser": { - "./dist-esm/src/sha256.js": "./dist-esm/src/sha256.browser.js" - }, - "react-native": { - "./dist/index.js": "./dist-esm/src/index.js" - }, - "types": "types/latest/core-crypto.d.ts", - "typesVersions": { - "<3.6": { - "types/latest/*": [ - "types/3.1/*" - ] - } - }, - "scripts": { - "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", - "build:samples": "echo Obsolete", - "build:test": "tsc -p . && rollup -c rollup.test.config.js 2>&1", - "build:types": "downlevel-dts types/latest/ types/3.1/", - "build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local && npm run build:types", - "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "clean": "rimraf dist dist-* temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "tsc -p . && api-extractor run --local", - "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "integration-test:browser": "echo skipped", - "integration-test:node": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint package.json api-extractor.json src test --ext .ts", - "pack": "npm pack 2>&1", - "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", - "test:node": "npm run clean && tsc -p . && npm run unit-test:node && npm run integration-test:node", - "test": "npm run clean && tsc -p . && npm run unit-test:node && rollup -c rollup.test.config.js 2>&1 && npm run unit-test:browser && npm run integration-test", - "unit-test:browser": "karma start --single-run", - "unit-test:node": "mocha -r esm -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 50000 --full-trace --exclude \"test/**/browser/*.spec.ts\" \"test/**/*.spec.ts\"", - "unit-test": "npm run unit-test:node && npm run unit-test:browser" - }, - "files": [ - "dist/", - "dist-esm/src/", - "types/latest/core-crypto.d.ts", - "types/3.1/core-crypto.d.ts", - "README.md", - "LICENSE" - ], - "repository": "github:Azure/azure-sdk-for-js", - "keywords": [ - "azure", - "cloud" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "engines": { - "node": ">=12.0.0" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-crypto/", - "sideEffects": false, - "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", - "dependencies": { - "@azure/abort-controller": "^1.0.0", - "tslib": "^2.2.0" - }, - "devDependencies": { - "@azure/dev-tool": "^1.0.0", - "@microsoft/api-extractor": "7.18.11", - "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-node-resolve": "^13.0.6", - "@rollup/plugin-replace": "^2.2.0", - "@types/chai": "^4.1.6", - "@types/mocha": "^7.0.2", - "@types/node": "^12.0.0", - "@types/sinon": "^9.0.4", - "@azure/eslint-plugin-azure-sdk": "^3.0.0", - "chai": "^4.2.0", - "downlevel-dts": "^0.8.0", - "cross-env": "^7.0.2", - "eslint": "^7.15.0", - "karma": "^6.2.0", - "karma-chrome-launcher": "^3.0.0", - "karma-coverage": "^2.0.0", - "karma-edge-launcher": "^0.4.2", - "karma-env-preprocessor": "^0.1.1", - "karma-firefox-launcher": "^1.1.0", - "karma-ie-launcher": "^1.0.0", - "karma-junit-reporter": "^2.0.1", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-sourcemap-loader": "^0.3.8", - "mocha": "^7.1.1", - "mocha-junit-reporter": "^2.0.0", - "prettier": "^2.5.1", - "rimraf": "^3.0.0", - "rollup": "^2.0.0", - "rollup-plugin-sourcemaps": "^0.6.3", - "sinon": "^9.0.2", - "typescript": "~4.6.0" - } -} diff --git a/sdk/core/core-crypto/review/core-crypto.api.md b/sdk/core/core-crypto/review/core-crypto.api.md deleted file mode 100644 index 636bb267c6db..000000000000 --- a/sdk/core/core-crypto/review/core-crypto.api.md +++ /dev/null @@ -1,16 +0,0 @@ -## API Report File for "@azure/core-crypto" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -// @public -export function computeSha256Hash(content: string, encoding: "base64" | "hex"): Promise; - -// @public -export function computeSha256Hmac(key: string, stringToSign: string, encoding: "base64" | "hex"): Promise; - - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/core/core-crypto/rollup.test.config.js b/sdk/core/core-crypto/rollup.test.config.js deleted file mode 100644 index cbbb96c676d1..000000000000 --- a/sdk/core/core-crypto/rollup.test.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { makeConfig } from "@azure/dev-tool/shared-config/rollup"; -import * as base from "./rollup.webworker.config"; - -const inputs = makeConfig(require("./package.json")); - -if (!process.env.ONLY_NODE) { - inputs.push(base.webworkerConfig()); -} - -export default inputs; diff --git a/sdk/core/core-crypto/rollup.webworker.config.js b/sdk/core/core-crypto/rollup.webworker.config.js deleted file mode 100644 index 0a40c11b20f5..000000000000 --- a/sdk/core/core-crypto/rollup.webworker.config.js +++ /dev/null @@ -1,53 +0,0 @@ -import path from "path"; -import nodeResolve from "@rollup/plugin-node-resolve"; -import cjs from "@rollup/plugin-commonjs"; -import replace from "@rollup/plugin-replace"; -import sourcemaps from "rollup-plugin-sourcemaps"; - -export function webworkerConfig() { - const baseConfig = { - input: "dist-esm/test/public/browser/webworker.js", - output: { - file: "dist-test/webworker.js", - format: "iife", - sourcemap: true, - }, - preserveSymlinks: false, - plugins: [ - sourcemaps(), - replace({ - delimiters: ["", ""], - values: { - // replace dynamic checks with if (false) since this is for - // browser only. Rollup's dead code elimination will remove - // any code guarded by if (isNode) { ... } - "if (isNode)": "if (false)", - }, - }), - nodeResolve({ - mainFields: ["module", "browser"], - preferBuiltins: false, - }), - cjs(), - ], - }; - - baseConfig.onwarn = (warning) => { - if ( - warning.code === "CIRCULAR_DEPENDENCY" && - warning.importer.indexOf(path.normalize("node_modules/chai/lib") === 0) - ) { - // Chai contains circular references, but they are not fatal and can be ignored. - return; - } - - console.error(`(!) ${warning.message}`); - }; - - // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, rollup started respecting - // the "sideEffects" field in package.json. Since our package.json sets "sideEffects=false", this also - // applies to test code, which causes all tests to be removed by tree-shaking. - baseConfig.treeshake = false; - - return baseConfig; -} diff --git a/sdk/core/core-crypto/src/index.ts b/sdk/core/core-crypto/src/index.ts deleted file mode 100644 index a9d2aa3d159e..000000000000 --- a/sdk/core/core-crypto/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -export { computeSha256Hash, computeSha256Hmac } from "./sha256"; diff --git a/sdk/core/core-crypto/src/sha256.browser.ts b/sdk/core/core-crypto/src/sha256.browser.ts deleted file mode 100644 index cfdb37a4e253..000000000000 --- a/sdk/core/core-crypto/src/sha256.browser.ts +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -/// - -import { base64ToBytes, bufferToBase64 } from "./utils/base64.browser"; -import { bufferToHex } from "./utils/hex"; -import { utf8ToBytes } from "./utils/utf8.browser"; - -let subtleCrypto: SubtleCrypto | undefined; - -/** - * Returns a cached reference to the Web API crypto.subtle object. - * @internal - */ -function getCrypto(): SubtleCrypto { - if (subtleCrypto) { - return subtleCrypto; - } - - if (!self.crypto || !self.crypto.subtle) { - throw new Error("Your browser environment does not support cryptography functions."); - } - - subtleCrypto = self.crypto.subtle; - return subtleCrypto; -} - -const importParams: HmacImportParams = { - name: "HMAC", - hash: { name: "SHA-256" }, -}; - -/** - * Generates a SHA-256 HMAC signature. - * @param key - The HMAC key represented as a base64 string, used to generate the cryptographic HMAC hash. - * @param stringToSign - The data to be signed. - * @param encoding - The textual encoding to use for the returned HMAC digest. - */ -export async function computeSha256Hmac( - key: string, - stringToSign: string, - encoding: "base64" | "hex" -): Promise { - const crypto = getCrypto(); - const keyBytes = base64ToBytes(key); - const stringToSignBytes = utf8ToBytes(stringToSign); - - const cryptoKey = await crypto.importKey("raw", keyBytes, importParams, false, ["sign"]); - const signature = await crypto.sign(importParams, cryptoKey, stringToSignBytes); - - switch (encoding) { - case "base64": - return bufferToBase64(signature); - case "hex": - return bufferToHex(signature); - } -} - -/** - * Generates a SHA-256 hash. - * @param content - The data to be included in the hash. - * @param encoding - The textual encoding to use for the returned hash. - */ -export async function computeSha256Hash( - content: string, - encoding: "base64" | "hex" -): Promise { - const contentBytes = utf8ToBytes(content); - const digest = await getCrypto().digest({ name: "SHA-256" }, contentBytes); - - switch (encoding) { - case "base64": - return bufferToBase64(digest); - case "hex": - return bufferToHex(digest); - } -} diff --git a/sdk/core/core-crypto/src/sha256.ts b/sdk/core/core-crypto/src/sha256.ts deleted file mode 100644 index 338aab15575f..000000000000 --- a/sdk/core/core-crypto/src/sha256.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { createHash, createHmac } from "crypto"; - -/** - * Generates a SHA-256 HMAC signature. - * @param key - The HMAC key represented as a base64 string, used to generate the cryptographic HMAC hash. - * @param stringToSign - The data to be signed. - * @param encoding - The textual encoding to use for the returned HMAC digest. - */ -export async function computeSha256Hmac( - key: string, - stringToSign: string, - encoding: "base64" | "hex" -): Promise { - const decodedKey = Buffer.from(key, "base64"); - - return createHmac("sha256", decodedKey).update(stringToSign).digest(encoding); -} - -/** - * Generates a SHA-256 hash. - * @param content - The data to be included in the hash. - * @param encoding - The textual encoding to use for the returned hash. - */ -export async function computeSha256Hash( - content: string, - encoding: "base64" | "hex" -): Promise { - return createHash("sha256").update(content).digest(encoding); -} diff --git a/sdk/core/core-crypto/src/utils/base64.browser.ts b/sdk/core/core-crypto/src/utils/base64.browser.ts deleted file mode 100644 index ca811a62c0c9..000000000000 --- a/sdk/core/core-crypto/src/utils/base64.browser.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -/// - -/** - * Converts a base64 string into a byte array. - * @param content - The base64 string to convert. - * @internal - */ -export function base64ToBytes(content: string): Uint8Array { - if (typeof atob !== "function") { - throw new Error(`Your browser environment is missing the global "atob" function.`); - } - - const binary = atob(content); - const bytes = new Uint8Array(binary.length); - for (let i = 0; i < binary.length; i++) { - bytes[i] = binary.charCodeAt(i); - } - - return bytes; -} - -/** - * Converts an ArrayBuffer to base64 string. - * @param buffer - Raw binary data. - * @internal - */ -export function bufferToBase64(buffer: ArrayBuffer): string { - if (typeof btoa !== "function") { - throw new Error(`Your browser environment is missing the global "btoa" function.`); - } - - const bytes = new Uint8Array(buffer); - let binary = ""; - for (const byte of bytes) { - binary += String.fromCharCode(byte); - } - return btoa(binary); -} diff --git a/sdk/core/core-crypto/src/utils/hex.ts b/sdk/core/core-crypto/src/utils/hex.ts deleted file mode 100644 index 2b83e38745a9..000000000000 --- a/sdk/core/core-crypto/src/utils/hex.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -/** - * Converts an ArrayBuffer to a hexadecimal string. - * @param buffer - Raw binary data. - * @internal - */ -export function bufferToHex(buffer: ArrayBuffer): string { - const bytes = new Uint8Array(buffer); - return Array.prototype.map.call(bytes, byteToHex).join(""); -} - -/** - * Converts a byte to a hexadecimal string. - * @param byte - An integer representation of a byte. - * @internal - */ -function byteToHex(byte: number): string { - const hex = byte.toString(16); - return hex.length === 2 ? hex : `0${hex}`; -} diff --git a/sdk/core/core-crypto/src/utils/utf8.browser.ts b/sdk/core/core-crypto/src/utils/utf8.browser.ts deleted file mode 100644 index b1532aef2002..000000000000 --- a/sdk/core/core-crypto/src/utils/utf8.browser.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -/// - -let encoder: TextEncoder | undefined; - -/** - * Returns a cached TextEncoder. - * @internal - */ -function getTextEncoder(): TextEncoder { - if (encoder) { - return encoder; - } - - if (typeof TextEncoder === "undefined") { - throw new Error(`Your browser environment is missing "TextEncoder".`); - } - - encoder = new TextEncoder(); - return encoder; -} - -/** - * Converts a utf8 string into a byte array. - * @param content - The utf8 string to convert. - * @internal - */ -export function utf8ToBytes(content: string): Uint8Array { - return getTextEncoder().encode(content); -} diff --git a/sdk/core/core-crypto/test/internal/browser/base64.spec.ts b/sdk/core/core-crypto/test/internal/browser/base64.spec.ts deleted file mode 100644 index ef8213bd55ed..000000000000 --- a/sdk/core/core-crypto/test/internal/browser/base64.spec.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { base64ToBytes, bufferToBase64 } from "../../../src/utils/base64.browser"; -import { assert } from "chai"; - -describe("Base64", function () { - describe("base64ToBytes", function () { - it("converts a base64 string to bytes", function () { - const input = "YXp1cmU="; // 'azure' in utf8. - - const output = base64ToBytes(input); - assert.deepEqual( - output, - new Uint8Array([97, 122, 117, 114, 101]), - "Incorrect conversion of base64 to bytes." - ); - }); - }); - - describe("bufferToBase64", function () { - it("converts an ArrayBuffer to a base64 string", function () { - const input = new Uint8Array([97, 122, 117, 114, 101]).buffer; // 'azure' in utf8. - - const output = bufferToBase64(input); - assert.deepEqual(output, "YXp1cmU=", "Incorrect conversion of bytes to base64."); - }); - - it("has proper padding", function () { - const scenarios = [ - { bytes: new Uint8Array([65]), expected: "QQ==" }, - { bytes: new Uint8Array([65, 90]), expected: "QVo=" }, - { bytes: new Uint8Array([65, 66, 67]), expected: "QUJD" }, - ]; - - for (const scenario of scenarios) { - const output = bufferToBase64(scenario.bytes.buffer); - assert.equal(output, scenario.expected, "Incorrect conversion of bytes to base64."); - } - }); - }); -}); diff --git a/sdk/core/core-crypto/test/internal/browser/utf8.spec.ts b/sdk/core/core-crypto/test/internal/browser/utf8.spec.ts deleted file mode 100644 index 7ca5010907ec..000000000000 --- a/sdk/core/core-crypto/test/internal/browser/utf8.spec.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { assert } from "chai"; -import { utf8ToBytes } from "../../../src/utils/utf8.browser"; - -describe("utf-8", function () { - describe("utf8ToBytes", function () { - it("converts a utf-8 string to bytes", function () { - const input = "azure"; // 'azure' in utf8. - - const output = utf8ToBytes(input); - assert.deepEqual( - output, - new Uint8Array([97, 122, 117, 114, 101]), - "Incorrect conversion of utf-8 to bytes." - ); - }); - }); -}); diff --git a/sdk/core/core-crypto/test/internal/hex.spec.ts b/sdk/core/core-crypto/test/internal/hex.spec.ts deleted file mode 100644 index 7db6c18d8ab6..000000000000 --- a/sdk/core/core-crypto/test/internal/hex.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { assert } from "chai"; -import { bufferToHex } from "../../src/utils/hex"; - -function generateValidBytes(): Uint8Array { - const bytes = new Uint8Array(256); - return bytes.map((_, index) => index); -} - -describe("Hex", function () { - describe("bufferToHex", function () { - it("encodes a byte", function () { - const bytes = generateValidBytes(); - bytes.forEach((_, index) => { - const hex = bufferToHex(bytes.buffer.slice(index, index + 1)); - assert.equal(hex.length, 2, "Unexpected length for hex value."); - assert.equal(parseInt(hex, 16), index, "Unexpected hex value."); - }); - }); - - it("encodes bytes", function () { - const bytes = new Uint8Array([97, 122, 117, 114, 101]); // 'azure' in utf8 - const hex = bufferToHex(bytes.buffer); - assert.equal(hex, "617a757265", "Unexpected hex value."); - }); - }); -}); diff --git a/sdk/core/core-crypto/test/public/browser/webworker-runner.spec.ts b/sdk/core/core-crypto/test/public/browser/webworker-runner.spec.ts deleted file mode 100644 index 08e5bd842e7b..000000000000 --- a/sdk/core/core-crypto/test/public/browser/webworker-runner.spec.ts +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { HashMessage, HmacMessage } from "./webworker"; -import { assert } from "chai"; - -describe("SHA-256 (WebWorker)", function () { - const worker = new Worker("/base/dist-test/webworker.js"); - - function postMessage(message: HashMessage | HmacMessage): Promise { - return new Promise((resolve) => { - worker.postMessage(message); - const listener = (event: MessageEvent): void => { - worker.removeEventListener("message", listener); - resolve(event.data); - }; - worker.addEventListener("message", listener); - }); - } - - after(function () { - worker.terminate(); - }); - - describe("Hash", function () { - it("base64 encoding", async function () { - const hash = await postMessage({ - type: "hash", - algorithm: "sha256", - content: "azure", - encoding: "base64", - }); - - assert.equal( - hash, - "efQ8O5wj+98pO9uoDas4uhlPwdp5GHCRs9N2Da2EC/g=", - "The computed hash does not match the expected value." - ); - }); - - it("hex encoding", async function () { - const hash = await postMessage({ - type: "hash", - algorithm: "sha256", - content: "azure", - encoding: "hex", - }); - - assert.equal( - hash, - "79f43c3b9c23fbdf293bdba80dab38ba194fc1da79187091b3d3760dad840bf8", - "The computed hash does not match the expected value." - ); - }); - }); - - describe("HMAC", function () { - const base64EncodedKey = "c2VjcmV0"; // 'secret' in utf8. - - it("base64 encoding", async function () { - const hmac = await postMessage({ - type: "hmac", - algorithm: "sha256", - key: base64EncodedKey, - stringToSign: "azure", - encoding: "base64", - }); - - assert.equal( - hmac, - "AJ/qUoDtgLeA1A5ND2AS3uF7hsSe9O7imtXlkAj8VR4=", - "The computed hmac does not match the expected value." - ); - }); - - it("hex encoding", async function () { - const hmac = await postMessage({ - type: "hmac", - algorithm: "sha256", - key: base64EncodedKey, - stringToSign: "azure", - encoding: "hex", - }); - - assert.equal( - hmac, - "009fea5280ed80b780d40e4d0f6012dee17b86c49ef4eee29ad5e59008fc551e", - "The computed hmac does not match the expected value." - ); - }); - }); -}); diff --git a/sdk/core/core-crypto/test/public/browser/webworker.ts b/sdk/core/core-crypto/test/public/browser/webworker.ts deleted file mode 100644 index 3e9e2d85a379..000000000000 --- a/sdk/core/core-crypto/test/public/browser/webworker.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { computeSha256Hash, computeSha256Hmac } from "../../../src/index"; - -export interface HashMessage { - type: "hash"; - algorithm: "sha256"; - encoding: "base64" | "hex"; - content: string; -} - -export interface HmacMessage { - type: "hmac"; - algorithm: "sha256"; - encoding: "base64" | "hex"; - key: string; - stringToSign: string; -} - -onmessage = async (event: MessageEvent) => { - let result: string | undefined; - switch (event.data.type) { - case "hash": - result = await handleHashMessage(event.data); - break; - case "hmac": - result = await handleHmacMessage(event.data); - break; - } - - // https://github.com/microsoft/TypeScript/issues/20595 - (self as unknown as Worker).postMessage(result); -}; - -function handleHashMessage(message: HashMessage): Promise { - if (message.algorithm === "sha256") { - return computeSha256Hash(message.content, message.encoding); - } - return Promise.resolve(""); -} - -function handleHmacMessage(message: HmacMessage): Promise { - if (message.algorithm === "sha256") { - return computeSha256Hmac(message.key, message.stringToSign, message.encoding); - } - return Promise.resolve(""); -} diff --git a/sdk/core/core-crypto/test/public/sha256.spec.ts b/sdk/core/core-crypto/test/public/sha256.spec.ts deleted file mode 100644 index 5e968f94abd3..000000000000 --- a/sdk/core/core-crypto/test/public/sha256.spec.ts +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { computeSha256Hash, computeSha256Hmac } from "../../src/index"; -import { assert } from "chai"; - -describe("SHA-256", function () { - describe("Hash", function () { - it("base64 encoding", async function () { - const hash = await computeSha256Hash("azure", "base64"); - - assert.equal( - hash, - "efQ8O5wj+98pO9uoDas4uhlPwdp5GHCRs9N2Da2EC/g=", - "The computed hash does not match the expected value." - ); - }); - - it("hex encoding", async function () { - const hash = await computeSha256Hash("azure", "hex"); - - assert.equal( - hash, - "79f43c3b9c23fbdf293bdba80dab38ba194fc1da79187091b3d3760dad840bf8", - "The computed hash does not match the expected value." - ); - }); - }); - - describe("HMAC", function () { - const base64EncodedKey = "c2VjcmV0"; // 'secret' in utf8. - - it("base64 encoding", async function () { - const hmac = await computeSha256Hmac(base64EncodedKey, "azure", "base64"); - - assert.equal( - hmac, - "AJ/qUoDtgLeA1A5ND2AS3uF7hsSe9O7imtXlkAj8VR4=", - "The computed hmac does not match the expected value." - ); - }); - - it("hex encoding", async function () { - const hmac = await computeSha256Hmac(base64EncodedKey, "azure", "hex"); - - assert.equal( - hmac, - "009fea5280ed80b780d40e4d0f6012dee17b86c49ef4eee29ad5e59008fc551e", - "The computed hmac does not match the expected value." - ); - }); - }); -}); diff --git a/sdk/core/core-crypto/tsconfig.json b/sdk/core/core-crypto/tsconfig.json deleted file mode 100644 index 4a53cc511418..000000000000 --- a/sdk/core/core-crypto/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../../tsconfig.package", - "compilerOptions": { - "outDir": "./dist-esm", - "declarationDir": "./types/latest" - }, - "exclude": ["node_modules", "types", "temp", "browser", "dist", "dist-esm", "./samples/**/*.ts"] -} diff --git a/sdk/core/core-crypto/tsdoc.json b/sdk/core/core-crypto/tsdoc.json deleted file mode 100644 index 81c5a8a2aa2f..000000000000 --- a/sdk/core/core-crypto/tsdoc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", - "extends": ["../../../tsdoc.json"] -}