aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/v1/pods.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-08-04 22:32:36 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-08-04 22:33:38 +0200
commit9bd2662976a75d3b03364cdbe6419e57c80f99a6 (patch)
tree0b5289660f843a8ba7f13aa79d458f53c94b36d9 /server/controllers/api/v1/pods.js
parente4c556196d7b31111f17596840d2e1d60caa7dcb (diff)
downloadPeerTube-9bd2662976a75d3b03364cdbe6419e57c80f99a6.tar.gz
PeerTube-9bd2662976a75d3b03364cdbe6419e57c80f99a6.tar.zst
PeerTube-9bd2662976a75d3b03364cdbe6419e57c80f99a6.zip
Implement user API (create, update, remove, list)
Diffstat (limited to 'server/controllers/api/v1/pods.js')
-rw-r--r--server/controllers/api/v1/pods.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/server/controllers/api/v1/pods.js b/server/controllers/api/v1/pods.js
index 2bc761fef..f61f2a483 100644
--- a/server/controllers/api/v1/pods.js
+++ b/server/controllers/api/v1/pods.js
@@ -8,6 +8,7 @@ const waterfall = require('async/waterfall')
8const logger = require('../../../helpers/logger') 8const logger = require('../../../helpers/logger')
9const friends = require('../../../lib/friends') 9const friends = require('../../../lib/friends')
10const middlewares = require('../../../middlewares') 10const middlewares = require('../../../middlewares')
11const admin = middlewares.admin
11const oAuth = middlewares.oauth 12const oAuth = middlewares.oauth
12const validators = middlewares.validators.pods 13const validators = middlewares.validators.pods
13const signatureValidator = middlewares.validators.remote.signature 14const signatureValidator = middlewares.validators.remote.signature
@@ -18,8 +19,17 @@ const Video = mongoose.model('Video')
18 19
19router.get('/', listPodsUrl) 20router.get('/', listPodsUrl)
20router.post('/', validators.podsAdd, addPods) 21router.post('/', validators.podsAdd, addPods)
21router.get('/makefriends', oAuth.authenticate, validators.makeFriends, makeFriends) 22router.get('/makefriends',
22router.get('/quitfriends', oAuth.authenticate, quitFriends) 23 oAuth.authenticate,
24 admin.ensureIsAdmin,
25 validators.makeFriends,
26 makeFriends
27)
28router.get('/quitfriends',
29 oAuth.authenticate,
30 admin.ensureIsAdmin,
31 quitFriends
32)
23// Post because this is a secured request 33// Post because this is a secured request
24router.post('/remove', signatureValidator, removePods) 34router.post('/remove', signatureValidator, removePods)
25 35