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

fixes for https://github.com/DockYard/openid_connect/issues/24 #30

Closed
wants to merge 3 commits into from

Conversation

nbryant42
Copy link

No description provided.

@nbryant42 nbryant42 marked this pull request as draft April 8, 2020 19:54
@nbryant42 nbryant42 marked this pull request as ready for review April 8, 2020 20:17
@nbryant42 nbryant42 mentioned this pull request Apr 8, 2020
Comment on lines 267 to 273
{:ok, doc} = GenServer.call(name, {:discovery_document, provider})
doc
end

defp jwk(provider, name) do
GenServer.call(name, {:jwk, provider})
{:ok, jwk} = GenServer.call(name, {:jwk, provider})
jwk

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this make this code more brittle? If the GenServer.call call returns an error, this code will now raise an error instead of return the {:error, reason} tuple as it did before.

Don't the callers of these functions need to be updated to handle possible errors instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kenny-evitt, you're right, at least partially. This particular part of the change can be done better. I will push an additional commit to make some improvements.

Copy link
Author

@nbryant42 nbryant42 May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kenny-evitt perhaps I should have been clear that I had addressed this comment on my branch.

This is now 3 years old and I'd like to get it merged. It'll need a rebase. My apologies for letting it sit so long, but I think this is important to merge as this library is basically unusable in our environment without this error-handling fix. At the office, I've been running this branch in prod for 3 years now.

Copy link

@kenny-evitt kenny-evitt May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nbryant42 Apparently this PR fixes/'closes' the issue. That PR was just merged two weeks ago.

I haven't tested it and it doesn't seem like they published a new version of the Hex package either yet.

Copy link
Author

@nbryant42 nbryant42 May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kenny-evitt their PR must fix the issue since it eliminates the Worker entirely. Recall the issue was that Worker failed to start, preventing app startup. Can't fail if it no longer exists!

I use the library pretty narrowly, with a single 3rdparty provider (small company you've never heard of) and we'll be regression testing the new master branch against that soon. If all goes well I'll just close out this PR.

Update to use {:error, name, reason} convention. Hoist
proper error checks into various calling functions.

Changes public API spec such that authorization_uri can now
return an error case, but this shouldn't be any worse than
the previous behavior of process EXITs resulting from failed
GenServer calls.
@nbryant42
Copy link
Author

Closing. Fixed on the master branch via another PR.

Looks like the fix will be released in 1.0.0.

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

Successfully merging this pull request may close these issues.

4 participants