[
https://issues.apache.org/jira/browse/NIFIREG-190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16574917#comment-16574917
]
ASF GitHub Bot commented on NIFIREG-190:
----------------------------------------
Github user kevdoran commented on a diff in the pull request:
https://github.com/apache/nifi-registry/pull/133#discussion_r208953844
--- Diff: nifi-registry-docs/src/main/asciidoc/administration-guide.adoc ---
@@ -1094,3 +1094,63 @@ Here is the data model version histories:
|2|0.2|JSON formatted text file. The root object contains header and Flow
content object.
|1|0.1|Binary format having header bytes at the beginning followed by Flow
content represented as XML.
|====
+
+== Event Hooks
+Event hooks are an integration point that allows for custom code to to be
triggered when NiFi Registry application events occur.
+
+[options="header,footer"]
+|==================================================================================================================================================
+| Event Name | Description
+|`CREATE_BUCKET` | A new registry bucket is created.
+|`CREATE_FLOW` | A new flow is created in a specified bucket. Only
triggered on first time creation of a flow with a given name.
+|`CREATE_FLOW_VERSION` | A new version for a flow has been saved in the
registry.
+|`UPDATE_BUCKET` | A bucket has been updated.
+|`UPDATE_FLOW` | A flow that exist in a bucket has been updated.
+|`DELETE_BUCKET` | An existing bucket in the registry is deleted.
+|`DELETE_FLOW` | An existing flow in the registry is deleted.
+|==================================================================================================================================================
+
+=== Shared Event Hook Properties
+There are certain properties that are shared amongst all of the NiFi
Registry provided Event Hook implementations. Those properties and
+their purpose are listed below.
+
+[options="header,footer"]
+|==================================================================================================================================================
+| Property Name | Description
+|`Event Whitelist` | A comma separated list of events the the hook
provider configured with this property should respond to. If this property is
left blank or not provided all events will fire for the configured hook
provider.
+|==================================================================================================================================================
+
+=== ScriptEventHookProvider
+Hook provider for invoking a shell script that has been written by a user
and placed on a file system that is accessible
+by the NiFi Registry instance that the provider is configured for.
+
+....
+<eventHookProvider>
+ <class>
+ org.apache.nifi.registry.provider.hook.ScriptEventHookProvider
+ </class>
+ <property name="Script Path"></property>
+ <property name="Working Directory"></property>
+ <!-- optional -->
+ <property name="Event Whitelist">CREATE_FLOW,UPDATE_FLOW</property>
--- End diff --
Comma-separated lists in XML is inconsistent with how we handle configuring
lists in other contexts. For example, the initial user identities in
Authorizers.xml:
```
<!--
The FileUserGroupProvider will provide support for managing users
and groups which is backed by a file
on the local file system.
- Users File - The file where the FileUserGroupProvider will store
users and groups.
- Initial User Identity [unique key] - The identity of a users and
systems to seed the Users File. The name of
each property must be unique, for example: "Initial User
Identity A", "Initial User Identity B",
"Initial User Identity C" or "Initial User Identity 1",
"Initial User Identity 2", "Initial User Identity 3"
NOTE: Any identity mapping rules specified in
nifi-registry.properties will also be applied to the user identities,
so the values should be the unmapped identities (i.e. full DN
from a certificate).
-->
<userGroupProvider>
<identifier>file-user-group-provider</identifier>
<class>org.apache.nifi.registry.security.authorization.file.FileUserGroupProvider</class>
<property name="Users File">./conf/users.xml</property>
<property name="Initial User Identity 1"></property>
</userGroupProvider>
```
We may want to reconsider in order to keep this consistent....
> Support for Event Whitelisting in the Registry Event Hooks
> ----------------------------------------------------------
>
> Key: NIFIREG-190
> URL: https://issues.apache.org/jira/browse/NIFIREG-190
> Project: NiFi Registry
> Issue Type: New Feature
> Affects Versions: 0.2.0
> Reporter: Jeremy Dyer
> Assignee: Jeremy Dyer
> Priority: Major
> Fix For: 0.3.0
>
>
> Today when an event hook is configured it will be invoked for all of the NiFi
> Registry events. While a user can parse the arguments in the script and
> manually write scripts which ignore certain events it makes more sense to
> provide this event whitelisting the the registry itself.
> I propose adding a new property called something like "Event Whitelist" to
> the current configuration logic. If this property is not present things
> should continue to operate just as they do now, AKA the script is sent all of
> the events, if the property is specified it should contain a comma delimited
> list of events that the hook provider should be triggered for.
> This will be extremely useful when providers that do not provider any sort of
> filtering logic like the script hook provider come along.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)