Skip to content

Commit

Permalink
Remove full mode from sync routes, controller and api spec
Browse files Browse the repository at this point in the history
  • Loading branch information
TimCsaky committed Aug 30, 2023
1 parent 0869881 commit 599fbd1
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 44 deletions.
5 changes: 2 additions & 3 deletions app/src/controllers/sync.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { NIL: SYSTEM_USER } = require('uuid');

const errorToProblem = require('../components/errorToProblem');
const { addDashesToUuid, getCurrentIdentity, isTruthy } = require('../components/utils');
const { addDashesToUuid, getCurrentIdentity } = require('../components/utils');
const { objectService, storageService, objectQueueService, userService } = require('../services');

const SERVICE = 'ObjectQueueService';
Expand Down Expand Up @@ -37,7 +37,7 @@ const controller = {
...s3Response.Versions.map(object => object.Key)
])].map(path => ({ path: path, bucketId: bucketId }));

const response = await objectQueueService.enqueue({ jobs: jobs, full: isTruthy(req.query.full), createdBy: userId });
const response = await objectQueueService.enqueue({ jobs: jobs, createdBy: userId });
res.status(202).json(response);
} catch (e) {
next(errorToProblem(SERVICE, e));
Expand All @@ -60,7 +60,6 @@ const controller = {

const response = await objectQueueService.enqueue({
jobs: [{ path: path, bucketId: bucketId }],
full: isTruthy(req.query.full),
createdBy: userId
});
res.status(202).json(response);
Expand Down
14 changes: 0 additions & 14 deletions app/src/docs/v1.api-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ paths:
operationId: syncBucket
parameters:
- $ref: "#/components/parameters/Path-BucketId"
- $ref: "#/components/parameters/Query-Full"
responses:
"202":
$ref: "#/components/responses/AddedQueueLength"
Expand Down Expand Up @@ -809,7 +808,6 @@ paths:
operationId: syncObject
parameters:
- $ref: "#/components/parameters/Path-ObjectId"
- $ref: "#/components/parameters/Query-Full"
responses:
"202":
description: Returns the number of objects that have been added to the queue.
Expand Down Expand Up @@ -1260,8 +1258,6 @@ paths:
operationId: syncDefault
tags:
- Sync
parameters:
- $ref: "#/components/parameters/Query-Full"
responses:
"202":
$ref: "#/components/responses/AddedQueueLength"
Expand Down Expand Up @@ -1625,16 +1621,6 @@ components:
type: string
format: uuid
example: 48a65990-2e48-46b2-94eb-7f4fe13468ea
Query-Full:
in: query
name: full
description: >-
Boolean on whether to force-synchronize all versions, metadata, and
tags, as opposed to only synchronizing those that have since been
updated externally.
schema:
type: boolean
example: true
Query-DeleteMarker:
in: query
name: deleteMarker
Expand Down
3 changes: 1 addition & 2 deletions app/src/routes/v1/sync.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
const router = require('express').Router();

const { syncController } = require('../../controllers');
const { syncValidator } = require('../../validators');
const { checkAppMode } = require('../../middleware/authorization');
const { requireBasicAuth, requireSomeAuth } = require('../../middleware/featureToggle');

router.use(checkAppMode);
router.use(requireSomeAuth);

/** Synchronizes the default bucket */
router.get('/', requireBasicAuth, syncValidator.syncDefault, (req, res, next) => {
router.get('/', requireBasicAuth, (req, res, next) => {
req.params.bucketId = null;
syncController.syncBucket(req, res, next);
});
Expand Down
3 changes: 0 additions & 3 deletions app/src/validators/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ const schema = {
syncBucket: {
params: Joi.object({
bucketId: type.uuidv4.required()
}),
query: Joi.object({
full: type.truthy
})
},

Expand Down
1 change: 0 additions & 1 deletion app/src/validators/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module.exports = {
metadataValidator: require('./metadata'),
objectValidator: require('./object'),
objectPermissionValidator: require('./objectPermission'),
syncValidator: require('./sync'),
tagValidator: require('./tag'),
userValidator: require('./user'),
versionValidator: require('./version'),
Expand Down
3 changes: 0 additions & 3 deletions app/src/validators/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ const schema = {
syncObject: {
params: Joi.object({
objectId: type.uuidv4.required()
}),
query: Joi.object({
full: type.truthy
})
},

Expand Down
18 changes: 0 additions & 18 deletions app/src/validators/sync.js

This file was deleted.

0 comments on commit 599fbd1

Please sign in to comment.