Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
6d21330
Add missing authentication topic
clauspruefer Jan 5, 2026
be03e7d
Fix correct exception type
clauspruefer Jan 5, 2026
22615a0
Add user simple (direct, unencapsulated) routing integration
clauspruefer Jan 5, 2026
b8eb778
Delete
clauspruefer Jan 5, 2026
6bfca1f
Working user based simple routing, first routines for getting complet…
clauspruefer Jan 5, 2026
355c5de
Modify example to NoSQL (mongodb) abstraction
clauspruefer Jan 5, 2026
c60cfef
Fix member declaration
clauspruefer Jan 5, 2026
5414731
Correct line length
clauspruefer Jan 5, 2026
3f405c2
Fix looping over dict
clauspruefer Jan 5, 2026
8791706
Remove
clauspruefer Jan 5, 2026
13ab413
Update src/microesb.py
clauspruefer Jan 5, 2026
eb904d8
Correct type to json_dict
clauspruefer Jan 5, 2026
9c1f132
Merge branch 'v1.1-rc' of github.com:clauspruefer/python-micro-esb in…
clauspruefer Jan 5, 2026
5d688f8
Correct typo
clauspruefer Jan 5, 2026
5208a25
Correct member declaration
clauspruefer Jan 5, 2026
3c540c1
Add docstrings
clauspruefer Jan 5, 2026
88e7433
Correct private member name
clauspruefer Jan 5, 2026
305324b
Add exception handling for non-existing user_routing.py cases
clauspruefer Jan 5, 2026
8de916d
Correct for tests
clauspruefer Jan 5, 2026
e49a82d
Add forgotten return statement
clauspruefer Jan 5, 2026
050a573
Remove json_transform check (add new test after new deserialization m…
clauspruefer Jan 5, 2026
c64ea5d
Initial plan
Copilot Jan 6, 2026
bdbe4e5
Add Example 04 NLAP integration template with README.md
Copilot Jan 6, 2026
de7e14a
Update README to clarify NLAP Proxy description
clauspruefer Jan 6, 2026
c828a53
Merge pull request #29 from clauspruefer/copilot/sub-pr-28
clauspruefer Jan 6, 2026
349e30d
Add version 1.1
clauspruefer Jan 6, 2026
5c076d1
- add recursive auto mapping of class instances' json_dict (deseriali…
clauspruefer Jan 7, 2026
3b1c1c2
Modify example to use MongoDB backend
clauspruefer Jan 7, 2026
a906938
Fix incorrect variable name
clauspruefer Jan 7, 2026
ccaf5b7
Rename according to global style
clauspruefer Jan 7, 2026
5973f8b
Correct IP addresses to be used locally / inside docker example conta…
clauspruefer Jan 7, 2026
9c35e6a
Shorten lines (pylint fails)
clauspruefer Jan 7, 2026
b0e486d
Update to current milestones / features
clauspruefer Jan 7, 2026
97b2672
Add import
clauspruefer Jan 7, 2026
d352c58
Correct variable name
clauspruefer Jan 7, 2026
4a8f557
Update version
clauspruefer Jan 7, 2026
67c62f4
Update to new version
clauspruefer Jan 7, 2026
de31438
Add json_transform integration tests
clauspruefer Jan 11, 2026
48afa20
Fix memeber names
clauspruefer Jan 11, 2026
fd05562
Correct naming
clauspruefer Jan 11, 2026
98c6cb4
Add missing function param
clauspruefer Jan 11, 2026
71cad92
Fix class alias processing (class mapping)
clauspruefer Jan 11, 2026
e1f6687
Remove, "should" only be relevant in _connect_hierarchy_recursive()
clauspruefer Jan 11, 2026
6ce21ac
Remove, problem is in __iter__ and self.iterate() processing wrong __…
clauspruefer Jan 11, 2026
599c230
Fix probably wrong adding of class_ref instead of class_name
clauspruefer Jan 11, 2026
2e67139
Update integration test
clauspruefer Jan 11, 2026
4ef435a
Fix defining member outside __init__()
clauspruefer Jan 11, 2026
2794c1b
Cleanup dirty code
clauspruefer Jan 11, 2026
20ceb16
Fix pylint
clauspruefer Jan 11, 2026
66f5a9e
Remove outdated reference
clauspruefer Jan 11, 2026
30a8fb6
Add example2 ref
clauspruefer Jan 11, 2026
eae6153
Remove unclear statements
clauspruefer Jan 11, 2026
3e00278
Remove example 4
clauspruefer Jan 11, 2026
857d2db
Correct / update future features
clauspruefer Jan 11, 2026
9a341a9
Initial plan
Copilot Jan 11, 2026
5bf3a5f
Update documentation for version 1.1 release
Copilot Jan 11, 2026
f928043
Fix documentation cross-references and test data consistency
Copilot Jan 11, 2026
459c47d
Update api.rst
clauspruefer Jan 11, 2026
cd7daec
Refactor comments for example usage in api.rst
clauspruefer Jan 11, 2026
ed686e9
Update service execution method and retrieve root object
clauspruefer Jan 11, 2026
4a61a37
Merge pull request #30 from clauspruefer/copilot/sub-pr-28-again
clauspruefer Jan 11, 2026
13e1247
Initial plan
Copilot Jan 12, 2026
6e532c1
Add README.md for example 2 PKI management with MongoDB details
Copilot Jan 12, 2026
76ceab1
Fix MongoDB installation instructions in example 2 README
Copilot Jan 12, 2026
c638094
Update MongoDB instructions to use modern commands
Copilot Jan 12, 2026
ac75db8
Merge pull request #31 from clauspruefer/copilot/sub-pr-28-another-one
clauspruefer Jan 12, 2026
02f487c
Corrected
clauspruefer Jan 12, 2026
5151ad8
Remove direct mongodb installation, correct container remark
clauspruefer Jan 12, 2026
bcd33ed
Finalize (non-reviewed)
clauspruefer Jan 13, 2026
086d68b
Enhance format
clauspruefer Jan 13, 2026
6bcf3c3
Correct format
clauspruefer Jan 13, 2026
a71095d
Initial plan
Copilot Jan 13, 2026
0f45ef7
Update documentation: improve routing.rst and add MongoDB examples to…
Copilot Jan 13, 2026
ab633b7
Merge pull request #34 from clauspruefer/copilot/sub-pr-28-yet-again
clauspruefer Jan 13, 2026
25b5c5d
Change to global style
clauspruefer Jan 13, 2026
5dabfef
Initial plan
Copilot Jan 13, 2026
e9c0291
Update documentation: fix method names in examples.rst and enhance ex…
Copilot Jan 13, 2026
61488aa
Fix remaining method name references in examples.rst
Copilot Jan 13, 2026
a7ea446
Merge pull request #35 from clauspruefer/copilot/sub-pr-28-one-more-time
clauspruefer Jan 13, 2026
584392e
Add collection
clauspruefer Jan 13, 2026
f8e0e99
Modify all logging from "info" to "debug"
clauspruefer Jan 13, 2026
57aa35e
Make example2 running correctly
clauspruefer Jan 13, 2026
b7d7c8e
Correct example file (inclusion) names
clauspruefer Jan 13, 2026
6fa9adc
Update to more fitting content
clauspruefer Jan 13, 2026
17b17a2
Integrate features and planned features
clauspruefer Jan 13, 2026
cccadae
Initial plan
Copilot Jan 13, 2026
dde59e8
Complete Python docstrings in /src/*.py files
Copilot Jan 13, 2026
17f5876
Merge pull request #36 from clauspruefer/copilot/sub-pr-28-please-work
clauspruefer Jan 13, 2026
217c9e5
Add missing references
clauspruefer Jan 13, 2026
095b5c7
Reduce line length
clauspruefer Jan 13, 2026
71f3858
Remove unneeded "pass" statement
clauspruefer Jan 13, 2026
5fca329
Fix numbering
clauspruefer Jan 13, 2026
84fa330
Add missing class mappings section
clauspruefer Jan 13, 2026
311617d
User NLAP over NLAMP, better!
clauspruefer Jan 13, 2026
23daaa7
Add return result
clauspruefer Jan 13, 2026
49076fc
Call as public member
clauspruefer Jan 13, 2026
5472784
Fix multiple bugs
clauspruefer Jan 13, 2026
cf0de50
Update src/microesb.py
clauspruefer Jan 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: python3 setup.py sdist

- name: Install Python module
run: pip3 install ./dist/microesb-1.0.tar.gz
run: pip3 install ./dist/microesb-1.1.tar.gz

- name: Run tests
run: pytest --cov --cov-branch --cov-report=xml
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog


## Version 1.1

Comment thread
clauspruefer marked this conversation as resolved.
- Add user-based service call routing via ServiceRouter class
- Introduce `property_dict` functionality for flexible property access excluding internal system properties
- Support recursive class hierarchy object deserialization in ServiceExecuter
- Improve JSONTransformer robustness with `_SYSClassNames` tracking for hierarchy processing
- Add property registration feature for internal system properties via `register_property()`
- Modify Example 02 to use NoSQL MongoDB backend for certificate management
- Add Example 04 with NLAP proxy integration documentation
- Add comprehensive unit and integration tests for recursive json_transform()
- Cleanup recursive hierarchy processing code in `execute_get_hierarchy()`
- Update documentation for version 1.1 features

## Version 1.0

- Working pylint checks
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

*Enterprise Service Bus* is still a pretty vague term, first introduced in the Gartner Report of 2002.

It is essential for running a large SOA infrastructure.
It is essential for maintaining large SOA infrastructures.

## 2. Features

Our interpretation of what an ESB should consist of:

- ✅ Service Abstraction / Metadata Definition
- ✅ Centralized Service / API Registry containing clean XML, JSON Model
- ✅ Service Abstraction / Declarative Metadata Modeling
- ✅ Centralized Service / API Registry providing clean XML, JSON Models
- ✅ Centralized Service AAA (Authentication / Authorization / Accounting)
- ✅ Internal Service XML / (Python) Class Mapping
- ✅ Service Metadata XML, JSON / Internal (Python) Class Abstraction
- ✅ Relational Backend OOP / ORM / ODM Mapper
- ✅ Service Model Documentation / API (Auto)-Generation

Expand All @@ -40,23 +40,24 @@ pip3 install microesb
pip3 install pytest pytest-pep8
```

## 4. Platform As A Service (PaaS)

Building web applications on PaaS infrastructure also relies on a clean Service Abstraction Model.
## 4. Platform As A Service (PaaS) / Microservices

> **Note**
> The Python **micro-esb** module will help.
The NoSQL conform JSON abstraction / data transformation capabilities make the micro-esb
suitable for modern, scalable Next-Level applications.

## 5. Current Features

- ✅ Service Abstraction / Metadata Definition
- ✅ Internal Code (Python) Class / Service Properties Mapping
- ✅ Graph-Based / Recursive JSON Result Abstraction
- ✅ OOP Relational ODM Mapper / MongoDB Integration

### 5.1. In Progress

- :hourglass: OOP Relational ODM Mapper
- :hourglass: Service Documentation (Auto)-Generation
- :hourglass: Service Registry / Encapsulated Service Routing
- :hourglass: YANG Model Import / Export / Transformation
- :hourglass: Web-Interface / Dashboard

## 6. Documentation / Examples

Expand Down
150 changes: 130 additions & 20 deletions doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,59 @@ It provides template functions described in the *Internal Classes / Class Repres

It inherits `transformer.JSONTransformer` to enable a generic, recursive dictionary representation of the class instance hierarchy. This feature allows for efficient assertions on complex object hierarchies.

Example test case (`/test/integration/test_base.py`, test: `test_multi_item_object`):
Example test case (`/test/integration/test_json_transform.py`, test: `test_list_object`):

.. code-block:: python

assert shipment.json_dict == {
root_object = r[0]['Shipment']['object_instance']

assert root_object.json_dict == {
'id': 'testshipment1',
'SYSServiceMethod': None,
'Palette': [
{'id': 1, 'label': 'label1'},
{'id': 2, 'label': 'label2'}
]
'Palette': {
'Palette': [
{ 'id': 1, 'label': 'label1' },
{ 'id': 2, 'label': 'label2' }
]
}
}

1.1. Property Dict
******************

The ``property_dict`` property (decorated with ``@property``) provides access to all class instance
properties excluding internal system properties like ``SYSServiceMethod`` and class references.

This enables clean property access for serialization, logging, or external API integration without
exposing internal framework properties.

Example usage:

.. code-block:: python

# access all user-defined properties
properties = instance.property_dict
# returns: {'id': 'value', 'name': 'test', ...}
# excludes: 'SYSServiceMethod' and internal references

1.2. Property Registration
***************************

Properties can be registered with metadata using the ``register_property()`` method. This is useful for defining internal system properties that should be handled specially by the framework.

Example from ``/example/02-pki-management/service_implementation.py``:

.. code-block:: python

self.register_property(
property_id='is_ca_cert',
property_data={
'type': 'bool',
'default': True,
'required': False,
'description': 'Is CA Certificate'
}
)
Comment thread
clauspruefer marked this conversation as resolved.

2. Class Handler
================

Expand Down Expand Up @@ -81,6 +121,8 @@ Example: Standard `ClassHandler` vs. `MultiClassHandler` implementation:

For an example *service call metadata* (Host properties), see Example 1 (:ref:`example-number1`).

.. _implementation-classes:

4. Implementation Classes
=========================

Expand Down Expand Up @@ -165,31 +207,22 @@ All *implementation classes* must be imported into the global Python namespace.

from microesb import microesb

Importing the main `microesb` module will call `import esbconfig` (see the following code, line 14).
Importing the main `microesb` module will call `import esbconfig` (see the following code, line 5).

.. code-block:: python
:linenos:

# ]*[ --------------------------------------------------------------------- ]*[
# . Micro ESB Python Module .
# ]*[ --------------------------------------------------------------------- ]*[
# . .
# . Copyright Claus Prüfer (2016 - 2024) .
# . .
# . .
# ]*[ --------------------------------------------------------------------- ]*[

import abc
import sys
import logging
import importlib
import esbconfig

The **microesb** standard installation will include an empty `esbconfig.py` in the global Python dist-packages or in the active Python environment.
The **microesb** default installation will include an empty `esbconfig.py` in the global Python dist-packages for working pytest tests.

.. warning::

If you do not provide an `esbconfig.py` in your project folder, the default installation file will be used.
If you do not provide an `esbconfig.py` in your project folder, the default installation file will be imported.

The following **esbconfig.py** tells the `microesb` importer to use the file **service_classes.py** and import *implementation classes* `Class1`, `Class2`, and `Class3` into the global namespace. These classes will then be usable by `ClassMapper` and `ServiceMapper` during internal processing.

Expand Down Expand Up @@ -239,7 +272,7 @@ The `ServiceMapper` class is responsible for mapping and populating the existing

It requires the following as input parameters:
- A reference to the `ClassMapper` instance
- **Service Call Metadata Dictionary** (see "Configuration / :ref:`service-call-metadata-config`")
- **Service Call Metadata Dictionary** (Metadata passed to the ServiceExecuter as input data)

Example:

Expand All @@ -251,3 +284,80 @@ Example:
class_mapper=class_mapper,
service_data=service_metadata
)

7. Service Router
=================

The `ServiceRouter` class provides user-defined service call routing capabilities. It enables direct routing of service calls to user-defined functions in a ``user_routing.py`` module.

This is particularly useful for:

- Database CRUD operations (MongoDB, PostgreSQL, etc.)
- External API integrations
- Custom business logic execution
- Decoupling service orchestration from implementation

7.1. Usage
**********

.. code-block:: python

from microesb.router import ServiceRouter

router = ServiceRouter()
result = router.send('FunctionName', metadata)

The ``send()`` method dynamically invokes the specified function from the ``user_routing`` module
and passes the metadata as the first argument.

7.2. User Routing Module
*************************

Create a ``user_routing.py`` file in your project with functions that handle specific routing targets:

.. code-block:: python

from pymongo import MongoClient

client = MongoClient('mongodb://127.0.0.1/')
mongodb = client.get_database('mydb')

def GetDataById(metadata):
return mongodb.collection.find_one({"id": metadata})

def StoreData(metadata):
mongodb.collection.insert_one(metadata)
return True

See the :ref:`routing` section for detailed routing documentation.

8. Service Executer
===================

The `ServiceExecuter` class handles the execution of service methods and manages recursive class hierarchy object deserialization. This enables complex hierarchical data structures to be properly reconstructed from JSON representations.

8.1. Recursive Deserialization
*******************************

The framework automatically deserializes nested class hierarchies, ensuring that:
- Child class instances are properly instantiated
- Parent-child relationships are maintained
- JSON data is correctly mapped to class properties

This is particularly useful when working with complex domain models that include multiple levels of nested objects.

Example:

.. code-block:: python

# hierarchical structure: CertClient -> CertServer -> CertCA
# the framework automatically deserializes all levels

service_executer = microesb.ServiceExecuter(
class_mapper=class_mapper,
service_mapper=service_mapper
)

result = service_executer.execute_get_hierarchy()
root_object = r[0]['RootObjectName']['object_instance']
print(root_object.json_dict)
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
project = 'Python microesb'
copyright = '2016 - 2024, Claus Prüfer'
author = 'Claus Prüfer'
version = '1.0'
release = '1.0'
version = '1.1'
release = '1.1'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
Loading
Loading