-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
client.GetClients() returns invalid information #150
Comments
Nice catch, this could also be an issue in all implementations of the following interfaces:
|
I think ladon is safe from this issue (both memory manager and rethinkdb manager) as they aren't taking an address of a variable in a loop. Would still be good to check that with tests though. I'll look into it. |
Switching to |
fix for ory#150 Signed-off-by: Matt Vinall <[email protected]>
I've tested this change with my use-case, but not yet added anything to the regressions tests, sorry. |
fix for #150 Signed-off-by: Matt Vinall <[email protected]>
solved by #151 |
Looks like
client.GetClients()
is returning a map with all map values set to the same value. The actual value can vary each time you call it.e.g.
where "Dev Proxy" is one of my clients.
Looks like the problem is https://github.com/ory-am/hydra/blob/9b51600/client/manager_rethinkdb.go#L84, although the implementation is the same in the memory storage too.
I think the best thing is actually to change the signature of GetClients, from:
func (m *MemoryManager) GetClients() (clients map[string]*Client, err error)
to
func (m *MemoryManager) GetClients() (clients map[string]Client, err error)
i.e. not returning a pointer. This saves on garbage collection slightly.
Happy to submit a PR if you agree this signature change @arekkas.
The text was updated successfully, but these errors were encountered: