Merge pull request #361 from kalyanaj/master

Added domainCredentials for authentication to EventGrid domains.
This commit is contained in:
Amar Zavery 2019-06-15 19:34:20 -07:00 коммит произвёл GitHub
Родитель 8480688b79 40a3b83a0b
Коммит 4c755ad5c8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 30 добавлений и 2 удалений

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

@ -1,5 +1,8 @@
# Changelog
## 1.8.13 - 2019-06-12
- Added DomainCredentials class for providing credentials to publish to an Azure EventGrid domain.
## 1.8.12 - 2019-06-07
- Added back the workaround of uppercasing method names otherwise axios causes issues with signing requests for storage data plane libraries.

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

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

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

@ -47,4 +47,5 @@ export { BasicAuthenticationCredentials } from "./credentials/basicAuthenticatio
export { ApiKeyCredentials, ApiKeyCredentialOptions } from "./credentials/apiKeyCredentials";
export { ServiceClientCredentials } from "./credentials/serviceClientCredentials";
export { TopicCredentials } from "./credentials/topicCredentials";
export { DomainCredentials } from "./credentials/domainCredentials";
export { Authenticator } from "./credentials/credentials";

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

@ -7,7 +7,7 @@ export const Constants = {
* @const
* @type {string}
*/
msRestVersion: "1.8.12",
msRestVersion: "1.8.13",
/**
* Specifies HTTP.

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

@ -5,7 +5,7 @@
"email": "azsdkteam@microsoft.com",
"url": "https://github.com/Azure/ms-rest-js"
},
"version": "1.8.12",
"version": "1.8.13",
"description": "Isomorphic client Runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest",
"tags": [
"isomorphic",