Through keeping Shabbos, and also through teshuvah, a person draws the light of Moshiach upon himself.
Sefer HaMidos, Repentance, Part II §10