-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into NDT-142-Update-Disaster-Recovery-Runbook-Doc…
…umentation
- Loading branch information
Showing
111 changed files
with
5,619 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,7 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Self-hosted Renovate | ||
uses: renovatebot/[email protected].6 | ||
uses: renovatebot/[email protected].7 | ||
with: | ||
configurationFile: ./.github/renovate.json | ||
token: ${{ secrets.RENOVATE_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Router } from 'express'; | ||
import RateLimit from 'express-rate-limit'; | ||
import getAuthRole from '../../utils/getAuthRole'; | ||
import { performQuery } from './graphql'; | ||
|
||
const limiter = RateLimit({ | ||
windowMs: 1 * 60 * 1000, // 1 minute | ||
max: 2000, | ||
}); | ||
|
||
const validation = Router(); | ||
|
||
const getProjectNumberQuery = ` | ||
query GetProjectNumber($projectNumber: Int!) { | ||
cbcByProjectNumber(projectNumber: $projectNumber) { | ||
rowId | ||
projectNumber | ||
} | ||
} | ||
`; | ||
|
||
validation.post( | ||
'/api/validation/project-number-unique', | ||
limiter, | ||
async (req, res) => { | ||
const authRole = getAuthRole(req); | ||
const isRoleAuthorized = | ||
authRole?.pgRole === 'cbc_admin' || authRole?.pgRole === 'super_admin'; | ||
if (!isRoleAuthorized) { | ||
return res.status(404).end(); | ||
} | ||
const { projectNumber } = req.body; | ||
const getProjectNumber = await performQuery( | ||
getProjectNumberQuery, | ||
{ | ||
projectNumber: parseInt(projectNumber, 10), | ||
}, | ||
req | ||
); | ||
if (getProjectNumber.data.cbcByProjectNumber) { | ||
return res.send(false); | ||
} | ||
return res.send(true); | ||
} | ||
); | ||
|
||
export default validation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.