Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs when sending to everyone #11

Open
ArthurHlt opened this issue Oct 2, 2017 · 2 comments
Open

Bugs when sending to everyone #11

ArthurHlt opened this issue Oct 2, 2017 · 2 comments

Comments

@ArthurHlt
Copy link

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 ?

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

@iplay88keys
Copy link
Contributor

iplay88keys commented Dec 21, 2017

Hey @ArthurHlt!

We are currently supporting v1.
PRs are welcome! We'll try to merge it in as soon as possible! Please reference this issue in your PR. We highly recommend adding a test to reproduce this behavior.

Thank you!
Jeremy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants