Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@azure/schema-registry
Advanced tools
Schema Registry Library with typescript type definitions for node.js and browser.
Azure Schema Registry is a schema repository service hosted by Azure Event Hubs, providing schema storage, versioning, and management. The registry is leveraged by serializers to reduce payload size while describing payload structure with schema identifiers rather than full schemas.
Key links:
@azure/schema-registry
packageInstall the Azure Schema Registry client library for JavaScript with npm
:
npm install @azure/schema-registry
SchemaRegistryClient
To create a client object to access the Schema Registry API, you will need the
fully qualified namespace of your Schema Registry resource and a credential
. The Schema
Registry client uses Azure Active Directory credentials to authenticate.
You can authenticate with Azure Active Directory using the Azure Identity
library. To use the
DefaultAzureCredential provider shown below, or other
credential providers provided with the Azure SDK, please install the
@azure/identity
package:
npm install @azure/identity
Set the values of the client ID, tenant ID, and client secret of the AAD
application as environment variables: AZURE_CLIENT_ID
, AZURE_TENANT_ID
,
AZURE_CLIENT_SECRET
.
const { DefaultAzureCredential } = require("@azure/identity");
const { SchemaRegistryClient } = require("@azure/schema-registry");
const client = new SchemaRegistryClient("<fullyQualifiedNamespace>", new DefaultAzureCredential());
SchemaRegistryClient
provides the API for storing and retrieving schemas in
schema registry.
const { DefaultAzureCredential } = require("@azure/identity");
const { SchemaRegistryClient } = require("@azure/schema-registry");
const client = new SchemaRegistryClient("<fullyQualifiedNamespace>", new DefaultAzureCredential());
const description = {
name: "<name>",
groupName: "<group name>",
format: "<schema format>",
definition: "<schema definition>"
}
const registered = await client.registerSchema(description);
console.log(registered.id);
const { DefaultAzureCredential } = require("@azure/identity");
const { SchemaRegistryClient } = require("@azure/schema-registry");
const client = new SchemaRegistryClient("<fullyQualifiedNamespace>", new DefaultAzureCredential());
const description = {
name: "<name>",
groupName: "<group name>",
format: "<schema format>",
definition: "<schema definition>"
}
const found = await client.getSchemaProperties(description);
if (found) {
console.log(`Got schema ID=${found.id}`);
}
const { DefaultAzureCredential } = require("@azure/identity");
const { SchemaRegistryClient } = require("@azure/schema-registry");
const client = new SchemaRegistryClient("<fullyQualifiedNamespace>", new DefaultAzureCredential());
const foundSchema = await client.getSchema("<id>");
if (foundSchema) {
console.log(`Got schema definition=${foundSchema.definition}`);
}
const { DefaultAzureCredential } = require("@azure/identity");
const { SchemaRegistryClient } = require("@azure/schema-registry");
const client = new SchemaRegistryClient("<fullyQualifiedNamespace>", new DefaultAzureCredential());
const foundSchema = await client.getSchema("<schema name>", "<group name>", version);
if (foundSchema) {
console.log(`Got schema definition=${foundSchema.definition}`);
}
Enabling logging may help uncover useful information about failures. In order to
see a log of HTTP requests and responses, set the AZURE_LOG_LEVEL
environment
variable to info
. Alternatively, logging can be enabled at runtime by calling
setLogLevel
in the @azure/logger
:
const { setLogLevel } = require("@azure/logger");
setLogLevel("info");
Please take a look at the samples directory for detailed examples on how to use this library.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
If you'd like to contribute to this library, please read the contributing guide to learn more about how to build and test the code.
FAQs
Schema Registry Library with typescript type definitions for node.js and browser.
The npm package @azure/schema-registry receives a total of 16,697 weekly downloads. As such, @azure/schema-registry popularity was classified as popular.
We found that @azure/schema-registry demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.