crystal-dbus-native
Version, currently 0.2.04 versions
- 0.3.1latestOct 18, 2026
- 0.3.0not indexedOct 18, 2026
- 0.2.0not indexedOct 18, 2026
- 0.1.1not indexedAug 14, 2026
gitlab.com/renich/crystal-dbus-native
Native, zero-dependency D-Bus wire protocol for Crystal featuring BodyCodec marshaling, SASL EXTERNAL authentication, and SCM_RIGHTS UNIX file descriptor passing.
Nothing has been indexed for 0.2.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
crystal-dbus-native:
gitlab: renich/crystal-dbus-native
version: ~> 0.2.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.2.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
GitLab Project Metadata:
- Description: Native, zero-dependency D-Bus wire protocol for Crystal featuring BodyCodec marshaling, SASL EXTERNAL authentication, and SCM_RIGHTS UNIX file descriptor passing.
- Topics/Tags:
crystal,crystal-lang,dbus,ipc,linux,unix-sockets,scm-rights,zero-dependencies,security,gplv3
Overview
crystal-dbus-native provides a pure, zero-dependency Crystal implementation of the D-Bus wire protocol v1, general-purpose body marshaling (BodyCodec and Variant), SASL EXTERNAL authentication with NEGOTIATE_UNIX_FD negotiation, out-of-band UNIX domain socket file descriptor passing (SCM_RIGHTS), multiplexed fiber RPC routing (ReplyRouter), match-rule signal subscriptions, and typed PropertiesProxy/IntrospectableProxy client helpers.
Key Highlights
- Zero C-Library Dependencies: Communicates directly with Linux system and session UNIX domain sockets without
libdbus-1orlibsystemdFFI bindings. - Complete Body Marshaling (
BodyCodec&Variant): Encodes and decodes all basic D-Bus types, nested structs (StructValue), dictionaries (a{sv}),Variant,ObjectPath,Signature, andUnixFDin both little-endian and big-endian formats with 1, 2, 4, and 8-byte alignment enforcement. - Secure
SCM_RIGHTSFile Descriptor Passing: Wrapssendmsg/recvmsgwithMSG_CMSG_CLOEXECand guarantees automatic descriptor cleanup onMSG_CTRUNCtruncation or framing errors. - Multiplexed Fiber RPC & Signal Subscriptions:
ReplyRouterdemultiplexes out-of-order replies across concurrent fibers without head-of-line blocking and dispatchesAddMatchsignal subscriptions to boundedChannel(DBusMessage).new(64)channels. - Standard Interface Client Proxies:
PropertiesProxy(get,set,get_all,decode_properties_changed) andIntrospectableProxy(introspect) provide strongly-typed access to standard freedesktop interfaces.
Installation
Add crystal-dbus-native to your application's shard.yml:
dependencies:
crystal-dbus-native:
gitlab: renich/crystal-dbus-native
version: ~> 0.3.1
Then install the shard:
shards install
Usage
require "crystal-dbus-native"
# Connect to the session or system bus and perform SASL + Hello handshake
connection = Crystal::Dbus::Native::DBusConnection.open_session
unique_name = connection.start(negotiate_unix_fd: true)
puts "Connected to D-Bus (unique name: #{unique_name}, GUID: #{connection.server_guid})"
# Invoke a D-Bus method and decode its reply body
reply = connection.call(
destination: "org.freedesktop.DBus",
path: "/org/freedesktop/DBus",
interface: "org.freedesktop.DBus",
member: "GetId"
)
puts "Bus ID: #{reply.decode_body.first}"
# Inspect XML interfaces or read properties via typed client proxies
introspect = Crystal::Dbus::Native::IntrospectableProxy.new(
connection,
"org.freedesktop.DBus",
"/org/freedesktop/DBus"
)
puts introspect.introspect
props = Crystal::Dbus::Native::PropertiesProxy.new(
connection,
"org.freedesktop.DBus",
"/org/freedesktop/DBus"
)
features = props.get("org.freedesktop.DBus", "Features")
puts "Bus features signature: #{features.signature}"
# Subscribe to D-Bus signals via AddMatch
rule = "type='signal',interface='org.freedesktop.DBus',member='NameOwnerChanged'"
sig_ch = connection.subscribe_signal(rule)
connection.unsubscribe_signal(rule, sig_ch)
connection.close
Build System Targets
The repository includes a comprehensive, standard GNUmakefile:
| Target | Description |
|---|---|
make all | Runs lint, doc-check, and test |
make test | Executes the spec test suite (crystal spec) |
make lint | Runs crystal tool format --check, Ameba (--all), and Flaw SAST scanner |
make doc-check | Lints all reStructuredText files using crstlint and rstcheck |
make check | Alias for all (lint, doc-check, and test) |
make format | Formats all Crystal source and spec files |
make docs | Generates Crystal API docs and Sphinx dirhtml documentation |
make deps | Installs Shards dependencies and builds bin/ameba and bin/flaw |
make clean | Removes build artifacts, generated docs, and caches |
Documentation
Full architectural blueprints, functional specifications, and operational playbooks are maintained under docs/:
| Guide | Scope & Highlights | Entry Point |
|---|---|---|
| Business Context & Strategy | Ecosystem problem statement, ROI metrics, and user personas. | Business Specs |
| Functional Specifications | Requirements [FUNC-001]–[FUNC-007] and traceability matrix. | Functional Specs |
| Technical Architecture | Specifications [TECH-001]–[TECH-007], D2 diagrams, and threat model. | Technical Specs |
| Release Playbook | SemVer, Keep a Changelog, and GPG-signed GitLab release steps. | Release Procedure |
| Architecture Decisions (ADRs) | Immutable logs of architectural decisions and trade-offs. | ADR Index |
| Project Roadmap | Phased milestone tracking, task dependencies, and critical paths. | Project Roadmap |
| User Guides | Installation, RPC usage, and error handling examples. | User Manual |
| Crystal API Reference | Complete interactive type hierarchy and method signatures. | API Reference |
Contributing & Code of Honor
All contributions must adhere to the Universal Code of Honor and Contributing Guidelines.
License
- Software: GNU General Public License v3.0 or later (LICENSE).
- Documentation: GNU Free Documentation License v1.3 or later (LICENSE-DOCS).
Copyleft © 2026 Rénich Bon Ćirić <renich@evalinux.com>.
Support & Donations
If you find this shard useful and wish to support its ongoing development, please consider donating:
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- Oct 18, 2026
- Commit
3f0db4d20113- Indexed
- not yet
Dependents
Repository
gitlab.com/renich/crystal-dbus-native
Metadata
- Created
- Oct 19, 2026
- Updated
- Nov 18, 2026
- Synced
- Oct 24, 2026
- Versions
- 4