@azure/core-auth 1.1.2-dev.20200421.1 → 1.1.2

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 CHANGED
@@ -1,8 +1,9 @@
1
1
  # Release History
2
2
 
3
- ## 1.1.2 (Unreleased)
4
- - Remove the below interfaces from the public API of this package as they are defined elsewhere.
5
- Fixes [bug 8301](https://github.com/Azure/azure-sdk-for-js/issues/8301).
3
+ ## 1.1.2 (2020-04-28)
4
+
5
+ - Remove the below interfaces from the public API of this package as they are defined elsewhere.
6
+ Fixes [bug 8301](https://github.com/Azure/azure-sdk-for-js/issues/8301).
6
7
  - OperationOptions
7
8
  - OperationRequestOptions
8
9
  - OperationTracingOptions
package/README.md CHANGED
@@ -4,18 +4,6 @@ This library provides core interfaces and helper methods for authenticating with
4
4
 
5
5
  ## Contributing
6
6
 
7
- This project welcomes contributions and suggestions. Most contributions require you to agree to a
8
- Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
9
- the rights to use your contribution. For details, visit https://cla.microsoft.com.
10
-
11
- When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
12
- a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
13
- provided by the bot. You will only need to do this once across all repos using our CLA.
14
-
15
- If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/tree/207c8e64c1d00d37401812382e566df343e3d042/CONTRIBUTING.md) to learn more about how to build and test the code.
16
-
17
- This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
18
- For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
19
- contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
7
+ If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.
20
8
 
21
9
  ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Fcore-auth%2FREADME.png)
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/azureKeyCredential.ts","../src/tokenCredential.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Represents a credential defined by a static API key.\n */\nexport interface KeyCredential {\n /**\n * The value of the API key represented as a string\n */\n readonly key: string;\n}\n\n/**\n * A static-key-based credential that supports updating\n * the underlying key value.\n */\nexport class AzureKeyCredential implements KeyCredential {\n private _key: string;\n\n /**\n * The value of the key to be used in authentication\n */\n public get key(): string {\n return this._key;\n }\n\n /**\n * Create an instance of an AzureKeyCredential for use\n * with a service client.\n *\n * @param key the initial value of the key to use in authentication\n */\n constructor(key: string) {\n if (!key) {\n throw new Error(\"key must be a non-empty string\");\n }\n\n this._key = key;\n }\n\n /**\n * Change the value of the key.\n *\n * Updates will take effect upon the next request after\n * updating the key value.\n *\n * @param newKey the new key value to be used\n */\n public update(newKey: string) {\n this._key = newKey;\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { SpanOptions } from \"@opentelemetry/types\";\n\n/**\n * Represents a credential capable of providing an authentication token.\n */\nexport interface TokenCredential {\n /**\n * Gets the token provided by this credential.\n *\n * @param scopes The list of scopes for which the token will have access.\n * @param options The options used to configure any requests this\n * TokenCredential implementation might make.\n */\n getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;\n}\n\n/**\n * Defines options for TokenCredential.getToken.\n */\nexport interface GetTokenOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: {\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n };\n /**\n * Options used when tracing is enabled.\n */\n tracingOptions?: {\n /**\n * OpenTelemetry SpanOptions used to create a span when tracing is enabled.\n */\n spanOptions?: SpanOptions;\n };\n}\n\n/**\n * Represents an access token with an expiration time.\n */\nexport interface AccessToken {\n /**\n * The access token returned by the authentication service.\n */\n token: string;\n\n /**\n * The access token's expiration timestamp in milliseconds, UNIX epoch time.\n */\n expiresOnTimestamp: number;\n}\n\n/**\n * Tests an object to determine whether it implements TokenCredential.\n *\n * @param credential The assumed TokenCredential to be tested.\n */\nexport function isTokenCredential(credential: any): credential is TokenCredential {\n // Check for an object with a 'getToken' function and possibly with\n // a 'signRequest' function. We do this check to make sure that\n // a ServiceClientCredentials implementor (like TokenClientCredentials\n // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if\n // it doesn't actually implement TokenCredential also.\n return (\n credential &&\n typeof credential.getToken === \"function\" &&\n (credential.signRequest === undefined || credential.getToken.length > 0)\n );\n}\n"],"names":[],"mappings":";;;;AAAA;AACA;AAYA;;;;MAIa,kBAAkB;;;;;;;IAgB7B,YAAY,GAAW;QACrB,IAAI,CAAC,GAAG,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;SACnD;QAED,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;KACjB;;;;IAhBD,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;KAClB;;;;;;;;;IAwBM,MAAM,CAAC,MAAc;QAC1B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;KACpB;;;ACnDH;AACA;AA8DA;;;;;AAKA,SAAgB,iBAAiB,CAAC,UAAe;;;;;;IAM/C,QACE,UAAU;QACV,OAAO,UAAU,CAAC,QAAQ,KAAK,UAAU;SACxC,UAAU,CAAC,WAAW,KAAK,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,EACxE;AACJ,CAAC;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/azureKeyCredential.ts","../src/tokenCredential.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Represents a credential defined by a static API key.\n */\nexport interface KeyCredential {\n /**\n * The value of the API key represented as a string\n */\n readonly key: string;\n}\n\n/**\n * A static-key-based credential that supports updating\n * the underlying key value.\n */\nexport class AzureKeyCredential implements KeyCredential {\n private _key: string;\n\n /**\n * The value of the key to be used in authentication\n */\n public get key(): string {\n return this._key;\n }\n\n /**\n * Create an instance of an AzureKeyCredential for use\n * with a service client.\n *\n * @param key the initial value of the key to use in authentication\n */\n constructor(key: string) {\n if (!key) {\n throw new Error(\"key must be a non-empty string\");\n }\n\n this._key = key;\n }\n\n /**\n * Change the value of the key.\n *\n * Updates will take effect upon the next request after\n * updating the key value.\n *\n * @param newKey the new key value to be used\n */\n public update(newKey: string) {\n this._key = newKey;\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { SpanOptions } from \"@azure/core-tracing\";\n\n/**\n * Represents a credential capable of providing an authentication token.\n */\nexport interface TokenCredential {\n /**\n * Gets the token provided by this credential.\n *\n * @param scopes The list of scopes for which the token will have access.\n * @param options The options used to configure any requests this\n * TokenCredential implementation might make.\n */\n getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;\n}\n\n/**\n * Defines options for TokenCredential.getToken.\n */\nexport interface GetTokenOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: {\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n };\n /**\n * Options used when tracing is enabled.\n */\n tracingOptions?: {\n /**\n * OpenTelemetry SpanOptions used to create a span when tracing is enabled.\n */\n spanOptions?: SpanOptions;\n };\n}\n\n/**\n * Represents an access token with an expiration time.\n */\nexport interface AccessToken {\n /**\n * The access token returned by the authentication service.\n */\n token: string;\n\n /**\n * The access token's expiration timestamp in milliseconds, UNIX epoch time.\n */\n expiresOnTimestamp: number;\n}\n\n/**\n * Tests an object to determine whether it implements TokenCredential.\n *\n * @param credential The assumed TokenCredential to be tested.\n */\nexport function isTokenCredential(credential: any): credential is TokenCredential {\n // Check for an object with a 'getToken' function and possibly with\n // a 'signRequest' function. We do this check to make sure that\n // a ServiceClientCredentials implementor (like TokenClientCredentials\n // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if\n // it doesn't actually implement TokenCredential also.\n return (\n credential &&\n typeof credential.getToken === \"function\" &&\n (credential.signRequest === undefined || credential.getToken.length > 0)\n );\n}\n"],"names":[],"mappings":";;;;AAAA;AACA;AAYA;;;;MAIa,kBAAkB;;;;;;;IAgB7B,YAAY,GAAW;QACrB,IAAI,CAAC,GAAG,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;SACnD;QAED,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;KACjB;;;;IAhBD,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;KAClB;;;;;;;;;IAwBM,MAAM,CAAC,MAAc;QAC1B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;KACpB;;;ACnDH;AACA;AA8DA;;;;;AAKA,SAAgB,iBAAiB,CAAC,UAAe;;;;;;IAM/C,QACE,UAAU;QACV,OAAO,UAAU,CAAC,QAAQ,KAAK,UAAU;SACxC,UAAU,CAAC,WAAW,KAAK,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,EACxE;AACJ,CAAC;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokenCredential.js","sourceRoot":"","sources":["../../src/tokenCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA8DlC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAe;IAC/C,mEAAmE;IACnE,gEAAgE;IAChE,sEAAsE;IACtE,qEAAqE;IACrE,sDAAsD;IACtD,OAAO,CACL,UAAU;QACV,OAAO,UAAU,CAAC,QAAQ,KAAK,UAAU;QACzC,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CACzE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { SpanOptions } from \"@opentelemetry/types\";\n\n/**\n * Represents a credential capable of providing an authentication token.\n */\nexport interface TokenCredential {\n /**\n * Gets the token provided by this credential.\n *\n * @param scopes The list of scopes for which the token will have access.\n * @param options The options used to configure any requests this\n * TokenCredential implementation might make.\n */\n getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;\n}\n\n/**\n * Defines options for TokenCredential.getToken.\n */\nexport interface GetTokenOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: {\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n };\n /**\n * Options used when tracing is enabled.\n */\n tracingOptions?: {\n /**\n * OpenTelemetry SpanOptions used to create a span when tracing is enabled.\n */\n spanOptions?: SpanOptions;\n };\n}\n\n/**\n * Represents an access token with an expiration time.\n */\nexport interface AccessToken {\n /**\n * The access token returned by the authentication service.\n */\n token: string;\n\n /**\n * The access token's expiration timestamp in milliseconds, UNIX epoch time.\n */\n expiresOnTimestamp: number;\n}\n\n/**\n * Tests an object to determine whether it implements TokenCredential.\n *\n * @param credential The assumed TokenCredential to be tested.\n */\nexport function isTokenCredential(credential: any): credential is TokenCredential {\n // Check for an object with a 'getToken' function and possibly with\n // a 'signRequest' function. We do this check to make sure that\n // a ServiceClientCredentials implementor (like TokenClientCredentials\n // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if\n // it doesn't actually implement TokenCredential also.\n return (\n credential &&\n typeof credential.getToken === \"function\" &&\n (credential.signRequest === undefined || credential.getToken.length > 0)\n );\n}\n"]}
1
+ {"version":3,"file":"tokenCredential.js","sourceRoot":"","sources":["../../src/tokenCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA8DlC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAe;IAC/C,mEAAmE;IACnE,gEAAgE;IAChE,sEAAsE;IACtE,qEAAqE;IACrE,sDAAsD;IACtD,OAAO,CACL,UAAU;QACV,OAAO,UAAU,CAAC,QAAQ,KAAK,UAAU;QACzC,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CACzE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { SpanOptions } from \"@azure/core-tracing\";\n\n/**\n * Represents a credential capable of providing an authentication token.\n */\nexport interface TokenCredential {\n /**\n * Gets the token provided by this credential.\n *\n * @param scopes The list of scopes for which the token will have access.\n * @param options The options used to configure any requests this\n * TokenCredential implementation might make.\n */\n getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;\n}\n\n/**\n * Defines options for TokenCredential.getToken.\n */\nexport interface GetTokenOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: {\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n };\n /**\n * Options used when tracing is enabled.\n */\n tracingOptions?: {\n /**\n * OpenTelemetry SpanOptions used to create a span when tracing is enabled.\n */\n spanOptions?: SpanOptions;\n };\n}\n\n/**\n * Represents an access token with an expiration time.\n */\nexport interface AccessToken {\n /**\n * The access token returned by the authentication service.\n */\n token: string;\n\n /**\n * The access token's expiration timestamp in milliseconds, UNIX epoch time.\n */\n expiresOnTimestamp: number;\n}\n\n/**\n * Tests an object to determine whether it implements TokenCredential.\n *\n * @param credential The assumed TokenCredential to be tested.\n */\nexport function isTokenCredential(credential: any): credential is TokenCredential {\n // Check for an object with a 'getToken' function and possibly with\n // a 'signRequest' function. We do this check to make sure that\n // a ServiceClientCredentials implementor (like TokenClientCredentials\n // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if\n // it doesn't actually implement TokenCredential also.\n return (\n credential &&\n typeof credential.getToken === \"function\" &&\n (credential.signRequest === undefined || credential.getToken.length > 0)\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/core-auth",
3
- "version": "1.1.2-dev.20200421.1",
3
+ "version": "1.1.2",
4
4
  "description": "Provides low-level interfaces and helper methods for authentication in Azure SDK",
5
5
  "sdk-type": "client",
6
6
  "main": "dist/index.js",
@@ -65,8 +65,8 @@
65
65
  "sideEffects": false,
66
66
  "dependencies": {
67
67
  "@azure/abort-controller": "^1.0.0",
68
- "@azure/core-tracing": "^1.0.0-dev",
69
- "@opentelemetry/types": "^0.2.0",
68
+ "@azure/core-tracing": "1.0.0-preview.8",
69
+ "@opentelemetry/api": "^0.6.1",
70
70
  "tslib": "^1.10.0"
71
71
  },
72
72
  "devDependencies": {
@@ -1,5 +1,5 @@
1
1
  import { AbortSignalLike } from '@azure/abort-controller';
2
- import { SpanOptions } from '@opentelemetry/types';
2
+ import { SpanOptions } from '@azure/core-tracing';
3
3
  /**
4
4
  * Represents an access token with an expiration time.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { AbortSignalLike } from '@azure/abort-controller';
2
- import { SpanOptions } from '@opentelemetry/types';
2
+ import { SpanOptions } from '@azure/core-tracing';
3
3
 
4
4
  /**
5
5
  * Represents an access token with an expiration time.