0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-04-01 02:42:23 -05:00

Merge pull request #618 from ayusharma/htpasswd-integration

verdaccio-htpasswd v0.1.4
This commit is contained in:
Juan Picado @jotadeveloper 2018-03-04 18:01:36 +01:00 committed by GitHub
commit 75426980cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 19 deletions

View file

@ -46,7 +46,7 @@
"request": "2.83.0",
"semver": "^5.5.0",
"unix-crypt-td-js": "^1.0.0",
"verdaccio-htpasswd": "0.1.2"
"verdaccio-htpasswd": "0.1.4"
},
"devDependencies": {
"@commitlint/cli": "6.1.3",

View file

@ -110,14 +110,14 @@ describe('endpoint unit test', () => {
.put('/-/user/org.couchdb.user:jota')
.send(credentialsShort)
.expect('Content-Type', /json/)
.expect(409)
.expect(400)
.end(function(err, res) {
if (err) {
return done(err);
}
expect(res.body.error).toBeDefined();
expect(res.body.error).toMatch(/username should not contain non-uri-safe characters/);
expect(res.body.error).toMatch(/username and password is required/);
done();
});
});
@ -131,7 +131,7 @@ describe('endpoint unit test', () => {
.put('/-/user/org.couchdb.user:jota')
.send(credentialsShort)
.expect('Content-Type', /json/)
.expect(403)
.expect(400)
.end(function(err, res) {
if (err) {
return done(err);
@ -139,26 +139,23 @@ describe('endpoint unit test', () => {
expect(res.body.error).toBeDefined();
//FIXME: message is not 100% accurate
expect(res.body.error).toMatch(/this user already exists/);
expect(res.body.error).toMatch(/username and password is required/);
done();
});
});
test('should test fails add a new user', (done) => {
test('should test add a new user with login', (done) => {
request(app)
.put('/-/user/org.couchdb.user:jota')
.send(credentials)
.expect('Content-Type', /json/)
.expect(403)
.expect(200)
.end(function(err, res) {
if (err) {
return done(err);
}
expect(res.body.error).toBeDefined();
//FIXME: message is not 100% accurate
expect(res.body.error).toMatch(/this user already exists/);
expect(res.body).toBeTruthy();
done();
});
});
@ -172,17 +169,14 @@ describe('endpoint unit test', () => {
.put('/-/user/org.couchdb.user:jota')
.send(credentialsShort)
.expect('Content-Type', /json/)
//TODO: this should return 401 and will fail when issue
// https://github.com/verdaccio/verdaccio-htpasswd/issues/5
// is being fixed
.expect(403)
.expect(401)
.end(function(err, res) {
if (err) {
return done(err);
}
expect(res.body.error).toBeDefined();
expect(res.body.error).toMatch(/this user already exists/);
expect(res.body.error).toMatch(/unauthorized/);
done();
});
});

View file

@ -8927,9 +8927,9 @@ verdaccio-auth-memory@0.0.4:
version "0.0.4"
resolved "https://registry.npmjs.org/verdaccio-auth-memory/-/verdaccio-auth-memory-0.0.4.tgz#b44a65209778a8dc3c8d39478141a0bc22e04375"
verdaccio-htpasswd@0.1.2:
version "0.1.2"
resolved "https://registry.npmjs.org/verdaccio-htpasswd/-/verdaccio-htpasswd-0.1.2.tgz#67aca5e9b0093be0fa2e018c524a7ba45f64f810"
verdaccio-htpasswd@0.1.4:
version "0.1.4"
resolved "https://registry.npmjs.org/verdaccio-htpasswd/-/verdaccio-htpasswd-0.1.4.tgz#a2f6e8487181a0f7b0cb7a792643e3b13adea031"
dependencies:
"@verdaccio/file-locking" "^0.0.5"
apache-md5 "^1.1.2"