1968 honda trx90 spring/valve?

I have a 1968 honda trx 90, I noticed the other day that there's a component that is like a valve or something, it is just outside of the battery compartment, I looks like a small black cylinder with a a coil spring hooked through a rod in the middle of it.

Brake light switch - the other end of the spring should be connected to the brake pedal.

It's the brake light switch.