support npm owner #271

Closed
wenbing opened this Issue Mar 14, 2014 · 4 comments

Projects

None yet

2 participants

@wenbing
Contributor
wenbing commented Mar 14, 2014
npm owner ls <package name>
npm owner add <user> <package name>
npm owner rm <user> <package name>

https://www.npmjs.org/doc/cli/npm-owner.html

author add flow:

  1. npm http GET http://127.0.0.1:7001/-/user/org.couchdb.user:fengmk2
    npm http 200 http://127.0.0.1:7001/-/user/org.couchdb.user:fengmk2

check user eixsts or not first

  1. npm http GET http://127.0.0.1:7001/cnpmjs.org
    npm http 304 http://127.0.0.1:7001/cnpmjs.org

check current user if maintainers or not

  1. PUT /cnpmjs.org/-rev/15344
PUT /cnpmjs.org/-rev/15344 { accept: 'application/json',
  'accept-encoding': 'gzip',
  'user-agent': 'node/v0.11.12 darwin x64',
  host: '127.0.0.1:7001',
  authorization: 'Basic xxxx=',
  'content-type': 'application/json',
  'content-length': '141',
  connection: 'close' } { _id: 'cnpmjs.org',
  _rev: '15344',
  maintainers: 
   [ { name: 'fengmk2', email: 'fengmk2@gmail.com' },
     { name: 'mk5', email: 'fengmk2@gmail.com' } ] }
@fengmk2
Member
fengmk2 commented Mar 15, 2014

working on this

@fengmk2 fengmk2 added the enhancement label Mar 15, 2014
@fengmk2 fengmk2 self-assigned this Mar 15, 2014
@fengmk2 fengmk2 added this to the v0.3 koa milestone Mar 15, 2014
@fengmk2
Member
fengmk2 commented Mar 15, 2014

npm adduser logic flow change npm/npm-registry-client@effb4bc

no more salt and password_sha, just username and password plaintext

@fengmk2
Member
fengmk2 commented Mar 15, 2014
$ npm author add dead_horse cnpmjs.org
npm http GET https://registry.npmjs.org/-/user/org.couchdb.user:dead_horse
GET https://registry.npmjs.org/-/user/org.couchdb.user:dead_horse { url: 
   { protocol: 'https:',
     slashes: true,
     auth: null,
     host: 'registry.npmjs.org',
     port: null,
     hostname: 'registry.npmjs.org',
     hash: null,
     search: null,
     query: null,
     pathname: '/-/user/org.couchdb.user:dead_horse',
     path: '/-/user/org.couchdb.user:dead_horse',
     href: 'https://registry.npmjs.org/-/user/org.couchdb.user:dead_horse' },
  method: 'GET',
  ca: null,
  localAddress: undefined,
  cert: null,
  key: null,
  strictSSL: true,
  headers: 
   { 'if-none-match': '"37-6274adbd391d466a85f5c33978256798"',
     accept: 'application/json',
     'user-agent': 'node/v0.11.12 darwin x64' },
  proxy: null }
npm http 200 https://registry.npmjs.org/-/user/org.couchdb.user:dead_horse
npm http GET https://registry.npmjs.org/cnpmjs.org
GET https://registry.npmjs.org/cnpmjs.org { url: 
   { protocol: 'https:',
     slashes: true,
     auth: null,
     host: 'registry.npmjs.org',
     port: null,
     hostname: 'registry.npmjs.org',
     hash: null,
     search: null,
     query: null,
     pathname: '/cnpmjs.org',
     path: '/cnpmjs.org',
     href: 'https://registry.npmjs.org/cnpmjs.org' },
  method: 'GET',
  ca: null,
  localAddress: undefined,
  cert: null,
  key: null,
  strictSSL: true,
  headers: 
   { accept: 'application/json',
     'user-agent': 'node/v0.11.12 darwin x64' },
  proxy: null }
npm http 200 https://registry.npmjs.org/cnpmjs.org
npm http PUT https://registry.npmjs.org/cnpmjs.org/-rev/71-1af3eb79d01858c5640b036d696ad800
PUT https://registry.npmjs.org/cnpmjs.org/-rev/71-1af3eb79d01858c5640b036d696ad800 { url: 
   { protocol: 'https:',
     slashes: true,
     auth: '....',
     host: 'registry.npmjs.org',
     port: null,
     hostname: 'registry.npmjs.org',
     hash: null,
     search: null,
     query: null,
     pathname: '/cnpmjs.org/-rev/71-1af3eb79d01858c5640b036d696ad800',
     path: '/cnpmjs.org/-rev/71-1af3eb79d01858c5640b036d696ad800',
     href: 'https://registry.npmjs.org/cnpmjs.org/-rev/71-1af3eb79d01858c5640b036d696ad800' },
  method: 'PUT',
  ca: null,
  localAddress: undefined,
  cert: null,
  key: null,
  strictSSL: true,
  headers: 
   { accept: 'application/json',
     'user-agent': 'node/v0.11.12 darwin x64' },
  proxy: null,
  json: 
   { _id: 'cnpmjs.org',
     _rev: '71-1af3eb79d01858c5640b036d696ad800',
     maintainers: [ [Object], [Object] ] } }
npm http 201 https://registry.npmjs.org/cnpmjs.org/-rev/71-1af3eb79d01858c5640b036d696ad800
@fengmk2
Member
fengmk2 commented Mar 15, 2014
$ npm author rm dead_horse cnpmjs.org
npm http GET https://registry.npmjs.org/cnpmjs.org
GET https://registry.npmjs.org/cnpmjs.org {"url":{"protocol":"https:","slashes":true,"auth":null,"host":"registry.npmjs.org","port":null,"hostname":"registry.npmjs.org","hash":null,"search":null,"query":null,"pathname":"/cnpmjs.org","path":"/cnpmjs.org","href":"https://registry.npmjs.org/cnpmjs.org"},"method":"GET","ca":null,"cert":null,"key":null,"strictSSL":true,"headers":{"if-none-match":"\"CPYBFWMAFZQ3ZNJ5K33SHOFDU\"","accept":"application/json","user-agent":"node/v0.11.12 darwin x64"},"proxy":null}
npm http 304 https://registry.npmjs.org/cnpmjs.org
npm http PUT https://registry.npmjs.org/cnpmjs.org/-rev/72-945157b6eb485f84531f62dbc4ef660b
PUT https://registry.npmjs.org/cnpmjs.org/-rev/72-945157b6eb485f84531f62dbc4ef660b {"url":{"protocol":"https:","slashes":true,"auth":"xxxxx:xxxx","host":"registry.npmjs.org","port":null,"hostname":"registry.npmjs.org","hash":null,"search":null,"query":null,"pathname":"/cnpmjs.org/-rev/72-945157b6eb485f84531f62dbc4ef660b","path":"/cnpmjs.org/-rev/72-945157b6eb485f84531f62dbc4ef660b","href":"https://registry.npmjs.org/cnpmjs.org/-rev/72-945157b6eb485f84531f62dbc4ef660b"},"method":"PUT","ca":null,"cert":null,"key":null,"strictSSL":true,"headers":{"accept":"application/json","user-agent":"node/v0.11.12 darwin x64"},"proxy":null,"json":{"_id":"cnpmjs.org","_rev":"72-945157b6eb485f84531f62dbc4ef660b","maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}]}}
npm http 201 https://registry.npmjs.org/cnpmjs.org/-rev/72-945157b6eb485f84531f62dbc4ef660b
@fengmk2 fengmk2 added a commit that referenced this issue Mar 15, 2014
@fengmk2 fengmk2 Support npm owner|author add [name] [pkg]. fixed #271
* npm 1.4.4+ adduser new flow support
* npm author add, rm, ls support
295e503
@fengmk2 fengmk2 added a commit that closed this issue Mar 15, 2014
@fengmk2 fengmk2 Support npm owner|author add [name] [pkg]. fixed #271
* npm 1.4.4+ adduser new flow support
* npm author add, rm, ls support
f2be453
@fengmk2 fengmk2 closed this in f2be453 Mar 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment