def METHOD_NAME(self, project, name, value, actor=None):
    """
    ```
    if name == 'foo' and value != 'bar':
        raise PluginError('foo must be bar')
    return value
    ```
    """
    for config in self.get_config(project=project, user=actor):
        if config["name"] != name:
            continue
        if value is None:
            if config.get("required"):
                raise PluginError("Field is required")
            if config.get("type") == "secret":
                value = self.get_option(name, project)
            return value
        if isinstance(value, str):
            value = value.strip()
            # TODO(dcramer): probably should do something with default
            # validations here, though many things will end up bring string
            # based
            if not value:
                if config.get("required"):
                    raise PluginError("Field is required")
                if config.get("type") == "secret":
                    value = self.get_option(name, project)
        for validator in DEFAULT_VALIDATORS.get(config["type"], ()):
            value = validator(project=project, value=value, actor=actor)
        for validator in config.get("validators", ()):
            value = validator(value, project=project, actor=actor)
        return value
    return value