Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@googlemaps/google-maps-services-js

Package Overview
Dependencies
Maintainers
2
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@googlemaps/google-maps-services-js - npm Package Compare versions

Comparing version 3.2.6 to 3.3.0

1

dist/serialize.d.ts

@@ -33,2 +33,1 @@ /**

}, queryStringOptions: object, baseUrl: string): string;
export declare function createPremiumPlanSignature(unsignedUrl: string, clientSecret: string): string;

@@ -18,7 +18,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createPremiumPlanSignature = exports.createPremiumPlanQueryString = exports.toTimestamp = exports.serializer = exports.latLngArrayToStringMaybeEncoded = exports.toLatLngLiteral = exports.latLngBoundsToString = exports.objectToString = exports.latLngToString = void 0;
exports.createPremiumPlanQueryString = exports.toTimestamp = exports.serializer = exports.latLngArrayToStringMaybeEncoded = exports.toLatLngLiteral = exports.latLngBoundsToString = exports.objectToString = exports.latLngToString = void 0;
const util_1 = require("./util");
const CryptoJS = require("crypto-js");
const url_signature_1 = require("@googlemaps/url-signature");
const query_string_1 = require("query-string");
const url_1 = require("url");
const separator = "|";

@@ -139,3 +138,3 @@ function latLngToString(o) {

const unsignedUrl = `${baseUrl}?${partialQueryString}`;
const signature = createPremiumPlanSignature(unsignedUrl, clientSecret);
const signature = (0, url_signature_1.createSignature)(unsignedUrl, clientSecret);
// The signature must come last

@@ -145,16 +144,2 @@ return `${partialQueryString}&signature=${signature}`;

exports.createPremiumPlanQueryString = createPremiumPlanQueryString;
function createPremiumPlanSignature(unsignedUrl, clientSecret) {
// Strip off the protocol, scheme, and host portions of the URL, leaving only the path and the query
const fullUrl = new url_1.URL(unsignedUrl);
const pathAndQuery = `${fullUrl.pathname}${fullUrl.search}`;
// Convert from 'web safe' base64 to true base64
const unsafeClientSecret = clientSecret.replace(/-/g, "+").replace(/_/g, "/");
// Base64 decode the secret
const decodedSecret = CryptoJS.enc.Base64.parse(unsafeClientSecret);
// Sign the url with the decoded secret
const unsafeSignature = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA1, decodedSecret).update(pathAndQuery).finalize().toString(CryptoJS.enc.Base64);
// Convert from true base64 to 'web safe' base64
return unsafeSignature.replace(/\+/g, "-").replace(/\//g, "_");
}
exports.createPremiumPlanSignature = createPremiumPlanSignature;
//# sourceMappingURL=serialize.js.map

4

package.json
{
"name": "@googlemaps/google-maps-services-js",
"version": "3.2.6",
"version": "3.3.0",
"description": "Node.js client library for Google Maps API Web Services",

@@ -46,5 +46,5 @@ "keywords": [

"dependencies": {
"@googlemaps/url-signature": "^1.0.2",
"agentkeepalive": "^4.1.0",
"axios": "^0.21.1",
"crypto-js": "4.1.1",
"query-string": "^7.0.1",

@@ -51,0 +51,0 @@ "retry-axios": "^2.2.1"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc