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

pshregistry-parser

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pshregistry-parser - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

76

lib/images.js

@@ -33,3 +33,3 @@ 'use strict';

this.recommended = this.supported[this.getRecommendedVersionIndex()];
this.recommended = this.getRecommendedVersion();
this.supportedHTML = this.lifecycleHTML("supported");

@@ -140,12 +140,19 @@ this.supportedString = this.lifecycleString("supported");

*/
getRecommendedVersionIndex() {
getRecommendedVersion() {
// Create the version array with float elements that can be sorted.
let sortableVersions = [];
for(let version of this.supported) {
// Use suported versions, unless there are none
// in which case, use deprecated versions
const versionArray = this.supported.length > 0 ? this.supported : this.deprecated
for(let version of versionArray) {
sortableVersions.push(parseFloat(version));
}
// Sort to find the most recent version.
let max_value = Math.max.apply(null, sortableVersions);
const recommendedIndex = sortableVersions.indexOf(max_value);
return sortableVersions.indexOf(max_value);
return versionArray[recommendedIndex]
}

@@ -696,2 +703,60 @@ }

/**
* The VaultKms class is a special case of a service.
*
* It modifies the template strings generated for Vault KMS:
*
* - The services.yaml file requires special configuration
*
*/
class VaultKms extends Service {
constructor(data) {
super(data);
this.config.services.snippet = `
${this.docs.service_name}:
type: ${this.type}:${this.recommended}
configuration:
endpoints:
manage_keys:
- policy: admin
key: vault-sign
type: sign
- policy: sign
key: vault-sign
type: sign
- policy: verify
key: vault-sign
type: sign
`.trim();
this.config.services.full = this.config.services.snippet;
this.config.services.commented = `
# The name given to the ${this.name} service (lowercase alphanumeric only).
${this.docs.service_name}:
# The type of your service (${this.type}), which uses the format
# 'type:version'. Be sure to consult the ${this.name} documentation
# (https://docs.platform.sh${this.docs.url}#supported-versions)
# when choosing a version. If you specify a version number which is not available,
# the CLI will return an error.
type: ${this.type}:${this.recommended}
# The 'configuration' block is required and defines the endpoints available for
# you to use in your app.
configuration:
endpoints:
manage_keys:
- policy: admin
key: vault-sign
type: sign
- policy: sign
key: vault-sign
type: sign
- policy: verify
key: vault-sign
type: sign
`.trim();
}
}
module.exports = {

@@ -701,3 +766,4 @@ Runtime,

NetworkStorage,
Varnish
Varnish,
VaultKms
};

2

package.json
{
"name": "pshregistry-parser",
"version": "1.2.0",
"version": "1.3.0",
"description": "Helper for library for accessing image data from the Platform.sh Registry and generating configuration files.",

@@ -5,0 +5,0 @@ "main": "lib/registry-parser.js",

@@ -33,3 +33,3 @@ 'use strict';

this.recommended = this.supported[this.getRecommendedVersionIndex()];
this.recommended = this.getRecommendedVersion();
this.supportedHTML = this.lifecycleHTML("supported");

@@ -140,12 +140,19 @@ this.supportedString = this.lifecycleString("supported");

*/
getRecommendedVersionIndex() {
getRecommendedVersion() {
// Create the version array with float elements that can be sorted.
let sortableVersions = [];
for(let version of this.supported) {
// Use suported versions, unless there are none
// in which case, use deprecated versions
const versionArray = this.supported.length > 0 ? this.supported : this.deprecated
for(let version of versionArray) {
sortableVersions.push(parseFloat(version));
}
// Sort to find the most recent version.
let max_value = Math.max.apply(null, sortableVersions);
const recommendedIndex = sortableVersions.indexOf(max_value);
return sortableVersions.indexOf(max_value);
return versionArray[recommendedIndex]
}

@@ -696,2 +703,60 @@ }

/**
* The VaultKms class is a special case of a service.
*
* It modifies the template strings generated for Vault KMS:
*
* - The services.yaml file requires special configuration
*
*/
class VaultKms extends Service {
constructor(data) {
super(data);
this.config.services.snippet = `
${this.docs.service_name}:
type: ${this.type}:${this.recommended}
configuration:
endpoints:
manage_keys:
- policy: admin
key: vault-sign
type: sign
- policy: sign
key: vault-sign
type: sign
- policy: verify
key: vault-sign
type: sign
`.trim();
this.config.services.full = this.config.services.snippet;
this.config.services.commented = `
# The name given to the ${this.name} service (lowercase alphanumeric only).
${this.docs.service_name}:
# The type of your service (${this.type}), which uses the format
# 'type:version'. Be sure to consult the ${this.name} documentation
# (https://docs.platform.sh${this.docs.url}#supported-versions)
# when choosing a version. If you specify a version number which is not available,
# the CLI will return an error.
type: ${this.type}:${this.recommended}
# The 'configuration' block is required and defines the endpoints available for
# you to use in your app.
configuration:
endpoints:
manage_keys:
- policy: admin
key: vault-sign
type: sign
- policy: sign
key: vault-sign
type: sign
- policy: verify
key: vault-sign
type: sign
`.trim();
}
}
module.exports = {

@@ -701,3 +766,4 @@ Runtime,

NetworkStorage,
Varnish
Varnish,
VaultKms
};
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