-
Couldn't load subscription status.
- Fork 12
feat: implement OAuth2 authentication and permissions #86
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
Merged
Parent:
feat: diode data plugin 1.0 rc
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…x Plugin - Added DiodeOAuth2Authentication class for handling OAuth2 token validation. - Introduced IsDiodeOAuth2Authenticated permission class to check OAuth2 authentication. - Updated GenerateDiffView and ApplyChangeSetView to use the new authentication and permission classes. Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
…s files Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
ltucker
approved these changes
Apr 21, 2025
- authentication with OAuth2 instead of API keys - squashed and removed old redundant migrations - removed redundant setup step Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
- remove unused imports Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
…lugin - Updated DiodeOAuth2Authentication to set user, token scopes, and token data on the request. - Introduced HasScope permission class to enforce required OAuth2 token scopes. - Refactored views to utilize IsAuthenticated and require_scopes for permission checks. - Adjusted unit tests to mock the updated authentication behavior. Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
jajeffries
approved these changes
Apr 23, 2025
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant updates to the NetBox Diode plugin, including a major version upgrade, removal of deprecated features, and the addition of OAuth2-based authentication and permissions. These changes aim to streamline the plugin's configuration, improve security, and modernize its codebase.
Major Version Upgrade and Compatibility Updates:
4.2.3and set the plugin release to1.0.0. This reflects the new major version and ensures compatibility with the latest NetBox features. (README.md[1]netbox-plugin.yaml[2]Configuration Simplifications:
auto_provision_usersfeature and associated user-specific configurations (diode_to_netbox_username,netbox_to_diode_username). Simplified the configuration to use a singlediode_usernamefor plugin-applied changes. (README.md[1]docker/netbox/plugins_dev.py[2]netbox_diode_plugin/__init__.py[3]Security Enhancements:
DiodeOAuth2Authenticationclass, enabling token introspection and caching for secure API access. (netbox_diode_plugin/api/authentication.pynetbox_diode_plugin/api/authentication.pyR1-R82)SCOPE_NETBOX_READ,SCOPE_NETBOX_WRITE) for fine-grained access control. (netbox_diode_plugin/api/permissions.py[1]netbox_diode_plugin/api/views.py[2]Codebase Modernization:
netbox_diode_plugin/__init__.pynetbox_diode_plugin/init.pyL2-R2,netbox_diode_plugin/api/*.py)get_valid_entity_keys. (netbox_diode_plugin/api/views.py[1] [2]Deprecation of API Key Management:
README.md[1]docker/netbox/env/netbox.env[2]