Skip to content

Add an Elixir service client - #830

Merged
KavanPrice merged 19 commits into
devfrom
feature/ex-service-client
Oct 20, 2026
Merged

KavanPrice merged 19 commits into
devfrom
feature/ex-service-client

Conversation

@KavanPrice

Copy link
Copy Markdown
Collaborator

Summary

Adds an Elixir service client in-tree for building Elixir applications in or against ACS.

  • lib/ex-sparkplug: Sparkplug B decoding, topics and host application state, tested against Tahu JS fixtures
  • lib/ex-service-client: Kerberos credentials, MQTT, HTTP (Directory, Command Escalation) and one child spec configured from the environment
  • lib/erl-kerlberos: an in-tree fork of kerlberos with seven patches; see FORK.md, including a mutual-authentication fix
  • CLAUDE.md: Elixir code style; CI for lib/ex-*

@KavanPrice KavanPrice changed the title Feature/ex service client Add an Elixir service client Oct 20, 2026
@KavanPrice
KavanPrice force-pushed the feature/ex-service-client branch from 9f35c05 to ea5f58d Compare October 20, 2026 17:05
Start lib/ex-sparkplug, the Sparkplug B library the Elixir service
client will build on. Vendor Eclipse Tahu's sparkplug_b.proto and
commit the protox-generated modules, so builds don't need protoc.
Pin Elixir 1.20.4 and OTP 29.1.2.
The Elixir service client needs Kerberos and GSS-API, and kerlberos is
the only maintained pure-Erlang implementation. Upstream 2.0.3 can't
log in to the ACS KDC, so keep an in-tree fork. This commit is the
Hex package unchanged; the patches follow separately so they stay
visible. FORK.md records where it came from and why.
The ACS KDC doesn't require pre-authentication, so it answers
kerlberos's probe with a ticket, which crashed probe/3. Take the
etype and salt from that reply and authenticate with
pre-authentication as usual. Add keytab login, since ACS services
have random keys and no passwords. A keytab without the KDC's etype
is an error result rather than a crash, as a crash report would
include the keytab.
kerlberos only used lager for debug messages, but starting it started
lager, which wrote log/console.log, log/error.log and log/crash.log
into the working directory of every service using the client. By
default it also captured OTP crash reports, which can hold passwords
and keytab keys, into crash.log. Log with ?LOG_DEBUG instead, drop
lager and goldrush, and stop one acceptor message logging the
keytab's keys.
@KavanPrice
KavanPrice force-pushed the feature/ex-service-client branch from ea5f58d to 01da30f Compare October 20, 2026 21:23
@KavanPrice
KavanPrice merged commit 041eced into dev Oct 20, 2026
4 checks passed
@KavanPrice
KavanPrice deleted the feature/ex-service-client branch October 20, 2026 21:26
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.

1 participant