.. SPDX-FileCopyrightText: 2024 Univention GmbH
..
.. SPDX-License-Identifier: AGPL-3.0-only

.. _data-flow-udm-objects:

UDM objects flow
================

This section gives an overview about the data flow of *UDM objects*.
:ref:`data-flow-udm-objects-write` describes the features of the writing process.

.. seealso::

   :ref:`data-objects-udm`
      for information about *UDM objects*.

.. _data-flow-udm-objects-processing-:

UDM objects processing flow
---------------------------

:numref:`data-flow-udm-objects-figure`
shows the consumers of *UDM objects* in Nubus for Kubernetes
on the functional component level.

#. :ref:`overview-components-management-ui`
#. :ref:`component-directory-manager`
#. :ref:`component-authorization-service`
#. :ref:`component-provisioning-service`

*UDM objects* relate to :ref:`data-objects-directory`
that the *UDM Library* converts to and from.
The following contexts make use of *UDM objects*:

#. The *UDM Library* in the :ref:`component-directory-manager` converts *Directory objects* into *UDM objects*.

#. The *UMC Server* and the *UDM HTTP REST API* process *UDM objects*.

#. Other applications use the *UDM HTTP REST API* to access *UDM objects*.

.. _data-flow-udm-objects-figure:

.. figure:: /images/Data_object_flow_UDM_objects.*
   :target: ../_images/Data_object_flow_UDM_objects.svg
   :alt: Consumers of UDM objects on the application component level

   Consumers of *UDM objects* on the application component level

From the flow point of view,
you need to differentiate between read and write operations for *UDM objects*.
:numref:`data-flow-udm-objects-figure` and
:numref:`data-flow-udm-objects-details-figure` show the reading flow,
the latter one also includes the involved behavior in each application component.

For *UDM objects*, the journey starts with directory objects,
their transformation to UDM objects, and the application of business logic in the *UDM Library*.
The *UMC Server* and the *UDM Transformer* include the code of the *UDM Library*,
thus each use the same logic on *UDM objects*.

The following components retrieve *UDM objects* from *CRUD operations for UDM objects*:

* *Populate initial data for each consumer* in the *Prefill Service*
* *Retrieve attributes of actor and target* in the *Guardian Authorization HTTP REST API*
* *Write Portal configuration* in the *Portal Consumer*
* *Read dynamic portal assets, store for delivery* for the portal assets in the *Portal Frontend*

You can see the data flow starting with the *Directory objects*.
Furthermore, you can see which behavior part actually reads *UDM objects* and how they flow within Nubus.

.. _data-flow-udm-objects-details-figure:

.. figure:: /images/Data_object_flow_UDM_objects_details.*
   :target: ../_images/Data_object_flow_UDM_objects_details.svg
   :alt: Consumers of *UDM objects* on the application behavior level

   Consumers of *UDM objects* on the application behavior level

.. seealso::

   :ref:`component-portal-service` in the components section
      for information about the functions of the component.

   :ref:`overview-components-management-ui` in the overview section
      for information about the functions of the component.

   :ref:`component-directory-manager` in the components section
      for information about the functions of the component.

   :ref:`component-provisioning-service` in the components section
      for information about the functions of the service.

   :ref:`component-authorization-service` in the components section
      for information about the functions of the service.

.. _data-flow-udm-objects-write:

Write operation
---------------

Nubus for Kubernetes uses *UDM objects* as input for *Directory objects*.
It only supports the *UDM HTTP REST API* in the *Directory Manager*
to write data to the directory service,
because the *Directory Manager* applies business logic before writing to the *Directory Service*.

:numref:`data-flow-udm-objects-write-figure` shows data flows
for writing *UDM objects* that finally result in writing *Directory objects*.
The central gatekeeper is the *UDM Library*.
The *UMC Server* and the *UDM HTTP REST API* both use the *UDM Library*
to create UDM objects.

The components *Stack Data* and *Nubus Directory Importer* both use the *UDM HTTP REST API* for
their write operations, as well as, *Third-party applications not part of Nubus*.

.. _data-flow-udm-objects-write-figure:

.. figure:: /images/Data_object_flow_UDM_objects_write.*
   :target: ../_images/Data_object_flow_UDM_objects_write.svg
   :alt: Data flow for creating *UDM objects* on the application component level

   Data flow for creating *UDM objects* on the application component level

:numref:`data-flow-udm-objects-details-write-detail-figure` shows the flow relationships
for creating *UDM objects* on the more detailed behavioral level.
The following examples show, which component creates *UDM objects* through which component:

* The *Stack Data* component loads initial data
  for the operation of Nubus into the :ref:`component-identity-store-directory-service`.

* The *UMC Server* converts *UDM objects* to *Directory objects* and writes them
  to the :ref:`component-identity-store-directory-service`
  through the *UDM Library*.

* The :ref:`component-nubus-directory-importer`
  uses the *UDM HTTP REST API*
  in the :ref:`component-directory-manager`
  to import data for the directory service.

* *Third-party application, not part of Nubus*
  can use the *UDM HTTP REST API*
  in the :ref:`component-directory-manager`
  to write data to the directory service.

.. _data-flow-udm-objects-details-write-detail-figure:

.. figure:: /images/Data_object_flow_UDM_objects_write_detail.*
   :target: ../_images/Data_object_flow_UDM_objects_write_detail.svg
   :alt: Data flow for creating *UDM objects* on the application behavior level

   Data flow for creating *UDM objects* on the application behavior level
