Political affiliation is a protected class and you are protected from workplace discrimination based on your affiliation.
https://en.wikipedia.org/wiki/Protected_class
If you are a federal employee you are covered by a different law than everyone else, and that does include political affiliation.
If you google for nlra and lexology, you can see a number of articles about the scope.