@@ -86,9 +86,9 @@ func MountAPI(r *chi.Mux) {
8686 })
8787
8888 r .Route ("/pubkeys" , func (r chi.Router ) {
89- r .With (middleware .EnforcePermissions ("pubkey" , "write" )).Post ("/" , s .CreatePubkey )
89+ r .With (middleware .BlockWriteOperationsMiddleware ). With ( middleware . EnforcePermissions ("pubkey" , "write" )).Post ("/" , s .CreatePubkey )
9090 r .With (middleware .EnforcePermissions ("pubkey" , "read" )).With (middleware .Pagination ).Get ("/" , s .ListPubkeys )
91- r .Post ("/" , s .CreatePubkey )
91+ r .With ( middleware . BlockWriteOperationsMiddleware ). Post ("/" , s .CreatePubkey )
9292 r .Route ("/{ID}" , func (r chi.Router ) {
9393 r .With (middleware .EnforcePermissions ("pubkey" , "read" )).Get ("/" , s .GetPubkey )
9494 r .With (middleware .EnforcePermissions ("pubkey" , "write" )).Delete ("/" , s .DeletePubkey )
@@ -102,7 +102,7 @@ func MountAPI(r *chi.Mux) {
102102 r .Route ("/{TYPE}" , func (r chi.Router ) {
103103 // additional permission checks are in the service functions
104104 r .With (middleware .EnforcePermissions ("reservation" , "read" )).Get ("/{ID}" , s .GetReservationDetail )
105- r .With (middleware .EnforcePermissions ("reservation" , "write" )).Post ("/" , s .CreateReservation )
105+ r .With (middleware .BlockWriteOperationsMiddleware ). With ( middleware . EnforcePermissions ("reservation" , "write" )).Post ("/" , s .CreateReservation )
106106 })
107107 // Generic reservation detail request (no details provided)
108108 r .With (middleware .EnforcePermissions ("reservation" , "read" )).Get ("/{ID}" , s .GetReservationDetail )
@@ -111,7 +111,7 @@ func MountAPI(r *chi.Mux) {
111111 // Endpoint used by sources background checker (no permissions needed)
112112 r .Route ("/availability_status" , func (r chi.Router ) {
113113 r .Route ("/sources" , func (r chi.Router ) {
114- r .Post ("/" , s .AvailabilityStatus )
114+ r .With ( middleware . BlockWriteOperationsMiddleware ). Post ("/" , s .AvailabilityStatus )
115115 })
116116 })
117117
0 commit comments