Skip to content

Commit

Permalink
Merge pull request rabbitmq#11372 from rabbitmq/upstream-jose
Browse files Browse the repository at this point in the history
Upstream jose
  • Loading branch information
michaelklishin authored Jun 4, 2024
2 parents ae31b47 + fbf896c commit 45d0672
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 187 deletions.
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,11 @@ erlang_package.git_package(
repository = "rabbitmq/horus",
)

erlang_package.git_package(
erlang_package.hex_package(
name = "jose",
build_file = "@rabbitmq-server//bazel:BUILD.jose",
commit = "d63c1c5c8f9c1a4f1438e234b886de8607a0034e",
repository = "michaelklishin/erlang-jose",
sha256 = "0d6cd36ff8ba174db29148fc112b5842186b68a90ce9fc2b3ec3afe76593e614",
version = "1.11.10",
)

erlang_package.hex_package(
Expand Down
250 changes: 68 additions & 182 deletions bazel/BUILD.jose
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ erlc_opts(
values = select({
"@rules_erlang//:debug_build": [
"+debug_info",
"+warnings_as_errors",
],
"//conditions:default": [
"+debug_info",
"+deterministic",
"+warnings_as_errors",
],
}),
visibility = [":__subpackages__"],
Expand Down Expand Up @@ -39,12 +37,12 @@ erlang_bytecode(
name = "behaviours",
srcs = [
"src/jose_block_encryptor.erl",
"src/jose_chacha20_poly1305.erl",
"src/jose_curve25519.erl",
"src/jose_curve448.erl",
"src/jose_sha3.erl",
"src/jose_xchacha20_poly1305.erl",
"src/json/jose_json.erl",
"src/jwa/chacha20_poly1305/jose_chacha20_poly1305.erl",
"src/jwa/curve25519/jose_curve25519.erl",
"src/jwa/curve448/jose_curve448.erl",
"src/jwa/sha3/jose_sha3.erl",
"src/jwa/xchacha20_poly1305/jose_xchacha20_poly1305.erl",
"src/jwe/jose_jwe.erl",
"src/jwe/jose_jwe_alg.erl",
"src/jwe/jose_jwe_enc.erl",
Expand All @@ -56,37 +54,9 @@ erlang_bytecode(
"src/jws/jose_jws.erl",
"src/jws/jose_jws_alg.erl",
],
outs = [
"ebin/jose_block_encryptor.beam",
"ebin/jose_chacha20_poly1305.beam",
"ebin/jose_curve25519.beam",
"ebin/jose_curve448.beam",
"ebin/jose_json.beam",
"ebin/jose_jwe.beam",
"ebin/jose_jwe_alg.beam",
"ebin/jose_jwe_enc.beam",
"ebin/jose_jwk.beam",
"ebin/jose_jwk_kty.beam",
"ebin/jose_jwk_oct.beam",
"ebin/jose_jwk_use_enc.beam",
"ebin/jose_jwk_use_sig.beam",
"ebin/jose_jws.beam",
"ebin/jose_jws_alg.beam",
"ebin/jose_sha3.beam",
"ebin/jose_xchacha20_poly1305.beam",
],
hdrs = [
"include/jose.hrl",
"include/jose_base.hrl",
"include/jose_compat.hrl",
"include/jose_jwe.hrl",
"include/jose_jwk.hrl",
"include/jose_jws.hrl",
"include/jose_jwt.hrl",
"include/jose_public_key.hrl",
],
hdrs = [":public_and_private_hdrs"],
app_name = "jose",
beam = [":parse_transforms"],
dest = "ebin",
erlc_opts = "//:erlc_opts",
)

Expand All @@ -97,24 +67,10 @@ erlang_bytecode(
"src/base/jose_base64url.erl",
"src/jose.erl",
"src/jose_app.erl",
"src/jose_chacha20_poly1305_crypto.erl",
"src/jose_chacha20_poly1305_libsodium.erl",
"src/jose_chacha20_poly1305_unsupported.erl",
"src/jose_crypto_compat.erl",
"src/jose_curve25519_libdecaf.erl",
"src/jose_curve25519_libsodium.erl",
"src/jose_curve25519_unsupported.erl",
"src/jose_curve448_libdecaf.erl",
"src/jose_curve448_unsupported.erl",
"src/jose_public_key.erl",
"src/jose_server.erl",
"src/jose_sha3_keccakf1600_driver.erl",
"src/jose_sha3_keccakf1600_nif.erl",
"src/jose_sha3_libdecaf.erl",
"src/jose_sha3_unsupported.erl",
"src/jose_sup.erl",
"src/jose_xchacha20_poly1305_crypto.erl",
"src/jose_xchacha20_poly1305_unsupported.erl",
"src/json/jose_json_jason.erl",
"src/json/jose_json_jiffy.erl",
"src/json/jose_json_jsone.erl",
Expand All @@ -125,6 +81,18 @@ erlang_bytecode(
"src/json/jose_json_poison_lexical_encoder.erl",
"src/json/jose_json_thoas.erl",
"src/json/jose_json_unsupported.erl",
"src/jwa/chacha20_poly1305/jose_chacha20_poly1305_crypto.erl",
"src/jwa/chacha20_poly1305/jose_chacha20_poly1305_libsodium.erl",
"src/jwa/chacha20_poly1305/jose_chacha20_poly1305_unsupported.erl",
"src/jwa/curve25519/jose_curve25519_crypto.erl",
"src/jwa/curve25519/jose_curve25519_fallback.erl",
"src/jwa/curve25519/jose_curve25519_libdecaf.erl",
"src/jwa/curve25519/jose_curve25519_libsodium.erl",
"src/jwa/curve25519/jose_curve25519_unsupported.erl",
"src/jwa/curve448/jose_curve448_crypto.erl",
"src/jwa/curve448/jose_curve448_fallback.erl",
"src/jwa/curve448/jose_curve448_libdecaf.erl",
"src/jwa/curve448/jose_curve448_unsupported.erl",
"src/jwa/jose_jwa.erl",
"src/jwa/jose_jwa_aes.erl",
"src/jwa/jose_jwa_aes_kw.erl",
Expand All @@ -149,11 +117,19 @@ erlang_bytecode(
"src/jwa/jose_jwa_x448.erl",
"src/jwa/jose_jwa_xchacha20.erl",
"src/jwa/jose_jwa_xchacha20_poly1305.erl",
"src/jwa/sha3/jose_sha3_keccakf1600_driver.erl",
"src/jwa/sha3/jose_sha3_keccakf1600_nif.erl",
"src/jwa/sha3/jose_sha3_libdecaf.erl",
"src/jwa/sha3/jose_sha3_unsupported.erl",
"src/jwa/xchacha20_poly1305/jose_xchacha20_poly1305_crypto.erl",
"src/jwa/xchacha20_poly1305/jose_xchacha20_poly1305_libsodium.erl",
"src/jwa/xchacha20_poly1305/jose_xchacha20_poly1305_unsupported.erl",
"src/jwe/jose_jwe_alg_aes_kw.erl",
"src/jwe/jose_jwe_alg_c20p_kw.erl",
"src/jwe/jose_jwe_alg_dir.erl",
"src/jwe/jose_jwe_alg_ecdh_1pu.erl",
"src/jwe/jose_jwe_alg_ecdh_es.erl",
"src/jwe/jose_jwe_alg_ecdh_ss.erl",
"src/jwe/jose_jwe_alg_pbes2.erl",
"src/jwe/jose_jwe_alg_rsa.erl",
"src/jwe/jose_jwe_alg_xc20p_kw.erl",
Expand Down Expand Up @@ -183,112 +159,10 @@ erlang_bytecode(
"src/jws/jose_jws_alg_rsa_pss.erl",
"src/jwt/jose_jwt.erl",
],
outs = [
"ebin/jose.beam",
"ebin/jose_app.beam",
"ebin/jose_base64.beam",
"ebin/jose_base64url.beam",
"ebin/jose_chacha20_poly1305_crypto.beam",
"ebin/jose_chacha20_poly1305_libsodium.beam",
"ebin/jose_chacha20_poly1305_unsupported.beam",
"ebin/jose_crypto_compat.beam",
"ebin/jose_curve25519_libdecaf.beam",
"ebin/jose_curve25519_libsodium.beam",
"ebin/jose_curve25519_unsupported.beam",
"ebin/jose_curve448_libdecaf.beam",
"ebin/jose_curve448_unsupported.beam",
"ebin/jose_json_jason.beam",
"ebin/jose_json_jiffy.beam",
"ebin/jose_json_jsone.beam",
"ebin/jose_json_jsx.beam",
"ebin/jose_json_ojson.beam",
"ebin/jose_json_poison.beam",
"ebin/jose_json_poison_compat_encoder.beam",
"ebin/jose_json_poison_lexical_encoder.beam",
"ebin/jose_json_thoas.beam",
"ebin/jose_json_unsupported.beam",
"ebin/jose_jwa.beam",
"ebin/jose_jwa_aes.beam",
"ebin/jose_jwa_aes_kw.beam",
"ebin/jose_jwa_base64url.beam",
"ebin/jose_jwa_bench.beam",
"ebin/jose_jwa_chacha20.beam",
"ebin/jose_jwa_chacha20_poly1305.beam",
"ebin/jose_jwa_concat_kdf.beam",
"ebin/jose_jwa_curve25519.beam",
"ebin/jose_jwa_curve448.beam",
"ebin/jose_jwa_ed25519.beam",
"ebin/jose_jwa_ed448.beam",
"ebin/jose_jwa_hchacha20.beam",
"ebin/jose_jwa_math.beam",
"ebin/jose_jwa_pkcs1.beam",
"ebin/jose_jwa_pkcs5.beam",
"ebin/jose_jwa_pkcs7.beam",
"ebin/jose_jwa_poly1305.beam",
"ebin/jose_jwa_sha3.beam",
"ebin/jose_jwa_unsupported.beam",
"ebin/jose_jwa_x25519.beam",
"ebin/jose_jwa_x448.beam",
"ebin/jose_jwa_xchacha20.beam",
"ebin/jose_jwa_xchacha20_poly1305.beam",
"ebin/jose_jwe_alg_aes_kw.beam",
"ebin/jose_jwe_alg_c20p_kw.beam",
"ebin/jose_jwe_alg_dir.beam",
"ebin/jose_jwe_alg_ecdh_1pu.beam",
"ebin/jose_jwe_alg_ecdh_es.beam",
"ebin/jose_jwe_alg_pbes2.beam",
"ebin/jose_jwe_alg_rsa.beam",
"ebin/jose_jwe_alg_xc20p_kw.beam",
"ebin/jose_jwe_enc_aes.beam",
"ebin/jose_jwe_enc_c20p.beam",
"ebin/jose_jwe_enc_xc20p.beam",
"ebin/jose_jwe_zip.beam",
"ebin/jose_jwk_der.beam",
"ebin/jose_jwk_kty_ec.beam",
"ebin/jose_jwk_kty_oct.beam",
"ebin/jose_jwk_kty_okp_ed25519.beam",
"ebin/jose_jwk_kty_okp_ed25519ph.beam",
"ebin/jose_jwk_kty_okp_ed448.beam",
"ebin/jose_jwk_kty_okp_ed448ph.beam",
"ebin/jose_jwk_kty_okp_x25519.beam",
"ebin/jose_jwk_kty_okp_x448.beam",
"ebin/jose_jwk_kty_rsa.beam",
"ebin/jose_jwk_openssh_key.beam",
"ebin/jose_jwk_pem.beam",
"ebin/jose_jwk_set.beam",
"ebin/jose_jws_alg_ecdsa.beam",
"ebin/jose_jws_alg_eddsa.beam",
"ebin/jose_jws_alg_hmac.beam",
"ebin/jose_jws_alg_none.beam",
"ebin/jose_jws_alg_poly1305.beam",
"ebin/jose_jws_alg_rsa_pkcs1_v1_5.beam",
"ebin/jose_jws_alg_rsa_pss.beam",
"ebin/jose_jwt.beam",
"ebin/jose_public_key.beam",
"ebin/jose_server.beam",
"ebin/jose_sha3_keccakf1600_driver.beam",
"ebin/jose_sha3_keccakf1600_nif.beam",
"ebin/jose_sha3_libdecaf.beam",
"ebin/jose_sha3_unsupported.beam",
"ebin/jose_sup.beam",
"ebin/jose_xchacha20_poly1305_crypto.beam",
"ebin/jose_xchacha20_poly1305_unsupported.beam",
],
hdrs = [
"include/jose.hrl",
"include/jose_base.hrl",
"include/jose_compat.hrl",
"include/jose_jwe.hrl",
"include/jose_jwk.hrl",
"include/jose_jws.hrl",
"include/jose_jwt.hrl",
"include/jose_public_key.hrl",
],
hdrs = [":public_and_private_hdrs"],
app_name = "jose",
beam = [
":parse_transforms",
":behaviours",
],
beam = [":behaviours"],
dest = "ebin",
erlc_opts = "//:erlc_opts",
)

Expand All @@ -297,43 +171,22 @@ filegroup(
srcs = [
":behaviours",
":other_beam",
":parse_transforms",
],
)

filegroup(
name = "srcs",
srcs = [
"src/base/jose_base.erl",
"src/base/jose_base64.erl",
"src/base/jose_base64url.erl",
"src/jose.app.src",
"src/jose.erl",
"src/jose_app.erl",
"src/jose_block_encryptor.erl",
"src/jose_chacha20_poly1305.erl",
"src/jose_chacha20_poly1305_crypto.erl",
"src/jose_chacha20_poly1305_libsodium.erl",
"src/jose_chacha20_poly1305_unsupported.erl",
"src/jose_crypto_compat.erl",
"src/jose_curve25519.erl",
"src/jose_curve25519_libdecaf.erl",
"src/jose_curve25519_libsodium.erl",
"src/jose_curve25519_unsupported.erl",
"src/jose_curve448.erl",
"src/jose_curve448_libdecaf.erl",
"src/jose_curve448_unsupported.erl",
"src/jose_public_key.erl",
"src/jose_server.erl",
"src/jose_sha3.erl",
"src/jose_sha3_keccakf1600_driver.erl",
"src/jose_sha3_keccakf1600_nif.erl",
"src/jose_sha3_libdecaf.erl",
"src/jose_sha3_unsupported.erl",
"src/jose_sup.erl",
"src/jose_xchacha20_poly1305.erl",
"src/jose_xchacha20_poly1305_crypto.erl",
"src/jose_xchacha20_poly1305_unsupported.erl",
"src/json/jose_json.erl",
"src/json/jose_json_jason.erl",
"src/json/jose_json_jiffy.erl",
Expand All @@ -345,6 +198,21 @@ filegroup(
"src/json/jose_json_poison_lexical_encoder.erl",
"src/json/jose_json_thoas.erl",
"src/json/jose_json_unsupported.erl",
"src/jwa/chacha20_poly1305/jose_chacha20_poly1305.erl",
"src/jwa/chacha20_poly1305/jose_chacha20_poly1305_crypto.erl",
"src/jwa/chacha20_poly1305/jose_chacha20_poly1305_libsodium.erl",
"src/jwa/chacha20_poly1305/jose_chacha20_poly1305_unsupported.erl",
"src/jwa/curve25519/jose_curve25519.erl",
"src/jwa/curve25519/jose_curve25519_crypto.erl",
"src/jwa/curve25519/jose_curve25519_fallback.erl",
"src/jwa/curve25519/jose_curve25519_libdecaf.erl",
"src/jwa/curve25519/jose_curve25519_libsodium.erl",
"src/jwa/curve25519/jose_curve25519_unsupported.erl",
"src/jwa/curve448/jose_curve448.erl",
"src/jwa/curve448/jose_curve448_crypto.erl",
"src/jwa/curve448/jose_curve448_fallback.erl",
"src/jwa/curve448/jose_curve448_libdecaf.erl",
"src/jwa/curve448/jose_curve448_unsupported.erl",
"src/jwa/jose_jwa.erl",
"src/jwa/jose_jwa_aes.erl",
"src/jwa/jose_jwa_aes_kw.erl",
Expand All @@ -369,13 +237,23 @@ filegroup(
"src/jwa/jose_jwa_x448.erl",
"src/jwa/jose_jwa_xchacha20.erl",
"src/jwa/jose_jwa_xchacha20_poly1305.erl",
"src/jwa/sha3/jose_sha3.erl",
"src/jwa/sha3/jose_sha3_keccakf1600_driver.erl",
"src/jwa/sha3/jose_sha3_keccakf1600_nif.erl",
"src/jwa/sha3/jose_sha3_libdecaf.erl",
"src/jwa/sha3/jose_sha3_unsupported.erl",
"src/jwa/xchacha20_poly1305/jose_xchacha20_poly1305.erl",
"src/jwa/xchacha20_poly1305/jose_xchacha20_poly1305_crypto.erl",
"src/jwa/xchacha20_poly1305/jose_xchacha20_poly1305_libsodium.erl",
"src/jwa/xchacha20_poly1305/jose_xchacha20_poly1305_unsupported.erl",
"src/jwe/jose_jwe.erl",
"src/jwe/jose_jwe_alg.erl",
"src/jwe/jose_jwe_alg_aes_kw.erl",
"src/jwe/jose_jwe_alg_c20p_kw.erl",
"src/jwe/jose_jwe_alg_dir.erl",
"src/jwe/jose_jwe_alg_ecdh_1pu.erl",
"src/jwe/jose_jwe_alg_ecdh_es.erl",
"src/jwe/jose_jwe_alg_ecdh_ss.erl",
"src/jwe/jose_jwe_alg_pbes2.erl",
"src/jwe/jose_jwe_alg_rsa.erl",
"src/jwe/jose_jwe_alg_xc20p_kw.erl",
Expand Down Expand Up @@ -415,10 +293,7 @@ filegroup(
],
)

filegroup(
name = "private_hdrs",
srcs = [],
)
filegroup(name = "private_hdrs")

filegroup(
name = "public_hdrs",
Expand All @@ -436,7 +311,9 @@ filegroup(

filegroup(
name = "priv",
srcs = ["priv/Dockerfile"],
srcs = [
"priv/.keep",
],
)

filegroup(
Expand Down Expand Up @@ -471,6 +348,8 @@ erlang_app(
"crypto",
"public_key",
],
license_files = [":license_files"],
priv = [":priv"],
deps = ["@thoas//:erlang_app"],
)

Expand All @@ -479,3 +358,10 @@ alias(
actual = ":erlang_app",
visibility = ["//visibility:public"],
)

filegroup(
name = "license_files",
srcs = [
"LICENSE.md",
],
)
Loading

0 comments on commit 45d0672

Please sign in to comment.