Skip to content

Commit b729674

Browse files
authored
Update Node.js & browser support in README (Azure#16011)
1 parent 82085ff commit b729674

File tree

73 files changed

+336
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+336
-174
lines changed

common/tools/dev-tool/src/templates/sampleReadme.md.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import YAML from "yaml";
66

77
import prettier from "prettier";
88

9-
import { MIN_SUPPORTED_NODE_VERSION } from "../util/sampleConfiguration";
109
import { SampleReadmeConfiguration } from "../util/sampleGenerationInfo";
1110

1211
/**
@@ -166,7 +165,7 @@ ${table(info)}
166165
167166
## Prerequisites
168167
169-
The sample programs are compatible with Node.js >=${MIN_SUPPORTED_NODE_VERSION}.
168+
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
170169
171170
${(() => {
172171
if (info.useTypeScript) {

samples/cors/ts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ This sample demonstrates a few alternatives to integrating with Azure Key Vault
3737

3838
## Prerequisites
3939

40-
The sample is compatible with Node.js >= 8.0.0
40+
The sample is compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/)
4141

4242
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript].
4343

samples/frameworks/electron/ts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ In this sample, we build a simple [Electron][electron] application and integrati
99

1010
## Prerequisites
1111

12-
The samples are compatible with Node.js >= 8.0.0.
12+
The samples are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/)
1313

1414
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript].
1515

samples/frameworks/react/ts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ In this sample, we build a simple Todo application in React using [create-react-
99

1010
## Prerequisites
1111

12-
The samples are compatible with Node.js >= 8.0.0.
12+
The samples are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
1313

1414
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript].
1515

samples/web-workers/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ In this sample we demonstrate how to polyfill the necessary APIs for using our l
1212

1313
### XML Parsing
1414

15-
When used in the browser, our XML parsing library relies on DOM APIs to support parsing and stringifying XML. Since the DOM APIs are generally available this reduces bundle size and minimizes our dependencies. When running from a Web Worker, however, DOM APIs are not available. This is a browser limitation and requires a polyfill before importing our client libraries in web workers.
15+
When used in the browser, our XML parsing library relies on DOM APIs to support parsing and stringifying XML. Since the DOM APIs are generally available this reduces bundle size and minimizes our dependencies. When running from a Web Worker, however, DOM APIs are not available. This is a browser limitation and requires a polyfill before importing our client libraries in web workers.
1616

1717
> Note: Not all client libraries use XML. When running in a web worker, our library will emit a useful error explaining what APIs are required if they are missing so that you can add them as needed.
1818
1919
In these samples we use [JSDOM][jsdom] but you can use any library that provides a DOM implementation.
2020

2121
## Prerequisites
2222

23-
The samples are compatible with Node.js >= 8.0.0.
23+
The samples are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
2424

2525
Before running the TypeScript samples, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript].
2626

sdk/anomalydetector/ai-anomaly-detector/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Key links:
66

77
- [Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/anomalydetector/ai-anomaly-detector/)
88
- [Package (NPM)](https://www.npmjs.com/package/@azure/ai-anomaly-detector)
9-
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/ai-anomaly-detector)
10-
- [Product documentation](https://docs.microsoft.com/azure/cognitive-services/anomaly-detector/)
9+
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/ai-anomaly-detector)
10+
- [Product documentation](https://docs.microsoft.com/azure/cognitive-services/anomaly-detector/)
1111
- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/anomalydetector/ai-anomaly-detector/samples)
1212

1313
## Key concepts
@@ -22,7 +22,10 @@ The `AnomalyDetectorClient` provides methods for anomaly detection:
2222

2323
### Currently supported environments
2424

25-
- Node.js version 8.x.x or higher
25+
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
26+
- Latest versions of Safari, Chrome, Edge, and Firefox.
27+
28+
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
2629

2730
### Prerequisites
2831

sdk/appconfiguration/app-configuration/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,17 @@ Key links:
2424
npm install @azure/app-configuration
2525
```
2626

27+
### Currently supported environments
28+
29+
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
30+
- Latest versions of Safari, Chrome, Edge, and Firefox.
31+
32+
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
33+
2734
### Prerequisites
2835

29-
- You must have an [Azure Subscription](https://azure.microsoft.com) and an [App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/) resource to use this package.
30-
- Node.js version 8.x.x or higher
36+
- An [Azure Subscription](https://azure.microsoft.com)
37+
- An [App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/) resource
3138

3239
### Create an App Configuration resource
3340

sdk/appconfiguration/app-configuration/sample-react/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This sample application shows how to use the Feature Flags.
44

55
## Prerequisites
66

7-
The samples are compatible with Node.js >= 8.0.0.
7+
The samples are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
88

99
You need [an Azure subscription][freesub] and the following resources created to run this sample:
1010

sdk/attestation/attestation/README.md

Lines changed: 62 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,28 @@ For a more complete view of Azure libraries, see the [azure sdk typescript relea
1414
1515
Key links:
1616

17-
- [Source code][source_code]
18-
- [Package (NPM)][Attestation_npm]
19-
- [API reference documentation][API_reference]
17+
- [Source code][source_code]
18+
- [Package (NPM)][attestation_npm]
19+
- [API reference documentation][api_reference]
2020
- [Product documentation](https://docs.microsoft.com/azure/attestation/)
2121

2222
## Getting started
2323

2424
### Currently supported environments
2525

26-
- Node.js version 8.x.x or higher
26+
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
27+
- Latest versions of Safari, Chrome, Edge, and Firefox.
28+
29+
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
2730

2831
### Prerequisites
2932

30-
- An Azure subscription. To use Azure services, including the Microsoft Azure Attestation service, you'll need a subscription. If you do not have an existing Azure account, you may sign up for a [free trial][azure_sub] or use your [Visual Studio Subscription](https://visualstudio.microsoft.com/subscriptions/) benefits when you [create an account](https://account.windowsazure.com/Home/Index).
33+
- An [Azure Subscription](https://azure.microsoft.com)
3134
- An existing Azure Attestation Instance, or you can use the "shared provider" available in each Azure region. If you need to create an Azure Attestation service instance, you can use the Azure Portal or [Azure CLI][azure_cli].
3235

3336
### Install the @azure/attestation package
3437

35-
Install the Microsoft Azure Attestation client library for JavaScript with [NPM][Attestation_npm]:
38+
Install the Microsoft Azure Attestation client library for JavaScript with [NPM][attestation_npm]:
3639

3740
```Powershell
3841
npm install @azure/attestation
@@ -41,9 +44,9 @@ npm install @azure/attestation
4144
### Authenticate the client
4245

4346
In order to interact with the Microsoft Azure Attestation service, you'll need to create an instance of the [Attestation Client][attestation_client] or [Attestation Administration Client][attestation_admin_client] class. You need a **attestation instance url**, which you may see as "DNS Name" in the portal,
44-
and **client secret credentials (client id, client secret, tenant id)** to instantiate a client object.
47+
and **client secret credentials (client id, client secret, tenant id)** to instantiate a client object.
4548

46-
Client secret credential authentication is being used in this getting started section but you can find more ways to authenticate with [Azure identity][azure_identity]. To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below,
49+
Client secret credential authentication is being used in this getting started section but you can find more ways to authenticate with [Azure identity][azure_identity]. To use the [DefaultAzureCredential][defaultazurecredential] provider shown below,
4750
or other credential providers provided with the Azure SDK, you should install the Azure.Identity package:
4851

4952
```Powershell
@@ -56,35 +59,35 @@ Use the [Azure CLI][azure_cli] snippet below to create/get client secret credent
5659

5760
- Create a service principal and configure its access to Azure resources:
5861

59-
```Powershell
60-
az ad sp create-for-rbac -n <your-application-name> --skip-assignment
61-
```
62+
```Powershell
63+
az ad sp create-for-rbac -n <your-application-name> --skip-assignment
64+
```
6265

63-
Output:
66+
Output:
6467

65-
```json
66-
{
67-
"appId": "generated-app-ID",
68-
"displayName": "dummy-app-name",
69-
"name": "http://dummy-app-name",
70-
"password": "random-password",
71-
"tenant": "tenant-ID"
72-
}
73-
```
68+
```json
69+
{
70+
"appId": "generated-app-ID",
71+
"displayName": "dummy-app-name",
72+
"name": "http://dummy-app-name",
73+
"password": "random-password",
74+
"tenant": "tenant-ID"
75+
}
76+
```
7477

7578
- Take note of the service principal objectId
7679

77-
```Powershell
78-
az ad sp show --id <appId> --query objectId
79-
```
80+
```Powershell
81+
az ad sp show --id <appId> --query objectId
82+
```
8083

81-
Output:
84+
Output:
8285

83-
```Powershell
84-
"<your-service-principal-object-id>"
85-
```
86+
```Powershell
87+
"<your-service-principal-object-id>"
88+
```
8689

87-
- Use the returned credentials above to set **AZURE_CLIENT_ID** (appId), **AZURE_CLIENT_SECRET** (password), and **AZURE_TENANT_ID** (tenant) environment variables. The following example shows a way to do this in Powershell:
90+
- Use the returned credentials above to set **AZURE_CLIENT_ID** (appId), **AZURE_CLIENT_SECRET** (password), and **AZURE_TENANT_ID** (tenant) environment variables. The following example shows a way to do this in Powershell:
8891

8992
```Powershell
9093
$Env:AZURE_CLIENT_ID="generated-app-ID"
@@ -99,7 +102,7 @@ For more information about the Azure Identity APIs and how to use them, see [Azu
99102
There are four major families of functionality provided in this preview SDK:
100103

101104
- [SGX and TPM enclave attestation.](#attestation)
102-
- [MAA Attestation Token signing certificate discovery and validation.](#attestation-token-signing-certificate-discovery-and-validation)
105+
- [MAA Attestation Token signing certificate discovery and validation.](#attestation-token-signing-certificate-discovery-and-validation)
103106
- [Attestation Policy management.](#policy-management)
104107
- [Attestation policy management certificate management](#policy-management-certificate-management) (yes, policy management management).
105108

@@ -143,9 +146,9 @@ clients to "roll" the policy management certificates.
143146

144147
### Isolated Mode and AAD Mode
145148

146-
Each Microsoft Azure Attestation service instance operates in either "AAD" mode or "Isolated" mode. When an MAA instance is operating in AAD mode, it means that the customer which created the attestation instance allows Azure Active Directory and Azure Role Based Access control policies to verify access to the attestation instance.
149+
Each Microsoft Azure Attestation service instance operates in either "AAD" mode or "Isolated" mode. When an MAA instance is operating in AAD mode, it means that the customer which created the attestation instance allows Azure Active Directory and Azure Role Based Access control policies to verify access to the attestation instance.
147150

148-
### *AttestationType*
151+
### _AttestationType_
149152

150153
The Microsoft Azure Attestation service supports attesting different types of evidence depending on the environment.
151154
Currently, MAA supports the following Trusted Execution environments:
@@ -186,13 +189,13 @@ The `getPolicy` method retrieves the attestation policy from the service.
186189
Attestation Policies are instanced on a per-attestation type basis, the `AttestationType` parameter defines the type to retrieve.
187190

188191
```js
189-
const policyResult = await adminClient.getPolicy(attestationType);
192+
const policyResult = await adminClient.getPolicy(attestationType);
190193

191-
// The text policy document is available in the `policyResult.value`
192-
// property.
194+
// The text policy document is available in the `policyResult.value`
195+
// property.
193196

194-
// The actual attestation token returned by the MAA service is available
195-
// in `policyResult.token`.
197+
// The actual attestation token returned by the MAA service is available
198+
// in `policyResult.token`.
196199
```
197200

198201
### Set an attestation policy for a specified attestation type
@@ -222,20 +225,19 @@ There are two properties provided in the [PolicyResult][attestation_policy_resul
222225
To verify the hash, clients can generate an attestation token and verify the hash generated from that token:
223226

224227
```js
225-
const expectedPolicy = AttestationToken.create(
226-
{
227-
body: new StoredAttestationPolicy(minimalPolicy).serialize(),
228-
signer: signer
229-
});
230-
231-
// Use your favorite SHA256 hash generator function to create a hash of the
232-
// stringized JWS. The tests in this package use `KJUR.crypto.Util.hashString(buffer, "sha256")`
233-
// from the `jsrsasign` library, but any crypto library will
234-
// work.
235-
const expectedHash = generateSha256Hash(expectedPolicy.serialize());
236-
237-
// The hash returned in expectedHash will match the value in
238-
// `setResult.value.policy_token_hash.
228+
const expectedPolicy = AttestationToken.create({
229+
body: new StoredAttestationPolicy(minimalPolicy).serialize(),
230+
signer: signer
231+
});
232+
233+
// Use your favorite SHA256 hash generator function to create a hash of the
234+
// stringized JWS. The tests in this package use `KJUR.crypto.Util.hashString(buffer, "sha256")`
235+
// from the `jsrsasign` library, but any crypto library will
236+
// work.
237+
const expectedHash = generateSha256Hash(expectedPolicy.serialize());
238+
239+
// The hash returned in expectedHash will match the value in
240+
// `setResult.value.policy_token_hash.
239241
```
240242

241243
### Attest SGX Enclave
@@ -248,7 +250,7 @@ One solution to this problem is what is known as "Secure Key Release", which is
248250

249251
To implement the "Secure Key Release" pattern, the enclave code generates an ephemeral asymmetric key. It then serializes the public portion of the key to some format (possibly a JSON Web Key, or PEM, or some other serialization format).
250252

251-
The enclave code then calculates the SHA256 value of the public key and passes it as an input to code which generates an SGX Quote (for OpenEnclave, that would be the [oe_get_evidence](https://openenclave.io/apidocs/v0.14/attester_8h_a7d197e42468636e95a6ab97b8e74c451.html#a7d197e42468636e95a6ab97b8e74c451) or [oe_get_report](https://openenclave.io/apidocs/v0.14/enclave_8h_aefcb89c91a9078d595e255bd7901ac71.html#aefcb89c91a9078d595e255bd7901ac71)).
253+
The enclave code then calculates the SHA256 value of the public key and passes it as an input to code which generates an SGX Quote (for OpenEnclave, that would be the [oe_get_evidence](https://openenclave.io/apidocs/v0.14/attester_8h_a7d197e42468636e95a6ab97b8e74c451.html#a7d197e42468636e95a6ab97b8e74c451) or [oe_get_report](https://openenclave.io/apidocs/v0.14/enclave_8h_aefcb89c91a9078d595e255bd7901ac71.html#aefcb89c91a9078d595e255bd7901ac71)).
252254

253255
The client then sends the SGX quote and the serialized key to the attestation service. The attestation service will validate the quote and ensure that the hash of the key is present in the quote and will issue an "Attestation Token".
254256

@@ -259,11 +261,9 @@ This example shows one common pattern of calling into the attestation service to
259261
This example assumes that you have an existing `AttestationClient` object which is configured with the base URI for your endpoint. It also assumes that you have an SGX Quote (`quote`) generated from within the SGX enclave you are attesting, and "Runtime Data" (`binaryRuntimeData`) which is referenced in the SGX Quote.
260262

261263
```ts
262-
const attestationResult = await client.attestOpenEnclave(
263-
quote,
264-
{
265-
runTimeData: new AttestationData(binaryRuntimeData, false),
266-
});
264+
const attestationResult = await client.attestOpenEnclave(quote, {
265+
runTimeData: new AttestationData(binaryRuntimeData, false)
266+
});
267267
```
268268

269269
If the `isJson` parameter to the `AttestationData` constructor is not provided,
@@ -323,25 +323,26 @@ If you encounter any bugs or have suggestions, please file an issue in the
323323
section of the project.
324324

325325
<!-- LINKS -->
326+
326327
[source_code]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/attestation/attestation
327328
[azure_identity]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/2.0.0-beta.3/index.html
328-
[DefaultAzureCredential]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/2.0.0-beta.3/classes/defaultazurecredential.html
329-
[attestation_policy_result]:https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-attestation/1.0.0-beta.2/interfaces/policyresult.html
329+
[defaultazurecredential]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/2.0.0-beta.3/classes/defaultazurecredential.html
330+
[attestation_policy_result]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-attestation/1.0.0-beta.2/interfaces/policyresult.html
330331
[attestation_client]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-attestation/1.0.0-beta.2/classes/attestationclient.html
331332
[attestation_admin_client]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-attestation/1.0.0-beta.2/classes/attestationclient.html
332333
[attestation_response]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-attestation/1.0.0-beta.2/interfaces/attestationresponse.html
333334
[attestation_policy_result_parameters]: https://www.microsoft.com/
334335
[attest_sgx]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-attestation/1.0.0-beta.2/classes/attestation.html#attestsgxenclave
335336
[attestation_npm]: https://www.npmjs.com/package/@azure/attestation
336-
[API_reference]:https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-attestation/1.0.0-beta.2/index.html
337+
[api_reference]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-attestation/1.0.0-beta.2/index.html
337338
[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization
338339
[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide
339340
[microsoft_code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
340341
[azure_cli]: https://docs.microsoft.com/cli/azure
341342
[azure_sub]: https://azure.microsoft.com/free/
342343
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
343344
[json_web_token]: https://tools.ietf.org/html/rfc7519
344-
[JWK]: https://tools.ietf.org/html/rfc7517
345+
[jwk]: https://tools.ietf.org/html/rfc7517
345346
[base64url_encoding]: https://tools.ietf.org/html/rfc4648#section-5
346347
[contributing]: https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md
347348
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/

sdk/containerregistry/container-registry/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ Use the client library for Azure Container Registry to:
2020

2121
### Currently supported environments
2222

23-
- Node.js version 8.x or higher
23+
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
24+
- Latest versions of Safari, Chrome, Edge, and Firefox.
25+
26+
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
2427

2528
### Prerequisites
2629

27-
You need an [Azure subscription][azure_sub] and a [Container Registry account][container_registry_docs] to use this package.
30+
- An [Azure Subscription](https://azure.microsoft.com)
31+
- A [Container Registry account][container_registry_docs]
2832

2933
To create a new Container Registry, you can use the [Azure Portal][container_registry_create_portal],
3034
[Azure PowerShell][container_registry_create_ps], or the [Azure CLI][container_registry_create_cli].

0 commit comments

Comments
 (0)