$49 GRAYBYTE WORDPRESS FILE MANAGER $12

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/lib/config/

HOME
Current File : /opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/lib/config//get-credentials-by-uri.js
var assert = require('assert')

var toNerfDart = require('./nerf-dart.js')

module.exports = getCredentialsByURI

function getCredentialsByURI (uri) {
  assert(uri && typeof uri === 'string', 'registry URL is required')
  var nerfed = toNerfDart(uri)
  var defnerf = toNerfDart(this.get('registry'))

  // hidden class micro-optimization
  var c = {
    scope: nerfed,
    token: undefined,
    password: undefined,
    username: undefined,
    email: undefined,
    auth: undefined,
    alwaysAuth: undefined
  }

  // used to override scope matching for tokens as well as legacy auth
  if (this.get(nerfed + ':always-auth') !== undefined) {
    var val = this.get(nerfed + ':always-auth')
    c.alwaysAuth = val === 'false' ? false : !!val
  } else if (this.get('always-auth') !== undefined) {
    c.alwaysAuth = this.get('always-auth')
  }

  if (this.get(nerfed + ':_authToken')) {
    c.token = this.get(nerfed + ':_authToken')
    // the bearer token is enough, don't confuse things
    return c
  }

  // Handle the old-style _auth=<base64> style for the default
  // registry, if set.
  var authDef = this.get('_auth')
  var userDef = this.get('username')
  var passDef = this.get('_password')
  if (authDef && !(userDef && passDef)) {
    authDef = new Buffer(authDef, 'base64').toString()
    authDef = authDef.split(':')
    userDef = authDef.shift()
    passDef = authDef.join(':')
  }

  if (this.get(nerfed + ':_password')) {
    c.password = new Buffer(this.get(nerfed + ':_password'), 'base64').toString('utf8')
  } else if (nerfed === defnerf && passDef) {
    c.password = passDef
  }

  if (this.get(nerfed + ':username')) {
    c.username = this.get(nerfed + ':username')
  } else if (nerfed === defnerf && userDef) {
    c.username = userDef
  }

  if (this.get(nerfed + ':email')) {
    c.email = this.get(nerfed + ':email')
  } else if (this.get('email')) {
    c.email = this.get('email')
  }

  if (c.username && c.password) {
    c.auth = new Buffer(c.username + ':' + c.password).toString('base64')
  }

  return c
}


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.42 PM
root / root
0755
bin-links.js
0.699 KB
28 Sep 2021 11.28 AM
root / root
0644
clear-credentials-by-uri.js
0.413 KB
28 Sep 2021 11.28 AM
root / root
0644
cmd-list.js
1.864 KB
28 Sep 2021 11.28 AM
root / root
0644
core.js
10.976 KB
28 Sep 2021 11.28 AM
root / root
0644
defaults.js
11.12 KB
28 Sep 2021 11.28 AM
root / root
0644
fetch-opts.js
1.928 KB
28 Sep 2021 11.28 AM
root / root
0644
gentle-fs.js
0.671 KB
28 Sep 2021 11.28 AM
root / root
0644
get-credentials-by-uri.js
1.996 KB
28 Sep 2021 11.28 AM
root / root
0644
lifecycle.js
0.831 KB
28 Sep 2021 11.28 AM
root / root
0644
load-cafile.js
0.666 KB
28 Sep 2021 11.28 AM
root / root
0644
load-prefix.js
1.298 KB
28 Sep 2021 11.28 AM
root / root
0644
load-uid.js
0.377 KB
28 Sep 2021 11.28 AM
root / root
0644
nerf-dart.js
0.46 KB
28 Sep 2021 11.28 AM
root / root
0644
pacote.js
3.994 KB
28 Sep 2021 11.28 AM
root / root
0644
reg-client.js
0.77 KB
28 Sep 2021 11.28 AM
root / root
0644
set-credentials-by-uri.js
1.236 KB
28 Sep 2021 11.28 AM
root / root
0644
set-user.js
0.731 KB
28 Sep 2021 11.28 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF