{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "rndpwd config",
    "description": "JSON schema for rndpwd configuration",
    "type": "object",
    "properties": {
        "remoteConfigProvider": {
            "description": "Remote configuration source (if any)",
            "type": "string",
            "default": "",
            "enum": [
                "",
                "consul",
                "etcd"
            ]
        },
        "remoteConfigEndpoint": {
            "description": "Remote configuration URL (ip:port)",
            "type": "string",
            "default": ""
        },
        "remoteConfigPath": {
            "description": "Remote configuration path in which to search for the configuration file (e.g. '/config/rndpwd')",
            "type": "string",
            "default": ""
        },
        "remoteConfigSecretKeyring": {
            "description": "Path to the openpgp secret keyring used to decrypt the remote configuration data (e.g. '/etc/rndpwd/configkey.gpg'); if empty a non secure connection will be used instead",
            "type": "string",
            "default": ""
        },
        "log": {
            "description": "Logging settings",
            "type": "object",
            "properties": {
                "level": {
                    "description": "Defines the default log level",
                    "type": "string",
                    "default": "DEBUG",
                    "enum": [
                        "EMERGENCY",
                        "ALERT",
                        "CRITICAL",
                        "ERROR",
                        "WARNING",
                        "NOTICE",
                        "INFO",
                        "DEBUG"
                    ]
                },
                "network": {
                    "description": "(OPTIONAL) Network type used by the Syslog",
                    "type": "string",
                    "default": "",
                    "enum": [
                        "",
                        "udp",
                        "tcp"
                    ]
                },
                "address": {
                    "description": "(OPTIONAL) Network address of the Syslog daemon (ip:port) or just (:port)",
                    "type": "string",
                    "default": ""
                }
            },
            "additionalProperties": false,
            "required": [
                "level",
                "network",
                "address"
            ]
        },
        "stats": {
            "description": "StatsD is used to collect usage metrics",
            "type": "object",
            "properties": {
                "prefix": {
                    "description": "StatsD client's string prefix that will be used in every bucket name",
                    "type": "string",
                    "default": "rndpwd"
                },
                "network": {
                    "description": "Network type used by the StatsD client",
                    "type": "string",
                    "default": "udp",
                    "enum": [
                        "udp",
                        "tcp"
                    ]
                },
                "address": {
                    "description": "Network address of the StatsD daemon (ip:port) or just (:port)",
                    "type": "string",
                    "default": ":8125"
                },
                "flush_period": {
                    "description": "Sets how often (in milliseconds) the StatsD client's buffer is flushed. When 0 the buffer is only flushed when it is full",
                    "type": "integer",
                    "default": 100,
                    "minimum": 0,
                    "maximum": 1000
                }
            },
            "additionalProperties": false,
            "required": [
                "prefix",
                "network",
                "address",
                "flush_period"
            ]
        },
        "serverAddress": {
            "description": "Internal HTTP address (ip:port) or just (:port)",
            "type": "string",
            "default": ":8017"
        },
        "charset": {
            "description": "String containing the valid characters for a password",
            "type": "string",
            "default": "!#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ^_abcdefghijklmnopqrstuvwxyz~"
        },
        "length": {
            "description": "Length of each password (number of characters or bytes)",
            "type": "integer",
            "default": 32
        },
        "quantity": {
            "description": "Number of passwords to return",
            "type": "integer",
            "default": 10
        }
    },
    "additionalProperties": false,
    "required": [
        "log",
        "stats",
        "serverAddress",
        "charset",
        "length",
        "quantity"
    ]
}