Skip to content

Commit

Permalink
Merge pull request #312 from isomerpages/develop
Browse files Browse the repository at this point in the history
Merge to prod: 14 Oct 2021
  • Loading branch information
alexanderleegs authored Oct 14, 2021
2 parents db1de22 + 8763f40 commit 21abe3d
Show file tree
Hide file tree
Showing 32 changed files with 4,944 additions and 2,711 deletions.
105 changes: 74 additions & 31 deletions middleware/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,37 +157,6 @@ auth.post(
verifyJwt
)

// New collection pages
auth.post("/v2/sites/:siteName/collections/:collectionName/pages", verifyJwt)
auth.post(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName/pages",
verifyJwt
)
auth.get(
"/v2/sites/:siteName/collections/:collectionName/pages/:pageName",
verifyJwt
)
auth.get(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName/pages/:pageName",
verifyJwt
)
auth.post(
"/v2/sites/:siteName/collections/:collectionName/pages/:pageName",
verifyJwt
)
auth.post(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName/pages/:pageName",
verifyJwt
)
auth.delete(
"/v2/sites/:siteName/collections/:collectionName/pages/:pageName",
verifyJwt
)
auth.delete(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName/pages/:pageName",
verifyJwt
)

// Collections
auth.get("/v1/sites/:siteName/collections", verifyJwt)
auth.post("/v1/sites/:siteName/collections", verifyJwt)
Expand Down Expand Up @@ -314,6 +283,80 @@ auth.get("/v1/sites/:siteName", verifyJwt)
auth.get("/v1/sites/:siteName/lastUpdated", verifyJwt)
auth.get("/v1/sites/:siteName/stagingUrl", verifyJwt)

// V2 Endpoints

// Unlinked pages
auth.get("/v2/sites/:siteName/pages", verifyJwt)
auth.post("/v2/sites/:siteName/pages/pages", verifyJwt)
auth.get("/v2/sites/:siteName/pages/pages/:pageName", verifyJwt)
auth.post("/v2/sites/:siteName/pages/pages/:pageName", verifyJwt)
auth.delete("/v2/sites/:siteName/pages/pages/:pageName", verifyJwt)
auth.post("/v2/sites/:siteName/pages/move", verifyJwt)

// Collection pages
auth.post("/v2/sites/:siteName/collections/:collectionName/pages", verifyJwt)
auth.post(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName/pages",
verifyJwt
)
auth.get(
"/v2/sites/:siteName/collections/:collectionName/pages/:pageName",
verifyJwt
)
auth.get(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName/pages/:pageName",
verifyJwt
)
auth.post(
"/v2/sites/:siteName/collections/:collectionName/pages/:pageName",
verifyJwt
)
auth.post(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName/pages/:pageName",
verifyJwt
)
auth.delete(
"/v2/sites/:siteName/collections/:collectionName/pages/:pageName",
verifyJwt
)
auth.delete(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName/pages/:pageName",
verifyJwt
)

// Collections
auth.get("/v2/sites/:siteName/collections", verifyJwt)
auth.get("/v2/sites/:siteName/collections/:collectionName", verifyJwt)
auth.get(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName",
verifyJwt
)
auth.post("/v2/sites/:siteName/collections", verifyJwt)
auth.post(
"/v2/sites/:siteName/collections/:collectionName/subcollections",
verifyJwt
)
auth.post("/v2/sites/:siteName/collections/:collectionName", verifyJwt)
auth.post(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName",
verifyJwt
)
auth.delete("/v2/sites/:siteName/collections/:collectionName", verifyJwt)
auth.delete(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName",
verifyJwt
)
auth.post("/v2/sites/:siteName/collections/:collectionName/reorder", verifyJwt)
auth.post(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName/reorder",
verifyJwt
)
auth.post("/v2/sites/:siteName/collections/:collectionName/move", verifyJwt)
auth.post(
"/v2/sites/:siteName/collections/:collectionName/subcollections/:subcollectionName/move",
verifyJwt
)

auth.use((req, res, next) => {
if (!req.route) {
return res.status(404).send("Unauthorised for unknown route")
Expand Down
Loading

0 comments on commit 21abe3d

Please sign in to comment.