Born within a hidden fastness, -- forged in Gondolin
I've travelled far and wide, -- traveled from there to the Lonely Mountain, the Shire and Mount Doom, to name but few
Providing hope against the darkness, --well, helped in many a dark place (vaque, I know

)
Enemies on every side. --the Battle of Five Armies; Weathertop; that tower where Frodo was held captive etc.
Many a master have I served, --guys in Gondolin?, Bilbo, Frodo, Sam
The greater and the lesser too, --see above
Given a new name, well deserved, --Sting; need explanation?
Trust in me and we'll win through. --and so it happened
Threatening, when it was right, --i.e. when baddies attacked, I guess
Or cutting through the enemy, --it cut through the webs of Shelob (edit: and the webmaker herself, of course), and orcs (and Nazgul? can't remember right now, but it could've cut through them too, no doubt)
I'll not for the unrighteous fight,
For that's my point you see --it glowed (it's
point glowed?) if enemies were near, and probably couldn't be wielded by the enemies?
So, I'm pretty sure the answer is
Sting; though I might be just too sleepy to see right.