Releases: Strech/avrora
New SSL configuration options 🔐
In version 0.28 two new configuration options were added: registry_ssl_cacerts
and registry_ssl_cacert_path
both used for controlling SSL verification of the Schema Registry connection.
If both options are set, the registry_ssl_cacerts
takes precedence over registry_ssl_cacert_path
, also registry_ssl_cacerts
is a DER-encoded certificate, when registry_ssl_cacert_path
is a PEM-encoded certificate file.
As always feel free to share your feedback or issues and happy coding 🤗
Bump the minimal supported version of Elixir to 1.12+
To reduce noise about deprecation of Logger.warn/1
and refresh the CI setup together with local dependencies we have new this release.
Enjoy! 🎉
Custom configuration for the mix task
In this release, @emilianobovetti fixed an issue with custom configurations for the registration mix task. If you want to use your special config, let's say config/runtime.exs
, now you can specify it via --appconfig
option, like that
mix avrora.reg.schema --name io.confluent.Payment --appconfig runtime
schema `io.confluent.Payment' will be registered
it will be loaded in addition to the default one (if it's present)
Enjoy! Thanks to @emilianobovetti 💙
HTTP 🎧 headers with 🕵🏼♀️ agents
Starting this release each request to the Schema Registry will have an additional header User-Agent
. It's done in response to issue #101 when the AWS setup rejects the request.
The default value will contain the current version of the library, its name, and the language, for example: Avrora/0.25.0 Elixir
If you want the previous behaviour, i.e no User-Agent
header or your custom header value, then you can adjust it via the registry_user_agent
configuration option by setting it to nil
or your String respectively.
defmodule MyClient
use Avrora.Client, registry_user_agent: "Hello world" # you can set it to whatever you like
end
defmodule MyClientWithoutUserAgent
use Avrora.Client, registry_user_agent: nil # or you can disable User-Agent header
end
Thanks to @azeemchauhan for bringing it up 💟
No means NO 🙅🏼
It turns out that Avrora.Config.registry_schemas_autoreg/0
configuration option was not returning false
values if the library is configured and a private client is not used. And the only way to set it to false
was to create your client and configure it like
defmodule MyClient do
use Avrora.Client, registry_schemas_autoreg: false
end
Thanks to @ankhers it's fixed now! Enjoy folks! 🚢
To be explicit 🔒
In this release, we explicitly set the SSL option verify
to be verify_none
to reflect the changed default in OTP25. To avoid the false sense of security OTP25 has changed the default value for SSL verify
to be verify_peer
which requires you to source it certs.
We are going to add secure option in the next release, but for now let's keep it as it was 🤷🏼
Thanks to @goozzik for pointing this out!
Decoder hook 🪝 finnaly available
Initially, the decoder hook was done as a non-configurable no-op function due to clarity – how much it will be used and will be at all?. Seems the time has come, thanks to the @LostKobrakai 💜
The very first use-case is tagging unions, check this out:
defmodule MyClient do
use Avrora.Client,
decoder_hook: &__MODULE__.hook/4
def hook(type, sub_name_or_index, data, decode_fun) do
tag_unions_hook = :avro_decoder_hooks.tag_unions()
tag_unions_hook.(type, sub_name_or_index, data, decode_fun)
end
end
Now all the complex unions will be tagged and result will be passed to the "private" Avrora decoder hook. But there is no limit on what you can do with it, just don't forget to call at the end decode_fun.(data)
😉
Have fun 🐟 🪝
🔀 Dynamic is my second name!
In this release, all the private client configuration options become dynamic and may be resolved at runtime or at compile-time. It's defined by the presence of the otp_app
option.
If you set the otp_app
configuration the value lookup will follow this logic
OTP env value → Client value → Default value
Let's take a look at this example with private client MyClient
and :my_app
OTP application
# config/config.exs
config :my_app, MyClient, registry_url: "http://my-app.io"
# lib/my_client.ex
defmodule MyClient do
use Avrora.Client,
otp_app: :my_app,
registry_url: "http://never-used.com",
names_cache_ttl: 42
end
As the result, configuration values will look like this
MyClient.Config.registry_url() == "http://my-app.io" # (comes from runtime environment)
MyClient.Config.names_cache_ttl() == 42 # (comes from compile-time options)
MyClient.Config.registry_schemas_autoreg() == true # (comes from compile-time option defaults)
🚤 Bonus
Most of the generated Avrora.Client
code for Config
module gets rid of strings interpolation on runtime and moves it to the compile-rime and some hot paths were moved to compile-time.
Thanks a lot for this release to @juanperi 💙
No more static ⚡schemas path
In this release, few changes were done to the Avrora.Config
.
The main change is about releases and schemas_path
configuration. Especially if you have multiple apps in Umbrella and would like to have per-app schemas_path
, now you can pass an otp_app
option which should point to your OPT application which will be used to compute the root path for the schemas_path
in a runtime.
# Private client
defmodule MyClient do
use Avrora.Client,
otp_app: :my_application,
schemas_path: "./some/path/to/schemas"
end
# Shared client
config :avrora,
otp_app: :my_application,
schemas_path: "./some/path/to/schemas"
And as a side-effect, now all the schemas_path
which is without otp_app
set, will be resolved with Path.expand
Many thanks to @LostKobrakai for support 💚
Fixed private client Config.registry_auth/0 value
Unfortunately, mistakes happen. A copy-paste bug sneaks into Avrora.Client
module and breaks authentication. Thanks to @raphaklaus who spots and fixes the issue 💙
Happy coding 😸