Socket
Socket
Sign inDemoInstall

@azure/communication-common

Package Overview
Dependencies
Maintainers
3
Versions
192
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/communication-common - npm Package Compare versions

Comparing version 1.0.0-alpha.20210113.1 to 1.0.0-alpha.20210114.1

dist-esm/src/credential/communicationAuthPolicy.js

3

dist-esm/src/credential/clientArguments.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { isTokenCredential } from "@azure/core-auth";
import { URLBuilder } from "@azure/core-http";

@@ -33,3 +34,3 @@ import { parseConnectionString } from "./connectionString";

export const parseClientArguments = (connectionStringOrUrl, credentialOrOptions) => {
if (isKeyCredential(credentialOrOptions)) {
if (isKeyCredential(credentialOrOptions) || isTokenCredential(credentialOrOptions)) {
assertValidEndpoint(connectionStringOrUrl);

@@ -36,0 +37,0 @@ return { url: connectionStringOrUrl, credential: credentialOrOptions };

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export * from "./communicationAccessKeyCredentialPolicy";
export * from "./communicationAuthPolicy";
export * from "./clientArguments";
//# sourceMappingURL=index.js.map

@@ -257,2 +257,17 @@ 'use strict';

/**
* Creates a pipeline policy to authenticate request based
* on the credential passed in
*
* @param {KeyCredential | TokenCredential} credential The key credential
*/
const createCommunicationAuthPolicy = (credential) => {
if (coreAuth.isTokenCredential(credential)) {
return coreHttp.bearerTokenAuthenticationPolicy(credential, "https://communication.azure.com//.default");
}
else {
return createCommunicationAccessKeyCredentialPolicy(credential);
}
};
// Copyright (c) Microsoft Corporation.

@@ -307,3 +322,3 @@ // TODO: update when connection string format is finalized

const parseClientArguments = (connectionStringOrUrl, credentialOrOptions) => {
if (isKeyCredential(credentialOrOptions)) {
if (isKeyCredential(credentialOrOptions) || coreAuth.isTokenCredential(credentialOrOptions)) {
assertValidEndpoint(connectionStringOrUrl);

@@ -384,2 +399,3 @@ return { url: connectionStringOrUrl, credential: credentialOrOptions };

exports.createCommunicationAccessKeyCredentialPolicy = createCommunicationAccessKeyCredentialPolicy;
exports.createCommunicationAuthPolicy = createCommunicationAuthPolicy;
exports.getIdentifierKind = getIdentifierKind;

@@ -386,0 +402,0 @@ exports.isCallingApplicationIdentifier = isCallingApplicationIdentifier;

{
"name": "@azure/communication-common",
"version": "1.0.0-alpha.20210113.1",
"version": "1.0.0-alpha.20210114.1",
"description": "Common package for Azure Communication services.",

@@ -5,0 +5,0 @@ "sdk-type": "client",

@@ -5,2 +5,3 @@ import { AbortSignalLike } from '@azure/core-http';

import { RequestPolicyFactory } from '@azure/core-http';
import { TokenCredential } from '@azure/core-auth';

@@ -129,2 +130,10 @@ /**

/**
* Creates a pipeline policy to authenticate request based
* on the credential passed in
*
* @param {KeyCredential | TokenCredential} credential The key credential
*/
export declare const createCommunicationAuthPolicy: (credential: KeyCredential | TokenCredential) => RequestPolicyFactory;
/**
* Returns the CommunicationIdentifierKind for a given CommunicationIdentifier. Returns undefined if the kind couldn't be inferred.

@@ -255,5 +264,5 @@ *

url: string;
credential: KeyCredential;
credential: TokenCredential | KeyCredential;
};
export { }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc