<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Add web3_auth module for blockchain-based authentication
This PR introduces a new authentication module that provides blockchain-powered
digest authentication via Oasis Sapphire smart contracts while maintaining full
compatibility with standard Kamailio auth module functions.
**Key Features:**
- Blockchain-based digest authentication via Oasis Sapphire smart contracts
- RFC2617 compliant MD5 and SHA-256 digest authentication
- Full compatibility with standard auth functions (www_authenticate, proxy_authenticate)
- Configurable parameters: web3_rpc_url, web3_contract_address, web3_debug_mode, web3_timeout
- Comprehensive error handling for network failures and blockchain connectivity
- Nonce management and replay protection identical to traditional auth
**Files Added:**
- src/modules/web3_auth/ (complete module with 9 .c files and supporting headers)
- Comprehensive documentation in doc/ subfolder
- CMakeLists.txt with curl dependency handling
**Testing Summary:**
- **Build Verification**: Module compiles successfully with curl dependency
- **Load Testing**: Module loads without errors in Kamailio configuration
- **Authentication Scenarios**:
- Valid credentials: Successful authentication with correct blockchain credentials
- Invalid credentials: Proper rejection of wrong passwords (tested with Zoiper)
- Network failures: Graceful handling of blockchain RPC connectivity issues
- Parameter validation: All module parameters properly validated
- **Compatibility Testing**: Full compatibility with existing auth module functions
- **Error Handling**: Comprehensive error logging and fallback behavior
**Documentation Status:**
- Complete XML documentation in doc/ subfolder
- Module parameters documented (web3_auth_params.xml)
- Functions documented (web3_auth_functions.xml)
- Configuration examples provided
- Usage patterns and best practices included
**Limitations:**
- Requires external blockchain RPC endpoint (Oasis Sapphire)
- Network dependency for authentication (no offline fallback)
- Requires curl library for HTTP requests to blockchain
- Smart contract must be deployed on target blockchain network
- Authentication speed depends on blockchain network response time
**Build System:**
- Added to MOD_LIST_UTILS group for proper curl dependency handling
- Includes CMakeLists.txt with find_package(CURL REQUIRED)
This module provides a drop-in replacement for traditional authentication while
leveraging blockchain technology for credential verification.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4326
-- Commit Summary --
* web3_auth: initial blockchain authentication module
* cmake: add web3_auth to MOD_LIST_UTILS group
-- File Changes --
M cmake/groups.cmake (2)
A src/modules/web3_auth (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4326.patchhttps://github.com/kamailio/kamailio/pull/4326.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4326
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4326(a)github.com>
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4327
-- Commit Summary --
* misctest: Add lock_test function and rpc
* misctest: add rpc param
* misctest: docs: add docs for new lock test function
-- File Changes --
M src/modules/misctest/doc/misctest_functions.xml (23)
M src/modules/misctest/doc/misctest_rpc.xml (28)
M src/modules/misctest/misctest_mod.c (48)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4327.patchhttps://github.com/kamailio/kamailio/pull/4327.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4327
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4327(a)github.com>
Module: kamailio
Branch: master
Commit: 4e6b550ab26237e4e2bf60315db9cc09cb4bdb9e
URL: https://github.com/kamailio/kamailio/commit/4e6b550ab26237e4e2bf60315db9cc0…
Author: Xenofon Karamanos <xk(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2025-07-16T15:32:35+02:00
misctest: docs: add docs for new lock test function
---
Modified: src/modules/misctest/doc/misctest_functions.xml
Modified: src/modules/misctest/doc/misctest_rpc.xml
---
Diff: https://github.com/kamailio/kamailio/commit/4e6b550ab26237e4e2bf60315db9cc0…
Patch: https://github.com/kamailio/kamailio/commit/4e6b550ab26237e4e2bf60315db9cc0…
---
diff --git a/src/modules/misctest/doc/misctest_functions.xml b/src/modules/misctest/doc/misctest_functions.xml
index faf15f0eeaf..812eb4ba3b2 100644
--- a/src/modules/misctest/doc/misctest_functions.xml
+++ b/src/modules/misctest/doc/misctest_functions.xml
@@ -69,4 +69,27 @@ mt_tcp_thread_exec("request $rm uri $ru");
</example>
</section>
+ <section id="misctest.mt_lock_test">
+ <title>
+ <function>mt_lock_test(count)</function>
+ </title>
+ <para>
+ Lock and unlock the global lock count times.
+ </para>
+ <note>
+ <para>
+ This is a debugging function for simulating locking and unlocking of global lock.
+ It should not be used in production setups
+ </para>
+ </note>
+ <example>
+ <title>
+ <function>mt_lock_test</function> usage</title>
+ <programlisting>
+...
+mt_lock_test(100000000);
+...
+ </programlisting>
+ </example>
+ </section>
</section>
diff --git a/src/modules/misctest/doc/misctest_rpc.xml b/src/modules/misctest/doc/misctest_rpc.xml
index cc80690ada8..93881210998 100644
--- a/src/modules/misctest/doc/misctest_rpc.xml
+++ b/src/modules/misctest/doc/misctest_rpc.xml
@@ -220,4 +220,32 @@
</example>
</section>
+ <section id="mt.lock_test">
+ <title>mt.lock_test</title>
+ <para>
+ The <em>mt.lock_test</em> RPC command performs a lock/unlock stress test using a global lock. It is primarily intended for debugging and performance testing of the locking subsystem.
+ </para>
+ <para>
+ <em>Usage:</em>
+ <programlisting>
+ kamcmd mt.lock_test [executions]
+ </programlisting>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <em>executions</em> (optional, integer): Number of times to lock and unlock. Default is 1,000,000,000 if not specified.</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ If the argument is provided, it must be a positive integer. If more than one argument is given, or if the argument is not a positive integer, the command will return an error.
+ </para>
+ <para>
+ Example:
+ <programlisting>
+ kamcmd mt.lock_test 10000
+ </programlisting>
+ This will perform 10,000 lock/unlock operations.
+ </para>
+ </section>
</section>