
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
azure-arm-notificationhubs
Advanced tools
Microsoft Azure Notification Hubs Resource Provider Management Client Library for Node
This project provides a Node.js package that makes it easy to manage Microsoft Azure NotificationHubs Resources.Right now it supports:
npm install azure-arm-notificationhubs
var msRestAzure = require('ms-rest-azure');
var notificationHubsClient = require('azure-arm-notificationhubs');
// Interactive Login
// It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful,
// the user will get a DeviceTokenCredentials object.
msRestAzure.interactiveLogin(function(err, credentials) {
var client = new notificationHubsClient(credentials, 'your-subscription-id');
client.notificationHubs.list(resourceGroupName, namespaceName, function(err, result, request, response) {
if (err) console.log(err);
console.log(result);
});
});
var groupName = 'myResourceGroup';
var namespaceName = 'myNamespace';
var namespaceLocation = "South Central US"
//Create a Namespace
var createNamespaceParameters = {
location: namespaceLocation,
tags: {
tag1: 'value1',
tag2: 'value2'
}
};
console.info('Creating Namespace...');
client.namespaces.createOrUpdate(groupName, namespaceName, createNamespaceParameters, function (err, result, request, response) {
if (err) throw err;
console.info('Namespace created: ' + JSON.stringify(result, null, ' '));
});
//Get properties of an active Namespace
console.info('Get namespace...');
client.namespaces.get(groupName, namespaceName, function (err, result, request, response) {
if (err) throw err;
console.info('Namespace properties: ' + JSON.stringify(result, null, ' '));
});
//list all Namespaces within a resource group
console.info('Getting Namespaces within a resource group...');
client.namespaces.list(groupName, function (err, result, request, response) {
if (err) throw err;
console.info('Namespaces: ' + JSON.stringify(result, null, ' '));
});
//list all Namespaces within your subscription
console.info('Getting Namespaces within a subscription...');
client.namespaces.listAll(function (err, result, request, response) {
if (err) throw err;
console.info('Namespaces: ' + JSON.stringify(result, null, ' '));
});
//Create Namespace authorization rule
var authRuleParameter = {
location: namespaceLocation,
name: authorizationRuleName,
rights: ['Listen', 'Send']
};
client.namespaces.createOrUpdateAuthorizationRule(groupName, namespaceName, authorizationRuleName, authRuleParameter, function (err, result, request, response) {
if (err) throw err;
console.info('Namespace Authorization Rule: ' + JSON.stringify(result, null, ' '));
});
//show primary and secondary keys of the Namespace
console.info('Getting Namespace keys...');
client.namespaces.listKeys(groupName, namespaceName, authorizationRuleName, function (err, result, request, response) {
if (err) throw err;
console.info('Namespace Authorization Rule keys: ' + JSON.stringify(result, null, ' '));
});
//regenerate keys of the cache
regenerateKeyParameter = {
policyKey: 'primary KEY'
};
console.info('Regenerating Namespace keys...');
client.namespaces.regenerateKeys(groupName, namespaceName, authorizationRuleName, regenerateKeyParameter, function (err, result, request, response) {
if (err) throw err;
console.info('Namespace primary key regenerated');
console.info('Regenerated Namespace keys: ' + JSON.stringify(result, null, ' '));
});
var createNotificationHubParameters = {
location: namespaceLocation,
wnsCredential: {
packageSid: 'ms-app://s-1-15-2-1817505189-427745171-3213743798-2985869298-800724128-1004923984-4143860699',
secretKey: 'w7TBprR-THIS-IS-DUMMY-KEYAzSYFhp',
windowsLiveEndpoint: 'http://pushtestservice.cloudapp.net/LiveID/accesstoken.srf'
}
};
//Create a NotificationHub
console.info('Creating NotificationHub...');
client.notificationHubs.createOrUpdate(groupName, namespaceName, notificationHubName, createNotificationHubParameters, function (err, result, request, response) {
if (err) throw err;
console.info('NotificationHub created: ' + JSON.stringify(result, null, ' '));
});
//Get all NotificationHubs
console.info("Get all Notification Hubs");
client.notificationHubs.list(groupName, namespaceName, function (err, result, request, response) {
if (err) throw err;
console.info('Get all NotificationHub created: ' + JSON.stringify(result, null, ' '));
});
//Get NotificationHub PNS credentials
console.info("Get the PNS credentials");
client.notificationHubs.getPnsCredentials(groupName, namespaceName, notificationHubName, function (err, result, request, response) {
if (err) throw err;
console.info('NotificationHub PNS credentials: ' + JSON.stringify(result, null, ' '));
});
2016.09.07 Version 1.2.0-preview
FAQs
Microsoft Azure Notification Hubs Resource Provider Management Client Library for Node
The npm package azure-arm-notificationhubs receives a total of 8,502 weekly downloads. As such, azure-arm-notificationhubs popularity was classified as popular.
We found that azure-arm-notificationhubs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.