Authentication Extension

Expansion Description

Parameter validation extension point.

Extension ports

org.apache.dubbo.validation.Validation

Extended configuration

<dubbo:service validation="xxx,yyy" />
<!-- The default value setting, when <dubbo:service> does not configure the authentication attribute, use this configuration -->
<dubbo:provider validation="xxx,yyy" />

Known extensions

org.apache.dubbo.validation.support.jvalidation.JValidation

Extended example

Maven project structure:

src
 |-main
    |-java
        |-com
            |-xxx
                |-XxxValidation.java (implement Validation interface)
    |-resources
        |-META-INF
            |-dubbo
                |-org.apache.dubbo.validation.Validation (plain text file, content: xxx=com.xxx.XxxValidation)

XxxValidation.java:

package com.xxx;
 
import org.apache.dubbo.validation.Validation;
 
public class XxxValidation implements Validation {
    public Object getValidator(URL url) {
        //...
    }
}

XxxValidator.java:

package com.xxx;
 
import org.apache.dubbo.validation.Validator;
 
public class XxxValidator implements Validator {
    public XxxValidator(URL url) {
        //...
    }
    public void validate(Invocation invocation) throws Exception {
        //...
    }
}

META-INF/dubbo/org.apache.dubbo.validation.Validation:

xxx=com.xxx.XxxValidation
Last modified January 2, 2023: Enhance en docs (#1798) (95a9f4f6c1c)