changed
README.md
|
@@ -32,6 +32,7 @@ Requires: libsodium (can usually be easily installed using your favorite package
|
32
32
|
* [JSON](https://github.com/doawoo/macaroon#json)
|
33
33
|
* [Binary](https://github.com/doawoo/macaroon#binary)
|
34
34
|
* [Misc](https://github.com/doawoo/macaroon#misc)
|
35
|
+ * [Building on Apple Silicon](https://github.com/doawoo/macaroon#building-on-apple-silicon)
|
35
36
|
* [Building on Windows](https://github.com/doawoo/macaroon#building-on-windows)
|
36
37
|
---
|
37
38
|
|
|
@@ -148,6 +149,30 @@ macaroon = Macaroon.deserialize(url_base64_string, :binary)
|
148
149
|
|
149
150
|
## Misc
|
150
151
|
|
152
|
+ ### Building on Apple Silicon
|
153
|
+
|
154
|
+ While the `enacl` dependency is awaiting some PRs to fix the build flags on Apple Silicon machines, you can work around this easily:
|
155
|
+
|
156
|
+ *BEFORE* you run `mix deps.compile` do the following
|
157
|
+
|
158
|
+ 1. Install libsodium via Homebrew: `brew install libsodium`
|
159
|
+ 2. Export the environment variables so Clang can find the library:
|
160
|
+
|
161
|
+ ```
|
162
|
+ export CPATH=/opt/homebrew/include
|
163
|
+ export LIBRARY_PATH=/opt/homebrew/lib
|
164
|
+ ```
|
165
|
+
|
166
|
+ 3. Export some extra C, C++ and Linker flags to build a dual-arch library (instead of just an x86_64 one):
|
167
|
+
|
168
|
+ ```
|
169
|
+ export CFLAGS="-arch arm64"
|
170
|
+ export CXXFLAGS="-arch arm64"
|
171
|
+ export LDFLAGS="-arch arm64"
|
172
|
+ ```
|
173
|
+
|
174
|
+ 4. Done! Now run `mix deps.compile`
|
175
|
+
|
151
176
|
### Building on Windows
|
152
177
|
|
153
178
|
(I really recommend using the Windows Linux Subsystem. It makes installing libsodium and most other things much easier. But if you must run this natively on Windows, follow these tips!)
|
changed
hex_metadata.config
|
@@ -3,16 +3,16 @@
|
3
3
|
{<<"description">>,<<"Library that implements Macaroons in Elixir">>}.
|
4
4
|
{<<"elixir">>,<<"~> 1.11">>}.
|
5
5
|
{<<"files">>,
|
6
|
- [<<"lib">>,<<"lib/serializers">>,<<"lib/serializers/json.ex">>,
|
7
|
- <<"lib/serializers/binary.ex">>,<<"lib/types">>,<<"lib/types/caveat.ex">>,
|
8
|
- <<"lib/types/macaroon.ex">>,<<"lib/types/verification">>,
|
6
|
+ [<<"lib">>,<<"lib/types">>,<<"lib/types/macaroon.ex">>,
|
7
|
+ <<"lib/types/caveat.ex">>,<<"lib/types/verification">>,
|
8
|
+ <<"lib/types/verification/verify_parameters.ex">>,
|
9
9
|
<<"lib/types/verification/verify_context.ex">>,
|
10
|
- <<"lib/types/verification/verify_error.ex">>,
|
11
|
- <<"lib/types/verification/verify_parameters.ex">>,<<"lib/util">>,
|
12
|
- <<"lib/util/crypto.ex">>,<<"lib/util/struct_builder.ex">>,
|
13
|
- <<"lib/util/caveat_helpers.ex">>,<<"lib/macaroon.ex">>,
|
14
|
- <<"lib/verification.ex">>,<<".formatter.exs">>,<<"mix.exs">>,
|
15
|
- <<"README.md">>,<<"LICENSE">>]}.
|
10
|
+ <<"lib/types/verification/verify_error.ex">>,<<"lib/macaroon.ex">>,
|
11
|
+ <<"lib/util">>,<<"lib/util/caveat_helpers.ex">>,
|
12
|
+ <<"lib/util/struct_builder.ex">>,<<"lib/util/crypto.ex">>,
|
13
|
+ <<"lib/verification.ex">>,<<"lib/serializers">>,
|
14
|
+ <<"lib/serializers/binary.ex">>,<<"lib/serializers/json.ex">>,
|
15
|
+ <<".formatter.exs">>,<<"mix.exs">>,<<"README.md">>,<<"LICENSE">>]}.
|
16
16
|
{<<"licenses">>,[<<"MIT">>]}.
|
17
17
|
{<<"links">>,
|
18
18
|
[{<<"GitHub">>,<<"https://github.com/doawoo/macaroon">>},
|
|
@@ -34,5 +34,5 @@
|
34
34
|
{<<"name">>,<<"enacl">>},
|
35
35
|
{<<"optional">>,false},
|
36
36
|
{<<"repository">>,<<"hexpm">>},
|
37
|
- {<<"requirement">>,<<"~> 1.1">>}]]}.
|
38
|
- {<<"version">>,<<"0.5.0">>}.
|
37
|
+ {<<"requirement">>,<<"~> 1.2">>}]]}.
|
38
|
+ {<<"version">>,<<"0.5.1">>}.
|
changed
lib/serializers/binary.ex
|
@@ -123,7 +123,7 @@ defmodule Macaroon.Serializers.Binary do
|
123
123
|
{%Types.Macaroon{macaroon | public_identifier: id |> String.trim_trailing()}, rest}
|
124
124
|
|
125
125
|
"signature " <> sig ->
|
126
|
- {%Types.Macaroon{macaroon | signature: sig |> String.trim_trailing()}, rest}
|
126
|
+ {%Types.Macaroon{macaroon | signature: binary_part(sig, 0, 32)}, rest}
|
127
127
|
|
128
128
|
"cl " <> caveat_location ->
|
129
129
|
[vid, id | new_rest] = rest
|
changed
mix.exs
|
@@ -4,7 +4,7 @@ defmodule Macaroon.MixProject do
|
4
4
|
def project do
|
5
5
|
[
|
6
6
|
app: :macaroon,
|
7
|
- version: "0.5.0",
|
7
|
+ version: "0.5.1",
|
8
8
|
elixir: "~> 1.11",
|
9
9
|
start_permanent: Mix.env() == :prod,
|
10
10
|
deps: deps(),
|
|
@@ -28,7 +28,7 @@ defmodule Macaroon.MixProject do
|
28
28
|
{:ex_doc, "~> 0.24", only: :dev, runtime: false},
|
29
29
|
{:typed_struct, "~> 0.2"},
|
30
30
|
{:jason, "~> 1.2"},
|
31
|
- {:enacl, "~> 1.1"}
|
31
|
+ {:enacl, "~> 1.2"}
|
32
32
|
]
|
33
33
|
end
|