Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 0733c87

Browse files
committed
Remove azure.
1 parent d44f8ef commit 0733c87

File tree

4 files changed

+0
-270
lines changed

4 files changed

+0
-270
lines changed

routes/middlewares/RepositoryFilter.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ module.exports = (provider) => async (req, res, next) => {
2222
} else if (provider === 'gitlab') {
2323
const repo = req.body.project || {};
2424
repoNames = [repo.homepage, repo.http_url, repo.url, repo.ssh_url, repo.web_url];
25-
} else if (provider === 'azure') {
26-
const projectId = req.body.resourceContainers.project.id;
27-
const projects = await dbHelper.scan(Project, {
28-
repoId: projectId,
29-
archived: 'false'
30-
});
31-
if (projects && projects.length > 0) {
32-
return next();
33-
}
3425
}
3526
const projects = await dbHelper.scan(Project, {
3627
archived: 'false'

routes/middlewares/SecurityChecker.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@ module.exports = (provider) => async (req, res, next) => {
3636
isValid = true;
3737
}
3838
});
39-
} else if (provider === 'azure') {
40-
const projectId = req.body.resourceContainers.project.id;
41-
const project = await dbHelper.scanOne(Project, {
42-
repoId: projectId
43-
});
44-
const buff = Buffer.from(req.headers.authorization.split(' ')[1], 'base64'); // Ta-da
45-
const authorization = buff.toString('utf-8');
46-
const pwd = authorization.split(':')[1];
47-
if (pwd === project.secretWebhookKey) {
48-
isValid = true;
49-
}
5039
} else {
5140
// unknown provider
5241
return next();

routes/webhooks.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const logger = require('../utils/logger');
1414
const kafka = require('../utils/kafka');
1515
const GithubEventDetector = require('../utils/GithubEventDetector');
1616
const GitlabEventDetector = require('../utils/GitlabEventDetector');
17-
const AzureEventDetector = require('../utils/AzureEventDetector');
1817

1918
const RepositoryFilter = require('./middlewares/RepositoryFilter');
2019
const SecurityChecker = require('./middlewares/SecurityChecker');
@@ -48,19 +47,4 @@ router.post('/gitlab', SecurityChecker('gitlab'), RepositoryFilter('gitlab'), wr
4847
res.json({success: true});
4948
}));
5049

51-
router.post('/azure', SecurityChecker('azure'), RepositoryFilter('azure'), wrapper(async (req, res) => {
52-
const result = AzureEventDetector.detectMany(req.body);
53-
if (!result || result.length === 0) {
54-
logger.info('unknown event detected');
55-
logger.debug(req.body);
56-
} else {
57-
for (const event of result) { // eslint-disable-line no-restricted-syntax
58-
await kafka.send(JSON.stringify(event));
59-
logger.info(`successfully add event: ${event.event} to kafka queue`);
60-
logger.debug(`kafka message: ${JSON.stringify(event)}`);
61-
}
62-
}
63-
res.json({success: true});
64-
}));
65-
6650
module.exports = router;

utils/AzureEventDetector.js

Lines changed: 0 additions & 234 deletions
This file was deleted.

0 commit comments

Comments
 (0)