This obviously depends on the location on where you ride, whether or not your bike happens to be a fixed gear bike (most are not), whether or not the laws consider the ability to backpedal on a fixed gear bike a brake device.
This could also depend on the specifics of the bicycle. The lawmakers obviously don't want everyone riding on bicycles with only one brake. However, the lawmakers also probably don't want to make cheap coaster brake bicycles illegal. So it may very well be the case that two brakes are required but one brake is permissible in some special cases such as bikes with only one gear that use a coaster brake.
You said you discovered the need for a rear brake cable. Most likely you thus are aware that brake cables don't last forever. Front brake cables can fail too.
I wouldn't ride a bike with one brake only, especially if that brake uses cables that can fail suddenly as opposed to hydraulics, anywhere else than the nearest bicycle shop where I would purchase two cables -- one for the rear brake, the second as spare so you never again encounter the situation again where a cable needs to be replaced and you don't have a spare.
Cables are cheap. For every cheap wear item, you should have a spare somewhere.