Skip to content

Commit

Permalink
prep bearer and basic auth tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Oct 11, 2019
1 parent 4b19b5a commit f9aef33
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/security.spec.ts
Expand Up @@ -108,4 +108,36 @@ describe.only(packageJson.name, () => {
.send({})
.expect(200);
});

// TODO add these tests
// it('should return 401 if auth header is missing for basic auth', async () => {
// eovConf.securityHandlers.BasicAuth = <any>function(req, scopes, schema) {
// return true;
// };
// return request(app)
// .get(`${basePath}/api_key`)
// .send({})
// .expect(401);
// });

// it('should return 401 if auth header is missing for bearer auth', async () => {
// eovConf.securityHandlers.BearerAuth = <any>function(req, scopes, schema) {
// return true;
// };
// return request(app)
// .get(`${basePath}/api_key`)
// .send({})
// .expect(401);
// });

// it('should return 401 if auth header is missing for malformed bearer auth', async () => {
// eovConf.securityHandlers.BearerAuth = <any>function(req, scopes, schema) {
// return true;
// };
// return request(app)
// .get(`${basePath}/api_key`)
// .set('Authorization', 'XXXX')
// .send({})
// .expect(401);
// });
});

0 comments on commit f9aef33

Please sign in to comment.