Use a 10Duke Scale Local License Server in Test Mode

Before delivering a Local License Server to your customers, you can test your licensed applications using the Local License Server test mode.

Running a Local License Server in test mode

The specification for running the Local License Server using a Docker Compose file.

The archive provided by 10Duke contains a default Docker Compose file implementation. The file is called docker-compose.yaml and is located in the root of the archive.

Configuration for the Local License Server is given by adding a file called license-server.conf into the container path /opt/tenduke/config/license-server.conf.

Test mode start and stop commands:

  • To start the stack in test mode:

    docker compose up --build

  • To stop the stack in test mode:

    docker compose down --volumes

Configuration of a Local License Server for test mode

When the Local License Server is started and running without activation, it will operate in test mode. The test mode enables use of the Local License Server in, for example, CI pipelines where the licensed application is tested. Many limitations compared to production use will be applied.

The configuration objects always_succeed and always_fail are predefined options that define built-in behavior. For example, a product SuperCalculator inside the always_succeed object will yield a successful checkout for every request a client application makes using that product name.

In the event of duplicates in always_succeed and always_fail, the priority is on always_fail. A warning is logged if duplicates are found.

Configuration keys and reserved keywords

Keyword / configuration key Description
always_fail Configures products that yield license checkout failures.
always_succeed Configures products that yield license checkout success.
products Configures names of licensed products and defines product to feature mapping.
* (asterisk) Used to denote a wild card for product names. For example, when used in always_succeed for a product name, a request to check out a license will work for any product name.

Configuration examples

All checkouts succeed: minimal configuration:

{
    "always_succeed": {
        "products":[
            "*": [
                "feature-1",
                "feature-2"
            ]
        ]
    }
}

All named product checkouts succeed: minimal configuration:

{
    "always_succeed": {
        "products":{
            "ThreeDee": [
                "feature-1",
                "feature-2"
            ],
            "MagicPro": [
                "feature-1",
                "feature-2"
            ]
        },
        "errorCode":"noLicenseFound",
        "errorDescription":"No matching license was found"
    }
}

The always_succeed error response is used in the case that the caller attempts a checkout with a product name that is not listed.

All checkouts fail: minimal configuration:

{
    "always_fail": {
        "products":{
            "ThreeDee": [
                "feature-1"
            ]
        },
        "errorCode":"insufficientQuantity",
        "errorDescription":"No capacity left on license: fake (SEATS)"
    }
}

Full configuration example:

{
    "always_succeed": {
        "products": {
            "ThreeDee": [
                "feature-1",
                "feature-2"
            ],
        },
        "errorCode":"noLicenseFound",
        "errorDescription":"No matching license was found"
    },
    "always_fail": {
        "products": {
            "MagicPro": [
                "feature-1",
                "feature-2"
            ]
        },
        "errorCode": "insufficientQuantity",
        "errorDescription": "No capacity left on license: fake (SEATS)"
    }
}

Further information

10Duke Scale API documentation that applies to the Local License Server test mode: