No fear dating the dark underused secrets
Spaceports located near an impending war zone could start to resemble Casablanca.
Spaceports that are Pirate Haven might resemble the fictitious depictions of the pirate stronghold of Tortuga or Port Royal.
But parts of the port could be designated as customs areas and surrounded by a customs border.
If the station services starships instead of interplanetary ships, it is often called a "starport".
So the invaders will be very careful not to damage the spaceport, otherwise they might be stranded. If it is worried about invasion the spaceports will also be built up like a minor or major planetary fortresses.
Actually, if the spaceport has spacecraft laser launchers or cargo mass drivers, it already a planetary fortress.
The difference is that Tortuga was pro-pirate while Port Royal was officially anti-pirate but unofficially it would look the other way and ask no embarrassing questions in exchange for a cut of the ill-gotten gains.
Also keep in mind that if a planet is invaded, the spaceports are prime targets.
It’s kinda late at this point to get rid of it.” “There’s an embargo locker down in main cargo.