Linux web-conference.aiou.edu.pk 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64
Apache/2.4.41 (Ubuntu)
: 172.16.50.247 | : 52.15.115.199
Cant Read [ /etc/named.conf ]
7.4.3-4ubuntu2.28
appadmin
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
share /
npm /
node_modules /
libnpmpublish /
test /
[ HOME SHELL ]
Name
Size
Permission
Action
util
[ DIR ]
drwxr-xr-x
publish.js
29.93
KB
-rw-r--r--
unpublish.js
5.27
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : unpublish.js
'use strict' const figgyPudding = require('figgy-pudding') const test = require('tap').test const tnock = require('./util/tnock.js') const OPTS = figgyPudding({ registry: {} })({ registry: 'https://mock.reg/' }) const REG = OPTS.registry const REV = '72-47f2986bfd8e8b55068b204588bbf484' const unpub = require('../unpublish.js') test('basic test', t => { const doc = { _id: 'foo', _rev: REV, name: 'foo', 'dist-tags': { latest: '1.0.0' }, versions: { '1.0.0': { name: 'foo', dist: { tarball: `${REG}/foo/-/foo-1.0.0.tgz` } } } } const srv = tnock(t, REG) srv.get('/foo?write=true').reply(200, doc) srv.delete(`/foo/-rev/${REV}`).reply(201) return unpub('foo', OPTS).then(ret => { t.ok(ret, 'foo was unpublished') }) }) test('scoped basic test', t => { const doc = { _id: '@foo/bar', _rev: REV, name: '@foo/bar', 'dist-tags': { latest: '1.0.0' }, versions: { '1.0.0': { name: '@foo/bar', dist: { tarball: `${REG}/@foo/bar/-/foo-1.0.0.tgz` } } } } const srv = tnock(t, REG) srv.get('/@foo%2fbar?write=true').reply(200, doc) srv.delete(`/@foo%2fbar/-rev/${REV}`).reply(201) return unpub('@foo/bar', OPTS).then(() => { t.ok(true, 'foo was unpublished') }) }) test('unpublish specific, last version', t => { const doc = { _id: 'foo', _rev: REV, name: 'foo', 'dist-tags': { latest: '1.0.0' }, versions: { '1.0.0': { name: 'foo', dist: { tarball: `${REG}/foo/-/foo-1.0.0.tgz` } } } } const srv = tnock(t, REG) srv.get('/foo?write=true').reply(200, doc) srv.delete(`/foo/-rev/${REV}`).reply(201) return unpub('foo@1.0.0', OPTS).then(() => { t.ok(true, 'foo was unpublished') }) }) test('unpublish specific version', t => { const doc = { _id: 'foo', _rev: REV, _revisions: [1, 2, 3], _attachments: [1, 2, 3], name: 'foo', 'dist-tags': { latest: '1.0.1' }, versions: { '1.0.0': { name: 'foo', dist: { tarball: `${REG}/foo/-/foo-1.0.0.tgz` } }, '1.0.1': { name: 'foo', dist: { tarball: `${REG}/foo/-/foo-1.0.1.tgz` } } } } const postEdit = { _id: 'foo', _rev: REV, name: 'foo', 'dist-tags': { latest: '1.0.0' }, versions: { '1.0.0': { name: 'foo', dist: { tarball: `${REG}/foo/-/foo-1.0.0.tgz` } } } } const srv = tnock(t, REG) srv.get('/foo?write=true').reply(200, doc) srv.put(`/foo/-rev/${REV}`, postEdit).reply(200) srv.get('/foo?write=true').reply(200, postEdit) srv.delete(`/foo/-/foo-1.0.1.tgz/-rev/${REV}`).reply(200) return unpub('foo@1.0.1', OPTS).then(() => { t.ok(true, 'foo was unpublished') }) }) test('404 considered a success', t => { const srv = tnock(t, REG) srv.get('/foo?write=true').reply(404) return unpub('foo', OPTS).then(() => { t.ok(true, 'foo was unpublished') }) }) test('non-404 errors', t => { const srv = tnock(t, REG) srv.get('/foo?write=true').reply(500) return unpub('foo', OPTS).then( () => { throw new Error('should not have succeeded') }, err => { t.equal(err.code, 'E500', 'got right error from server') } ) }) test('packument with missing versions unpublishes whole thing', t => { const doc = { _id: 'foo', _rev: REV, name: 'foo', 'dist-tags': { latest: '1.0.0' } } const srv = tnock(t, REG) srv.get('/foo?write=true').reply(200, doc) srv.delete(`/foo/-rev/${REV}`).reply(201) return unpub('foo@1.0.0', OPTS).then(() => { t.ok(true, 'foo was unpublished') }) }) test('packument with missing specific version assumed unpublished', t => { const doc = { _id: 'foo', _rev: REV, name: 'foo', 'dist-tags': { latest: '1.0.0' }, versions: { '1.0.0': { name: 'foo', dist: { tarball: `${REG}/foo/-/foo-1.0.0.tgz` } } } } const srv = tnock(t, REG) srv.get('/foo?write=true').reply(200, doc) return unpub('foo@1.0.1', OPTS).then(() => { t.ok(true, 'foo was unpublished') }) }) test('unpublish specific version without dist-tag update', t => { const doc = { _id: 'foo', _rev: REV, _revisions: [1, 2, 3], _attachments: [1, 2, 3], name: 'foo', 'dist-tags': { latest: '1.0.0' }, versions: { '1.0.0': { name: 'foo', dist: { tarball: `${REG}/foo/-/foo-1.0.0.tgz` } }, '1.0.1': { name: 'foo', dist: { tarball: `${REG}/foo/-/foo-1.0.1.tgz` } } } } const postEdit = { _id: 'foo', _rev: REV, name: 'foo', 'dist-tags': { latest: '1.0.0' }, versions: { '1.0.0': { name: 'foo', dist: { tarball: `${REG}/foo/-/foo-1.0.0.tgz` } } } } const srv = tnock(t, REG) srv.get('/foo?write=true').reply(200, doc) srv.put(`/foo/-rev/${REV}`, postEdit).reply(200) srv.get('/foo?write=true').reply(200, postEdit) srv.delete(`/foo/-/foo-1.0.1.tgz/-rev/${REV}`).reply(200) return unpub('foo@1.0.1', OPTS).then(() => { t.ok(true, 'foo was unpublished') }) })
Close