When a plugin is built for use with the Masking Engine, it is critical that certain metadata be included in the plugin JAR file. This includes certain attributes in the JAR's manifest, as well as the service discovery file used to determine which classes in the JAR are directly usable by the Extensibility Framework.
Java archives carry metadata attributes in the manifest file, located at META-INF/MANIFEST.MF in the archive file. Some of these attributes are required or at minimum quite useful in a plugin's manifest.
The following attributes carry special meaning to the extensibility framework when present in a plugin's manifest. Care must be taken to ensure they are set to valid and meaningful values for any plugins intended for production use. Additional attributes may be supported in the future. Any future attributes introduced for anything beyond a purely informational purpose will be of the format "Delphix-*" to avoid conflict with any preexisting usage.
Recognized Manifest Attributes¶
|Delphix-Plugin-Name||The default name of the plugin. This name will be used on the Masking Engine unless overridden at plugin install time. All plugin names beginning with the string "dlpx" are reserved for future use by modules delivered with the Delphix Masking Engine product.||SamplePlugin|
|Implementation-Vendor||The individual or organization that authored the plugin module.||Sample Inc.|
|Implementation-Version||The version of the plugin. This is an entirely free-form string, limited to 255 characters.||1.0.0-SNAPSHOT|
|Delphix-Algorithm-API-Version||The version of the Delphix Masking Plugin API used by the plugin. This value must be present and represent a valid API version.||1.0.0|
The maskScript init sub-command adds logic to the gradle build files to ensure that the project build inserts the correct attribute values into the plugin manifest.
Java service discovery is used to determine which classes in the plugin JAR present relevant functionality to the Delphix Masking Engine. When a plugin is loaded, the file com.delphix.masking.api.plugin.MaskingComponent under META-INF/services in the JAR is consulted for a list of classes that implement the MaskingComponent interface. As MaskingAlgorithm includes this interface, each algorithm in the plugin will be discovered this way. In the future, this mechanism may be expanded to support additional types of components beyond algorithms.
When the maskScript generate sub-command is used to create a new algorithm class, the service discovery metadata file is automatically updated.
If an algorithm class is missing from the services file, it will not be usable when the plugin is loaded. It is essentially invisible to the extensibility framework. If a class is mentioned in this file but not present in the JAR, the plugin will fail to load. There is a fallback during plugin loading that will scan the entire JAR for algorithms if the services file is not present. This fallback may be removed in the future and should not be relied on.