Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProvisionWatcher support regex for blockingIdentifiers #1111

Open
ajcasagrande opened this issue Mar 21, 2022 · 0 comments
Open

ProvisionWatcher support regex for blockingIdentifiers #1111

ajcasagrande opened this issue Mar 21, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ajcasagrande
Copy link
Contributor

🚀 Feature Request

Description [REQUIRED]

Currently, Provision Watchers support regex matching for identifiers, but not for blockingIdentifiers.

In edgexfoundry-holding/device-onvif-camera, an example would be to create a provision watcher for any ONVIF device that is unknown. The idea would be to match any ONVIF camera without a Manufacturer attribute.

"provisionwatcher":{
   "apiVersion":"v2",
   "name":"Provision-Watcher-Unknown",
   "adminState":"UNLOCKED",
   "identifiers":{
      "Address": "."
   },
   "blockingIdentifiers":{
      "Manufacturer": [ ".+" ]
   },
   "serviceName": "device-onvif-camera",
   "profileName": "onvif-camera"
}

Describe the solution you'd like

Unfortunately because it is already implemented using pure string matches, switching to regex could cause unintended side-effects. One option is to use a function that implements exact regex match (versus substring match) (ie. equivalent to ^regex$).

Another option would be to make it an explicit extra field, like so:

 "regexBlockingIdentifiers":{
    "Manufacturer": "."
 },

Describe alternatives you've considered

Create a provision watcher that blocks all Manufacturer values that are already defined in other provision watchers. This is harder to keep track of, as it would need to be updated on a per-install basis based on the other registered provision watchers.

"provisionwatcher":{
   "apiVersion":"v2",
   "name":"Provision-Watcher-Unknown",
   "adminState":"UNLOCKED",
   "identifiers":{
      "Address": "."
   },
   "blockingIdentifiers":{
      "Manufacturer": [ "HIKVISION", "Tapo", "GeoVision", ... ]
   },
   "serviceName": "device-onvif-camera",
   "profileName": "onvif-camera"
}
@ajcasagrande ajcasagrande added the enhancement New feature or request label Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant