-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1058 from HDRUK/preprod
GAT-391: GAT API Release v5.0.0 IAM
- Loading branch information
Showing
62 changed files
with
7,619 additions
and
708 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 |
---|---|---|
@@ -1 +1 @@ | ||
v4.0.3 | ||
v5.0.0 |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:14 | ||
FROM node:16 | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
|
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 |
---|---|---|
|
@@ -153,3 +153,6 @@ terraform apply tf_apply && rm tf_apply | |
|
||
|
||
[Link to terraform file](deployment/GCP/api.tf) | ||
|
||
|
||
... |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export default class HttpExceptions extends Error { | ||
constructor(message) { | ||
constructor(message, statusCode = 500) { | ||
super(message); | ||
this.message = message; | ||
this.status = statusCode; | ||
} | ||
} |
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,17 @@ | ||
import HttpExceptions from '../exceptions/HttpExceptions'; | ||
import teamV3Util from '../resources/utilities/team.v3.util'; | ||
|
||
const checkAccessToTeamMiddleware = (arrayAllowedPermissions) => (req, res, next) => { | ||
const teamId = req.params.teamid || ''; | ||
const currentUserId = req.user._id || ''; | ||
|
||
if (!teamId || !currentUserId) { | ||
throw new HttpExceptions('One or more required parameters missing', 400); | ||
} | ||
|
||
req.allowPerms = arrayAllowedPermissions; | ||
|
||
next(); | ||
} | ||
|
||
export { checkAccessToTeamMiddleware }; |
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,26 @@ | ||
|
||
import { LoggingService } from "../services"; | ||
|
||
const errorHandler = (error, req, res, next) => { | ||
const errorStatusCode = error.status || 500; | ||
const loggingService = new LoggingService(); | ||
const loggingEnabled = parseInt(process.env.LOGGING_LOG_ENABLED) || 0; | ||
|
||
const errorMessage = { | ||
type: 'error', | ||
message: error.message, | ||
stack: error.stack.split("\n"), | ||
}; | ||
|
||
process.stdout.write(JSON.stringify(errorMessage)); | ||
|
||
if (loggingEnabled) { | ||
loggingService.sendDataInLogging(errorMessage, 'ERROR'); | ||
} | ||
|
||
res.status(errorStatusCode).json(errorMessage); | ||
|
||
return; | ||
} | ||
|
||
export { errorHandler } |
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
Empty file.
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
Oops, something went wrong.