JSON Configuration

Recommended: Use XML Configuration

{  
    "configs": [
        "handler.json",
        "limit.json",
        "handlerChain.json",
        "paths.json"
    ]
}

Configure Handlers

{
    "handler": [
        {
        "id": "test",
        "class": "com.example.simpleauthtest.handler.MyHandler",
        "scope": "singleton",
        "pathsId":"test"
        },
        {
        "id": "myHandlerId2",
        "class": "com.example.simpleauthtest.handler.MyHandler",
        "scope": "singleton",
        "paths": {
            "id": "myHandlerPath2",
            "path": [
            "/say",
            "/eat"
            ]
        }
        }
    ]
}

Configure Limits

{
    "limit": [
        {
        "id": "limitId",
        "times": 1,
        "seconds": 2,
        "ban": 3,
        "pathsId": "myLimitPath"
        }
    ]
}

Configure HandlerChain

{
    "handlerChain": [
        {
        "id": "myHandlerChain",
        "list": [
            {
            "id": "test"
            },
            {
            "class": "com.example.simpleauthtest.handler.MyHandler"
            }
        ],
        "paths": {
            "id": "myPath"
        }
        },
        {
        "id": "myHandlerChain2",
        "list": [
            {
            "id": "test"
            },
            {
            "class": "com.example.simpleauthtest.handler.MyHandler"
            }
        ],
        "paths": {
            "id": "myPath"
        }
        }
    ]
}

Configure Paths

{
    "paths": [
        {
        "id": "myLimitPath",
        "path": [
            "/say",
            "/eat",
            "/sleep"
        ]
        },
        {
        "id": "myPath",
        "path": [
            "/say",
            "/eat",
            "/sleep"
        ]
        }
    ]
}