Ensure that a "create linked file" request includes a name (#16673)

GitOrigin-RevId: 6b4ffac59f299e297f0a9a14a72ad7cea2508c3c
This commit is contained in:
Alf Eaton 2024-02-08 09:32:25 +00:00 committed by Copybot
parent 14e14be8ef
commit 2566dff9d8

View file

@ -3,6 +3,7 @@ const AuthenticationController = require('../Authentication/AuthenticationContro
const { RateLimiter } = require('../../infrastructure/RateLimiter')
const RateLimiterMiddleware = require('../Security/RateLimiterMiddleware')
const LinkedFilesController = require('./LinkedFilesController')
const { validate, Joi } = require('../../infrastructure/Validation')
const rateLimiters = {
createLinkedFile: new RateLimiter('create-linked-file', {
@ -24,6 +25,12 @@ module.exports = {
RateLimiterMiddleware.rateLimit(rateLimiters.createLinkedFile, {
params: ['project_id'],
}),
validate({
body: {
name: Joi.string().required(),
// TODO: validate the remaining properties
},
}),
LinkedFilesController.createLinkedFile
)