IIRC, the script plugin's resource key is the full path to the
script.
This is the code I'm talking about - from ScriptDiscoveryComponent:
---
DiscoveredResourceDetails details = new
DiscoveredResourceDetails(discoveryContext.getResourceType(), executable,
new File(executable).getName(), version, description,
pluginConfig, null);
---
That second argument to the details constructor ("executable") is the
key - and its the path to the script file as defined in the plugin
configuration. This is not unique if you want more than one resource
accessing the same script. you need to pass in a new resource key that
is unique, whatever "unique" is as per your custom requirements.