We develop a comprehensive theoretical model of relativistic collisionless pair shocks mediated by the current filamentation instability. We notably characterize the noninertial frame in which this instability is of a mostly magnetic nature, and describe at a microscopic level the deceleration and heating of the incoming background plasma through its collisionless interaction with the electromagnetic turbulence. Our model compares well to large-scale 2D3V PIC simulations, and provides an important touchstone for the phenomenology of such plasma systems.