@azure/core-auth
Advanced tools
Comparing version 1.1.5-alpha.20210108.1 to 1.1.5-alpha.20210112.1
@@ -5,2 +5,3 @@ # Release History | ||
- Add `AzureSASCredential` and `SASCredential` for use by service clients which allow authenticiation using a shared access signature. | ||
@@ -7,0 +8,0 @@ ## 1.1.4 (2021-01-07) |
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
export { AzureKeyCredential } from "./azureKeyCredential"; | ||
export { AzureSASCredential } from "./azureSASCredential"; | ||
export { isTokenCredential } from "./tokenCredential"; | ||
//# sourceMappingURL=index.js.map |
@@ -51,2 +51,48 @@ 'use strict'; | ||
/** | ||
* A static-signature-based credential that supports updating | ||
* the underlying signature value. | ||
*/ | ||
var AzureSASCredential = /** @class */ (function () { | ||
/** | ||
* Create an instance of an AzureSASCredential for use | ||
* with a service client. | ||
* | ||
* @param signature - The initial value of the shared access signature to use in authentication | ||
*/ | ||
function AzureSASCredential(signature) { | ||
if (!signature) { | ||
throw new Error("shared access signature must be a non-empty string"); | ||
} | ||
this._signature = signature; | ||
} | ||
Object.defineProperty(AzureSASCredential.prototype, "signature", { | ||
/** | ||
* The value of the shared access signature to be used in authentication | ||
*/ | ||
get: function () { | ||
return this._signature; | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
/** | ||
* Change the value of the signature. | ||
* | ||
* Updates will take effect upon the next request after | ||
* updating the signature value. | ||
* | ||
* @param newSignature - The new shared access signature value to be used | ||
*/ | ||
AzureSASCredential.prototype.update = function (newSignature) { | ||
if (!newSignature) { | ||
throw new Error("shared access signature must be a non-empty string"); | ||
} | ||
this._signature = newSignature; | ||
}; | ||
return AzureSASCredential; | ||
}()); | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
/** | ||
* Tests an object to determine whether it implements TokenCredential. | ||
@@ -69,3 +115,4 @@ * | ||
exports.AzureKeyCredential = AzureKeyCredential; | ||
exports.AzureSASCredential = AzureSASCredential; | ||
exports.isTokenCredential = isTokenCredential; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@azure/core-auth", | ||
"version": "1.1.5-alpha.20210108.1", | ||
"version": "1.1.5-alpha.20210112.1", | ||
"description": "Provides low-level interfaces and helper methods for authentication in Azure SDK", | ||
@@ -5,0 +5,0 @@ "sdk-type": "client", |
@@ -40,2 +40,26 @@ import { AbortSignalLike } from '@azure/abort-controller'; | ||
/** | ||
* A static-signature-based credential that supports updating | ||
* the underlying signature value. | ||
*/ | ||
export declare class AzureSASCredential implements SASCredential { | ||
private _signature; | ||
readonly signature: string; | ||
/** | ||
* Create an instance of an AzureSASCredential for use | ||
* with a service client. | ||
* | ||
* @param signature - The initial value of the shared access signature to use in authentication | ||
*/ | ||
constructor(signature: string); | ||
/** | ||
* Change the value of the signature. | ||
* | ||
* Updates will take effect upon the next request after | ||
* updating the signature value. | ||
* | ||
* @param newSignature - The new shared access signature value to be used | ||
*/ | ||
update(newSignature: string): void; | ||
} | ||
/** | ||
* Defines options for TokenCredential.getToken. | ||
@@ -83,2 +107,11 @@ */ | ||
/** | ||
* Represents a credential defined by a static shared access signature. | ||
*/ | ||
export declare interface SASCredential { | ||
/** | ||
* The value of the shared access signature represented as a string | ||
*/ | ||
readonly signature: string; | ||
} | ||
/** | ||
* A light interface that tries to be structurally compatible with OpenTelemetry. | ||
@@ -85,0 +118,0 @@ */ |
@@ -46,2 +46,30 @@ import { AbortSignalLike } from '@azure/abort-controller'; | ||
/** | ||
* A static-signature-based credential that supports updating | ||
* the underlying signature value. | ||
*/ | ||
export declare class AzureSASCredential implements SASCredential { | ||
private _signature; | ||
/** | ||
* The value of the shared access signature to be used in authentication | ||
*/ | ||
get signature(): string; | ||
/** | ||
* Create an instance of an AzureSASCredential for use | ||
* with a service client. | ||
* | ||
* @param signature - The initial value of the shared access signature to use in authentication | ||
*/ | ||
constructor(signature: string); | ||
/** | ||
* Change the value of the signature. | ||
* | ||
* Updates will take effect upon the next request after | ||
* updating the signature value. | ||
* | ||
* @param newSignature - The new shared access signature value to be used | ||
*/ | ||
update(newSignature: string): void; | ||
} | ||
/** | ||
* Defines options for TokenCredential.getToken. | ||
@@ -92,2 +120,12 @@ */ | ||
/** | ||
* Represents a credential defined by a static shared access signature. | ||
*/ | ||
export declare interface SASCredential { | ||
/** | ||
* The value of the shared access signature represented as a string | ||
*/ | ||
readonly signature: string; | ||
} | ||
/** | ||
* A light interface that tries to be structurally compatible with OpenTelemetry. | ||
@@ -94,0 +132,0 @@ */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41260
18
560