Skip to content

e2ee-tag: relay the +obby.world/e2ee client tag for Obby-native E2EE#16

Open
matheusfillipe wants to merge 2 commits into
unreal60_devfrom
feat/e2ee-tag
Open

e2ee-tag: relay the +obby.world/e2ee client tag for Obby-native E2EE#16
matheusfillipe wants to merge 2 commits into
unreal60_devfrom
feat/e2ee-tag

Conversation

@matheusfillipe

@matheusfillipe matheusfillipe commented Jun 14, 2026

Copy link
Copy Markdown

What

Adds the e2ee-tag module, registering a MessageTagHandler for the
+obby.world/e2ee client-only tag so the server relays it to recipients —
exactly as it already does for +draft/reply (reply-tag) and
+obby.world/invoked-by (bot-tag).

This is the server-side transport for Obby-native private-message E2EE.
The tag value is opaque (base64 of an encrypted blob); the server never
inspects it and only validates the shape:

  • non-empty
  • <= 4094 bytes (IRCv3 message-tags client-data cap)
  • base64 alphabet only (A-Za-z0-9+/=)

The contents are end-to-end encrypted, so the server cannot and must not
interpret them beyond that sanity check.

Why a server module is needed

UnrealIRCd/ObbyIRCd only relays client-only tags that have a registered
MessageTagHandler; unknown vendor tags are stripped. Without this module,
TAGMSG-carried +obby.world/e2ee payloads never reach the peer. (Verified
empirically against irc.h4ks.com: only registered tags pass through.)

Changes

  • src/modules/e2ee-tag.c — new module (mirrors reply-tag.c):
    MessageTagHandlerAdd with MTAG_HANDLER_FLAGS_NO_CAP_NEEDED +
    HOOKTYPE_NEW_MESSAGE to propagate the tag.
  • src/modules/Makefile.in — add e2ee-tag.so to the module list.
  • doc/conf/modules.default.confloadmodule "e2ee-tag";.

Companion

Client side lives in the ObsidianIRC app (Double Ratchet over this tag).
Cross-client interop (OTR) rides in the PRIVMSG body and needs no server
changes.

Notes

Not yet compiled in CI here — needs the full build toolchain. The handler
is a near-verbatim copy of the existing reply-tag pattern.

Summary by CodeRabbit

  • New Features
    • Added support for relaying end-to-end encryption metadata via IRCv3 message tags (+obby.world/e2ee), enabling compatible clients to securely exchange encrypted payloads through the server.
  • Chores
    • Updated module configuration/build to include the new encryption-tag module.

Registers a MessageTagHandler for +obby.world/e2ee so the server relays
the opaque (base64) client-only tag that carries Obby's end-to-end
encrypted private messages, exactly as it does for +draft/reply and
+obby.world/invoked-by. The value is never inspected beyond a base64
shape/length check (<=4094 bytes); the contents are end-to-end
encrypted, so the server cannot and must not interpret them.

Wired into the module build list and modules.default.conf.
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9252a4d6-c6e6-4732-836a-f4f81ec42078

📥 Commits

Reviewing files that changed from the base of the PR and between dc81129 and d04ed3c.

📒 Files selected for processing (1)
  • src/modules/e2ee-tag.c
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/modules/e2ee-tag.c

📝 Walkthrough

Walkthrough

A new UnrealIRCd module e2ee-tag is added that registers and relays the +obby.world/e2ee IRCv3 message tag. The module validates tag values against a base64-like character set with a 4094-byte limit, duplicates received tags for user clients, and is wired into both the build system and the default module configuration.

Changes

e2ee-tag IRCv3 message tag module

Layer / File(s) Summary
e2ee-tag module implementation
src/modules/e2ee-tag.c
New module registers the +obby.world/e2ee tag handler on MOD_INIT with MTAG_HANDLER_FLAGS_NO_CAP_NEEDED, validates values as base64-like strings up to 4094 bytes (empty strings are not rejected), and hooks HOOKTYPE_NEW_MESSAGE to duplicate and append the tag to the outgoing list for user clients.
Build and default config wiring
src/modules/Makefile.in, doc/conf/modules.default.conf
e2ee-tag.so is added to the MODULES build variable, and loadmodule "e2ee-tag"; is inserted into the IRCv3 extensions section of the default config.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A new tag hops into the relay stream,
Base64 letters drift by like a dream,
No cap required, just pass it along,
The e2ee bunny keeps secrets strong,
The server relays, but never peeks—
That's the privacy every rabbit seeks! 🔒

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main change: introducing a module to relay the +obby.world/e2ee client tag for Obby-native end-to-end encryption, which directly matches the core objective of implementing the e2ee-tag module.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/e2ee-tag

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/modules/e2ee-tag.c`:
- Around line 1-14: The copyright header in the module file uses "ObbyIRCd Team"
instead of the repository-required "The obbyworld Team" and does not match the
required GPL notice format for C module headers. Update the copyright line in
the header comment block at the top of the file to replace "ObbyIRCd Team" with
"The obbyworld Team" and ensure the entire header block follows the
repository-required module-header wording including the GPLv2 notice as
specified in the coding guidelines.
- Around line 83-84: The isalnum() function requires either an unsigned char or
EOF value according to the C standard, but *p is being passed directly without
proper casting. This can cause undefined behavior on platforms where char is
signed and *p contains a negative value. Cast *p to (unsigned char) before
passing it to isalnum() in the conditional check to ensure safe and
standards-compliant behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4d612e0d-f847-44fc-b0bc-2acf7b0b9f92

📥 Commits

Reviewing files that changed from the base of the PR and between 6314b76 and dc81129.

📒 Files selected for processing (3)
  • doc/conf/modules.default.conf
  • src/modules/Makefile.in
  • src/modules/e2ee-tag.c

Comment thread src/modules/e2ee-tag.c Outdated
Comment on lines +1 to +14
/*
* IRC - Internet Relay Chat, src/modules/e2ee-tag.c
* (C) 2026 ObbyIRCd Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Align module header comment block with repository-required copyright/GPL text.

This header does not match the required module-header wording (The obbyworld Team and GPLv2 notice) for src/modules/*.c.

Proposed adjustment
- *   (C) 2026 ObbyIRCd Team
+ *   Copyright (C) 2026 The obbyworld Team
@@
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 1, or (at your option)
- *   any later version.
+ *   it under the terms of the GNU General Public License version 2
+ *   as published by the Free Software Foundation.

As per coding guidelines: "In C module headers, include the copyright comment block with 'The obbyworld Team' and GPLv2 notice."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/modules/e2ee-tag.c` around lines 1 - 14, The copyright header in the
module file uses "ObbyIRCd Team" instead of the repository-required "The
obbyworld Team" and does not match the required GPL notice format for C module
headers. Update the copyright line in the header comment block at the top of the
file to replace "ObbyIRCd Team" with "The obbyworld Team" and ensure the entire
header block follows the repository-required module-header wording including the
GPLv2 notice as specified in the coding guidelines.

Source: Coding guidelines

Comment thread src/modules/e2ee-tag.c Outdated
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