For most designs, the shaft would contact the process fluid at the impeller fit area and all the way back to the sleeve gasket for the mechanical seal. There are non-API designs that use an o-ring seal at the impeller nut and a sleeve that passes back under the mechanical seal, such that no part of the shaft contacts the process. But, generally for API pumps, the shaft does have to be compatible with process fluid contact. In the sketch provided, the part of the shaft in green is in direct contact with the process fluid.
Johnny Pellin