edgurgel / signaturex Goto Github PK
View Code? Open in Web Editor NEWSimple key/secret based authentication for APIs
Home Page: https://hex.pm/packages/signaturex
License: MIT License
Simple key/secret based authentication for APIs
Home Page: https://hex.pm/packages/signaturex
License: MIT License
crypto 5.0, shipping with Erlang 24, has removed the hmac/3
function. The replacement seems to be mac/4
with :hmac
as the first param.
** (UndefinedFunctionError) function :crypto.hmac/3 is undefined or private
(crypto 5.0.2) :crypto.hmac(:sha256, "secret", "POST\n/apps/app_id/events\nauth_key=app_key&auth_timestamp=1628030250&auth_version=1.0&body_md5=271e594983d1c002b6a158cc5f9c7d5a")
(signaturex 1.3.0) lib/signaturex/crypto_helper.ex:7: Signaturex.CryptoHelper.hmac256_to_string/2
(signaturex 1.3.0) lib/signaturex.ex:88: Signaturex.sign/5
Also seeing the failure running tests:
1) test hmac256_to_string (Signaturex.CryptoHelperTest)
test/crypto_helper_test.exs:5
** (UndefinedFunctionError) function :crypto.hmac/3 is undefined or private, use crypto:mac/4 instead
code: assert hmac256_to_string("7ad3773142a6692b25b8", "1234.1234:private-foobar") == "58df8b0c36d6982b82c3ecf6b4662e34fe8c25bba48f5369f135bf843651c3a4"
stacktrace:
(crypto 5.0.2) :crypto.hmac(:sha256, "7ad3773142a6692b25b8", "1234.1234:private-foobar")
(signaturex 1.3.0) lib/signaturex/crypto_helper.ex:7: Signaturex.CryptoHelper.hmac256_to_string/2
test/crypto_helper_test.exs:6: (test)
Checked out v0.0.8 (which is the required version for poxa v0.5.0) and ran mix compile
and got this error:
=INFO REPORT==== 22-Jun-2016::14:56:40 ===
application: logger
exited: {{shutdown,{failed_to_start_child,'Elixir.GenEvent',undef}},
{'Elixir.Logger.App',start,[normal,[]]}}
type: temporary
Compiled lib/signaturex/crypto_helper.ex
== Compilation error on file lib/signaturex.ex ==
** (CompileError) lib/signaturex.ex: internal error in lint_module;
crash reason: badarg
in function erl_anno:anno_info/1
called as erl_anno:anno_info(-1)
in call from erl_lint:loc/2 (erl_lint.erl, line 640)
in call from erl_lint:icrt_export/4 (erl_lint.erl, line 3094)
in call from erl_lint:icrt_clauses/4 (erl_lint.erl, line 3076)
in call from erl_lint:expr/3 (erl_lint.erl, line 2168)
in call from erl_lint:bin_element/4 (erl_lint.erl, line 1756)
in call from lists:foldl/3 (lists.erl, line 1263)
in call from erl_lint:expr_bin/4 (erl_lint.erl, line 1751)
(stdlib) lists.erl:1338: :lists.foreach/2
lib/signaturex.ex:4: (module)
I'm trying to look closer myself to see why it's failing. @edgurgel Do you have any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.