3.2.2. UDM extensions#

This section describes how to customize the Directory Manager, also known as UDM, in Nubus for Kubernetes. UDM offers the following possibilities for extension in the order from small to large:

  1. UDM syntax

  2. UDM hooks

  3. UDM handlers

Depending on your customization case, you may need to combine various UDM extensions or other extensions to achieve your goal.

Important

Describing how to create every different UDM extension is beyond the scope of this document. For an extensive description of UDM customization, refer to Univention Directory Manager (UDM) in Univention Corporate Server - Manual for developers [3].

3.2.2.1. UDM syntax#

As a developer, you want to define rules to verify user input for plausibility and validity. User input is the data as UDM stores it in the Directory Service. A UDM syntax ensures that the user input matches the expectation regarding that data. If this scenario describes your customization case, then UDM syntax is for you. UDM syntax defines the look and the behavior of an input widget for UDM objects. It applies the verification upon user input. You can combine existing syntax types for your own UDM syntax. In detail, UDM syntax offers the following functionality:

  • Validate the syntax of user input data.

  • Present static values from a predefined list of possible values.

  • Dynamically calculate possible values upon use.

  • Specify the layout and widget type for presentation in the Management UI.

To add a UDM syntax to Nubus for Kubernetes follow these steps:

  1. Save the UDM syntax in a file and give it a proper name.

  2. Follow the instructions for building the Docker image in Bundle extensions.

  3. Copy the plugin file to your extension project. For UDM syntax, the plugin-type is udm-syntax.d. See Add plugins.

    $ export PLUGIN_TYPE="udm-syntax.d"
    

Tip

The UDM HTTP REST API mounts your provided UDM syntax to the following directory: /usr/lib/python3/dist-packages/univention/admin/syntax.d.

Example

For UDM syntax, see the following implementation example:

See also

UDM syntax

in Univention Corporate Server - Manual for developers [3] for information about existing syntax types.

3.2.2.2. UDM hooks#

As a developer, you want to extend existing UDM modules with additional attributes and logic. If this scenario describes your customization case, then UDM hooks are for you.

You can use UDM hooks to inject custom business logic that UDM runs after UDM modified an extended attribute, and add consistency checks, safety fallbacks, or modification of additional objects. They’re Python classes and methods that extend existing UDM modules.

Before you can use UDM hooks, you must first define extended attributes to provide a kind of anchor to which to attach the UDM hook. An extended attribute provides a mapping between the input widget and the UDM attribute. UDM hooks add process or business logic to the extended attribute. You can define explicit logic for create, modify, and delete actions of a UDM object. The logic has access to the entire UDM object. In addition, UDM hooks can apply plausibility, consistency, and validity checks before saving the UDM object.

To add UDM hooks to Nubus for Kubernetes, use the following steps:

  1. Save the UDM hook in a Python file and give it a proper name with the extension .py.

  2. Follow the instructions for building the Docker image in Bundle extensions.

  3. Copy the plugin file to your extension project. For UDM hooks, the plugin-type is udm-hooks.d. See Add plugins.

    $ export PLUGIN_TYPE="udm-hooks.d"
    

Tip

The UDM HTTP REST API mounts your provided UDM hook to the following directory: /usr/lib/python3/dist-packages/univention/admin/hooks.d.

Example

For UDM hooks, see the following implementation example:

See also

Expansion of UMC modules with extended attributes

in Univention Corporate Server - Manual for users and administrators [4] for information about how to create extended attributes.

3.2.2.3. UDM handlers#

As a developer, you want to define a custom UDM object as a representation of a directory object (or several). If this scenario describes your customization case, then UDM handlers are for you.

A UDM handler defines a UDM object from one or more directory objects. It defines the following aspects:

  • Process or business logic.

  • The mapping to create a UDM object from directory objects.

  • The presentation layout for the Management UI.

You can use existing or custom UDM syntax to enhance your UDM handler.

To add UDM handlers to Nubus for Kubernetes, use the following steps:

  1. Save the UDM handler in a file and give it a proper name.

  2. Follow the instructions for building the Docker image in Bundle extensions.

  3. Copy the plugin file to your extension project. For UDM handlers, the plugin-type is udm-handlers. See Add plugins.

    $ export PLUGIN_TYPE="udm-handlers"
    

Tip

The UDM HTTP REST API mounts your provided UDM handler to the following directory: /usr/lib/python3/dist-packages/univention/admin/handlers.

Example

For UDM handlers, see the following implementation example:

See also

UDM modules

in Univention Corporate Server - Manual for developers [3] for information about the module structure.