clj/kom2

Suggestion: Config identifier

matmair opened this issue · 4 comments

It would be great if one could define an optional config identifier to the connection string. That could then be passed to the InvenTree API as a header and be used server side to identify which host is using which config. Would be usedfull to detect outdated configs.

clj commented

That could definitely be a thing. I'm assuming that the plugin you wrote would have to check this value? would the ODBC driver not then have to hit a specific API as opposed to a header when fetching some other data like parts, or categories?

Is this just to be able to report on the InvenTree side what hosts are using outdated configs? I don't think we'll be able to display anything meaningful to the user on the KiCad side of things (short of a fatal error from the ODBC driver).

@clj I think adding the info into the request headers of all API requests would be the easiest solution. We can listen for those headers pretty easily in Django.
I would only use it for reporting on InvenTree, alerting is not really something that should be handled by a database driver.

clj commented

Could you provide a concrete example of how you think this should look? E.g. header name and value? I mean I guess the value can be fairly opaque to the driver: a value passed in the connection string that is just supplied to inventree.

@clj I am imagining a header INVENTREE-CONIFG-IDENTIFIER - anything passed in the DSN as the kwarg identifier or null - that is passed with every request, the rest can be handled on InvenTree's side.