Bugs when sending to everyone #11
Description
First I'm not sure if I should V1 or V2, the second version seems not ready to send emails, is that correct ?
In the v1 I can't send emails to /everyone
, I have this error:
{"errors":["UAA Failure: 401 {\"error\":\"invalid_token\",\"error_description\":\"Invalid access token value, must be at least 30 characters:\"}"]}
I first thought about how I handled client in my UAA, but everything seems correct so I started digging inside the code.
It appears that in uaa
package token is never given to the uaa client, see: https://github.com/cloudfoundry-incubator/notifications/blob/master/uaa/uaa.go#L94-L96
But token is passed in UsersEmailsByIDs
function: https://github.com/cloudfoundry-incubator/notifications/blob/master/uaa/uaa.go#L58
By looking in vendor https://github.com/cloudfoundry-incubator/notifications/blob/master/vendor/github.com/pivotal-cf/uaa-sso-golang/uaa/all_users.go it looks like it will never tried to have a token if it's not already set. So obviously trying to retrieve all users will always fail.
I've patched myself from my side by giving the token to client which make it works.
Do you want a PR for this ? Or is it kind of wanted ?