signalfx / signalfx-go

Go client library and instrumentation bindings for SignalFx
https://www.signalfx.com
Apache License 2.0
14 stars 51 forks source link

Added support for the Session Token API #63

Closed adampetrovic closed 4 years ago

adampetrovic commented 4 years ago

Allows users of the library to create / delete session tokens, as per https://developers.signalfx.com/sessiontokens_reference.html

adampetrovic commented 4 years ago

Sure thing!

However, I've found one problem which I've had to make a change for: the session API create method either accepts a valid auth token or no auth token at all in the headers, if you pass an empty string or an invalid token the request fails. I don't know why, as it wouldn't be used in the request but 🤷‍♂.

There is an assumption in the unit testing framework that every request has a token set (otherwise the test fails) see https://github.com/signalfx/signalfx-go/blob/master/client_test.go#L47.

Would you recommend I add an additional verifyRequestWithoutToken method to the client test too allow for this?

adampetrovic commented 4 years ago

I've pushed up a change to show what i'm thinking in my previous comment