Fix HKP index, accept fingerprint for lookup

This commit is contained in:
Tankred Hase
2016-06-02 22:55:32 +02:00
parent 20145d3a11
commit 41cbd55d9e
3 changed files with 41 additions and 11 deletions

View File

@@ -22,6 +22,7 @@ describe('Koa App (HTTP Server) Integration Tests', function() {
const DB_TYPE_PUB_KEY = 'publickey';
const DB_TYPE_USER_ID = 'userid';
const primaryEmail = 'safewithme.testuser@gmail.com';
const fingerprint = '4277257930867231CE393FB8DBC0B3D92B1B86E9';
before(function *() {
publicKeyArmored = fs.readFileSync(__dirname + '/../key1.asc', 'utf8');
@@ -374,13 +375,20 @@ describe('Koa App (HTTP Server) Integration Tests', function() {
.end(done);
});
it('should return 200 for a valid request', done => {
it('should return 200 for key id', done => {
request(app.listen())
.get('/pks/lookup?op=get&search=0x' + emailParams.keyid)
.expect(200, publicKeyArmored)
.end(done);
});
it('should return 200 for fingerprint', done => {
request(app.listen())
.get('/pks/lookup?op=get&search=0x' + fingerprint)
.expect(200, publicKeyArmored)
.end(done);
});
it('should return 200 for correct email address', done => {
request(app.listen())
.get('/pks/lookup?op=get&search=' + primaryEmail)