Add support for topic credentials (#17)

* Add Topic Credentials

* Update changelog

Bump the version to 0.5.1
This commit is contained in:
Kamil Pajdzik 2018-09-19 11:24:36 -07:00 коммит произвёл GitHub
Родитель 399d3d65ef
Коммит 3afd5f4e30
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 58 добавлений и 3 удалений

Просмотреть файл

@ -1,8 +1,34 @@
### 0.1.1 - 2018/08/27
# Changelog
## 0.5.1 - 2018/09/18
- Add TopicCredentials
## 0.5.0 - 2018/08/16
- Added support for MSI authentication
- Updated ms-rest-js package to 0.19 version
- Updated ms-rest-azure-env package to 0.1.1 version
## 0.4.0 - 2018/08/08
- Updated ms-rest-js package to 0.18 version
## 0.3.0 - 2018/08/06
- Updated ms-rest-js package to 0.17 version
## 0.2.0 - 2018/07/27
- Updated ms-rest-js package to 0.14 version
## 0.1.1 - 2018/08/27
- Domain is no longer a required parameter for MSITokenCredentials.
- Rename LoginWithMSIOptions interface to MSIOptions
### 0.1.0 - 2017/09/16
## 0.1.0 - 2017/09/16
- Initial version of ms-rest-nodeauth
- Provides following flavors of authentication in different Azure Clouds
- Authentication via service principal

Просмотреть файл

@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { ApiKeyCredentials } from "ms-rest-js";
/**
* Creates a new CognitiveServicesCredentials object.
*/
export class TopicCredentials extends ApiKeyCredentials {
/**
* Creates a new EventGrid TopicCredentials object.
*
* @constructor
* @param {string} topicKey The EventGrid topic key
*/
constructor(topicKey: string) {
if (!topicKey || (topicKey && typeof topicKey !== "string")) {
throw new Error(`topicKey cannot be null or undefined and must be of type string.`);
}
const options = {
inHeader: {
"aeg-sas-key": topicKey
}
};
super(options);
}
}

Просмотреть файл

@ -5,7 +5,7 @@
"email": "azsdkteam@microsoft.com",
"url": "https://github.com/Azure/ms-rest-nodeauth"
},
"version": "0.5.0",
"version": "0.5.1",
"description": "Azure Authentication library in node.js with type definitions.",
"tags": [
"node",