Updated readme to reflect host_tuple to subject refactoring

This commit is contained in:
Daniel Dayley 2019-12-17 13:00:14 -07:00
parent 5c6a299ffd
commit 872191515b

16
README
View File

@ -69,9 +69,9 @@ class ServiceDelegate(ServiceBase) :
# Example return: [ '-nm', '--name', 'store_true', "Return the name of the subject" ]
pass
def perform_lookup(self,host_tuple) :
"""Given a host_tuple, return a dictionary or array of information about the subject."""
# Example return: {'name' : host_tuple[0] ]
def perform_lookup(self,subject) :
"""Given a subject, return a dictionary or array of information about the subject."""
# Example return: {'name' : subject ]
pass
```
@ -79,12 +79,8 @@ class ServiceDelegate(ServiceBase) :
The function `get_arguments` is called when your plugin is loaded to verify that the plugin should be run,
based on the arguments the user supplied. Plugins are loaded whenever the script is run.
The function `perform_lookup` is called for every subject the user submits. DNS resolution is attempted
by IFXLookup automatically for convenience, and the resulting socket triple `host_tuple` is provided.
host_tuple is a triple (hostname, aliaslist, ipaddrlist) where hostname is the subject name or primary host
name responding to the given ip_address, aliaslist is a (possibly empty) list of alternative host names for
the same address, and ipaddrlist is a list of IPv4 addresses for the same interface on the same host (usually
but not always a single address)
The function `perform_lookup` is called for every subject the user submits. The subjects are passed in as
raw strings.
Within the `perform_lookup` function, you should perform any lookups on the host and return a dictionary or
array of information about the subject. To make sure that the results are serializable, be sure that
@ -129,7 +125,7 @@ want to introduce a custom dispatching method, such as using a new thread for ea
this method.
If you just want to access the array of hosts that the user submitted, you can get it by getting
`self.namespace.subjects`. For the list of `host_tuples`, `self._subjects` is available.
`self.namespace.subjects`. For the list of `subjects`, `self._subjects` is available.
## Contributing