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

Adjust for OTP 24 deprecation of Crypto functions #24

Merged
merged 3 commits into from
Aug 27, 2021

Conversation

dbernheisel
Copy link
Contributor

@dbernheisel dbernheisel commented Aug 25, 2021

Sames solution as #22 but moved to compile time, and fixes an Elixir 1.12 warning as well about using :public_key without it being in the application list.

EDIT: dropped the public_key change since that has since been fixed

oauther ❯ asdf local erlang 24.0.5 && asdf local elixir 1.12.2-otp-24 && rm -rfv _build && mix test
removed '_build/test/lib/oauther/ebin/Elixir.OAuther.beam'
removed '_build/test/lib/oauther/ebin/Elixir.OAuther.Credentials.beam'
removed '_build/test/lib/oauther/ebin/oauther.app'
removed directory '_build/test/lib/oauther/ebin'
removed '_build/test/lib/oauther/.mix/compile.elixir_scm'
removed '_build/test/lib/oauther/.mix/compile.xref'
removed '_build/test/lib/oauther/.mix/compile.protocols'
removed '_build/test/lib/oauther/.mix/.mix_test_failures'
removed '_build/test/lib/oauther/.mix/compile.elixir'
removed directory '_build/test/lib/oauther/.mix'
removed '_build/test/lib/oauther/consolidated/Elixir.Enumerable.beam'
removed '_build/test/lib/oauther/consolidated/Elixir.String.Chars.beam'
removed '_build/test/lib/oauther/consolidated/Elixir.IEx.Info.beam'
removed '_build/test/lib/oauther/consolidated/Elixir.Collectable.beam'
removed '_build/test/lib/oauther/consolidated/Elixir.Inspect.beam'
removed '_build/test/lib/oauther/consolidated/Elixir.List.Chars.beam'
removed directory '_build/test/lib/oauther/consolidated'
removed directory '_build/test/lib/oauther'
removed directory '_build/test/lib'
removed directory '_build/test'
removed '_build/dev/lib/oauther/ebin/Elixir.OAuther.beam'
removed '_build/dev/lib/oauther/ebin/Elixir.OAuther.Credentials.beam'
removed '_build/dev/lib/oauther/ebin/oauther.app'
removed directory '_build/dev/lib/oauther/ebin'
removed '_build/dev/lib/oauther/.mix/compile.elixir_scm'
removed '_build/dev/lib/oauther/.mix/compile.app_tracer'
removed '_build/dev/lib/oauther/.mix/compile.protocols'
removed '_build/dev/lib/oauther/.mix/compile.elixir'
removed directory '_build/dev/lib/oauther/.mix'
removed '_build/dev/lib/oauther/consolidated/Elixir.Enumerable.beam'
removed '_build/dev/lib/oauther/consolidated/Elixir.String.Chars.beam'
removed '_build/dev/lib/oauther/consolidated/Elixir.IEx.Info.beam'
removed '_build/dev/lib/oauther/consolidated/Elixir.Collectable.beam'
removed '_build/dev/lib/oauther/consolidated/Elixir.Inspect.beam'
removed '_build/dev/lib/oauther/consolidated/Elixir.Phoenix.Param.beam'
removed '_build/dev/lib/oauther/consolidated/Elixir.List.Chars.beam'
removed directory '_build/dev/lib/oauther/consolidated'
removed directory '_build/dev/lib/oauther'
removed directory '_build/dev/lib'
removed directory '_build/dev'
removed directory '_build'
oauther ❯ mix test
Compiling 1 file (.ex)
Generated oauther app
.....

Finished in 0.07 seconds (0.00s async, 0.07s sync)
5 tests, 0 failures

Randomized with seed 313422
oauther ❯ asdf local erlang 21.3.8.17 && asdf local elixir 1.8.2-otp-21 && rm -rfv _build && mix test
removed '_build/test/lib/oauther/ebin/Elixir.OAuther.beam'
removed '_build/test/lib/oauther/ebin/Elixir.OAuther.Credentials.beam'
removed '_build/test/lib/oauther/ebin/oauther.app'
removed directory '_build/test/lib/oauther/ebin'
removed '_build/test/lib/oauther/.mix/compile.elixir_scm'
removed '_build/test/lib/oauther/.mix/compile.app_tracer'
removed '_build/test/lib/oauther/.mix/compile.protocols'
removed '_build/test/lib/oauther/.mix/.mix_test_failures'
removed '_build/test/lib/oauther/.mix/compile.elixir'
removed directory '_build/test/lib/oauther/.mix'
removed '_build/test/lib/oauther/consolidated/Elixir.Enumerable.beam'
removed '_build/test/lib/oauther/consolidated/Elixir.String.Chars.beam'
removed '_build/test/lib/oauther/consolidated/Elixir.IEx.Info.beam'
removed '_build/test/lib/oauther/consolidated/Elixir.Collectable.beam'
removed '_build/test/lib/oauther/consolidated/Elixir.Inspect.beam'
removed '_build/test/lib/oauther/consolidated/Elixir.Phoenix.Param.beam'
removed '_build/test/lib/oauther/consolidated/Elixir.List.Chars.beam'
removed directory '_build/test/lib/oauther/consolidated'
removed directory '_build/test/lib/oauther'
removed directory '_build/test/lib'
removed directory '_build/test'
removed directory '_build'
Compiling 1 file (.ex)
Generated oauther app
.....

Finished in 0.06 seconds
5 tests, 0 failures

Randomized with seed 631786

`:crypto.hmac/3` was removed in favor of `:crypto.mac/4` which was added to in OTP 22.1.

This patch keeps the compatibility with OTP < 22.1 by checking if `:crypto.mac/4` is available.
@dbernheisel
Copy link
Contributor Author

dbernheisel commented Aug 25, 2021

I'm unsure if :crypto should be added to the applications list. Elixir 1.12 doesn't complain, and tests pass, but it's definitely used. Any advice there would be appreciated.

EDIT: Nevermind! Seems to be fixed by this PR that's merged: #18

lib/oauther.ex Outdated Show resolved Hide resolved
Co-authored-by: Aleksei Magusev <248290+lexmag@users.noreply.github.com>
@lexmag lexmag merged commit b5ad3bd into lexmag:master Aug 27, 2021
@lobo-tuerto
Copy link

@dbernheisel Any plans on cutting a release with this change in? 🤔 🙏

@dbernheisel
Copy link
Contributor Author

@lobo-tuerto I'm not a maintainer so I don't push releases, but I'm sure that lexmag is aware.

@lexmag
Copy link
Owner

lexmag commented Sep 6, 2021

Thank you @dbernheisel.

I just released v1.2.0 that contains this change.

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