-
Notifications
You must be signed in to change notification settings - Fork 34
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
Allow changing endpoint per user in the live chat #122
Comments
I don't think this would belong in the nautobot-plugin-chatops itself. There are no endpoints in this plugin. If other plugins implement endpoints, they could likely implement this themselves. I believe there are already examples of something similar to this in another plugin, let me see if I can find that. |
Thanks @smk4664 , it is a totally valid point. |
We had a sync with @smk4664 , considering the latest enhancements from Nautobot, and we could approach it creating a new model: chatops_endpoints:
- name: "my fancy endpoint"
slug: "my-fancy-endpoint"
url: "https:/...."
plugin: FK(nautobot-plugin)
secret: FK(secrets)
verify_ssl: True With this, you can create you endpoints, for multiple chatops plugins, and the in the chat, define the actual endtpoint with each chatops command. So |
Where would this be placed at? |
I got in touch with Core to understand if this idea (URL Endpoints) could be an extensibility option for Core. |
This is going to be put into a new Nautobot App to provide the Endpoints model, likely |
Proposed Functionality
Today, most of the chatops plugins define a custom endpoint in its configuration with some custom authentication configuration.
The idea would be that instead of solving only the multi-instance for one specific chatops, we could extend this
nautobot_chatops
configuration to support a new (optional)endpoints
(or similar) key with a list of multiple endpoints (with a reference name), so the user would be able to switch between them in execution time using his own session.For example:
This change obviously doesn’t affect the previous chatops (it’s backwards compatible), so from the custom chatops plugins we can choose to use these new endpoints that will exposed via a wrapper on the current sessions methods, not on the specific chatops which will only focus on using the new methods to retrieve the URL and the proper authentication.
This feature will expose two methods:
get_endpoint
andset_endpoint
, that will leverage on the user's session, to save the "active" endpoint.Use Case
As a user of a Chatops integration, I would like to easily change from one endpoint to another, affecting only this specific user context.
So, having several endpoints defined, a user can jump from one to another, so all the commands executed will refer to the "active" endpoint:
The text was updated successfully, but these errors were encountered: