Socket
Book a DemoInstallSign in
Socket

@servisbot/npm-sb-srn

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@servisbot/npm-sb-srn

SRN generation SDK for ServisBot

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
143
-32.55%
Maintainers
1
Weekly downloads
 
Created
Source

npm-sb-srn

SRN generation SDK

Overview

npm module to make SRNs "painless"

install

npm install --save @servisbot/npm-sb-srn

Usage

const SRN = require('@servisbot/npm-sb-srn');

const srn = new SRN(args);  // see Environment variables section
assert(srn.isValid());

const srn = SRN.fromString('srn:vault:global:myorg:secretdoc:my-secret-doc-name:78');
assert.equal(srn.getService(), 'vault');
assert.equal(srn.getRegion(), 'global');
assert.equal(srn.getOrganization(), 'myorg');
assert.equal(srn.getResourcetype(), 'secretdoc');
assert.equal(srn.getResource(), 'my-secret-doc-name');
assert.equal(srn.getQualifier(), '78');
assert.equal(srn.generateSRN(), 'srn:vault:global:myorg:secretdoc:my-secret-doc-name:78');

// To get a collapsed global region:
assert.equal(srn.generateSRN({ collapseGlobalRegion: true }), 'srn:vault::myorg:secretdoc:my-secret-doc-name:78');

Environment variables

The following environemnt variables will be used if present

SB_SERVICE;
SB_REGION;
SB_RESOURCE_TYPE;
SB_ORGANIZATION;
SB_RESOURCE;
SB_QUALIFIER;

The SRN class will read from the args passed into the constructure and take precidence over env vars if they exist

{
    service,
    region,
    resourcetype,
    organization,
    resource,
    qualifier
}

FAQs

Package last updated on 14 Mar 2025

Did you know?

Socket

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.

Install

Related posts