Skip to content

Conversation

@kprince28
Copy link
Contributor

@kprince28 kprince28 commented Sep 9, 2025

🎟️ Jira Issue

πŸ› οΈ Type of Change

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Improvement (enhancements or optimizations to existing functionality)
  • Documentation update (changes or additions to documentation)
  • Release (preparing or deploying a new release)
  • Other (please specify):

🎯 Targeted Branch

  • I have confirmed that this PR targets the correct branch.
  • Target Branch: dev

πŸ§ͺ Testing

βœ… Test Coverage

  • I have added/updated tests that cover my changes.
  • This PR does not require tests (please explain):

πŸ“‹ Checklist

  • My code follows the project's coding standards.
  • I have performed a self-review of my own code.
  • I have commented my code where necessary.
  • I have linked all related Jira issues.
  • I have added necessary documentation (if applicable).
  • I have added or updated tests to cover my changes.
  • Any dependent changes have been merged and published in downstream modules.
  • I have reviewed the changes for security implications.
  • I have ensured that no sensitive information or secrets are exposed in this PR.

πŸ“Έ Screenshots (if applicable)

πŸ”— Related PRs

🧩 Additional Information

@abhi1693
Copy link
Contributor

I was unable to reproduce the bug on netbox v4.3.7 with the latest secrets package 2.3.2. So, I'm not sure if this fix is valid

@kprince28
Copy link
Contributor Author

I was unable to reproduce the bug on netbox v4.3.7 with the latest secrets package 2.3.2. So, I'm not sure if this fix is valid

I was able to reproduce this issue with Secrets v2.3.2. When a 1024-length key is entered in the form, it causes a break. I’ve resolved this by fixing the form’s post method

@prafullpandeyOneMind
Copy link
Contributor

I was unable to reproduce the bug on netbox v4.3.7 with the latest secrets package 2.3.2. So, I'm not sure if this fix is valid

On my End also, this bug is not reproducible @kprince28

@kprince28
Copy link
Contributor Author

I was unable to reproduce the bug on netbox v4.3.7 with the latest secrets package 2.3.2. So, I'm not sure if this fix is valid

On my End also, this bug is not reproducible @kprince28

Just try one thing, generate the 1024 length RSA key from somewhere and add that key in the userform manually and test the behaviour and let me know.

@prafullpandeyOneMind
Copy link
Contributor

I was unable to reproduce the bug on netbox v4.3.7 with the latest secrets package 2.3.2. So, I'm not sure if this fix is valid

On my End also, this bug is not reproducible @kprince28

Just try one thing, generate the 1024 length RSA key from somewhere and add that key in the userform manually and test the behaviour and let me know.

@kprince28 Yes, The error is reproducible only if we are pasting Publick Key (PEM) from outside, and this issue is fixed in this PR

Copilot AI review requested due to automatic review settings September 26, 2025 07:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes RSA key generation and forms in the netbox_secrets plugin by addressing template context issues and improving UserKey activation logic.

  • Updates template context to use standardized 'object' key instead of 'userkey'
  • Adds return URL handling to the UserKey form
  • Refines UserKey activation condition to prevent conflicts when Secrets already exist

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
netbox_secrets/views.py Updates template context with standardized object key and return URL
netbox_secrets/models/secrets.py Improves UserKey activation logic with additional Secret existence check

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kprince28 kprince28 requested a review from Copilot September 26, 2025 07:37
@kprince28
Copy link
Contributor Author

@codex

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Prince Kumar <[email protected]>
@kprince28 kprince28 linked an issue Sep 26, 2025 that may be closed by this pull request
@kprince28 kprince28 changed the title OMS-1050 Fixed RSA key generation and forms OMS-1050 Fixed UserKey form Sep 26, 2025
@oms-cicd-bot
Copy link

oms-cicd-bot bot commented Oct 3, 2025

Code Coverage

Package Line Rate Health
.home.runner._work.netbox-secrets.netbox-secrets.netbox_secrets.netbox_secrets 63% βœ”
.home.runner._work.netbox-secrets.netbox-secrets.netbox_secrets.netbox_secrets.api 48% ❌
.home.runner._work.netbox-secrets.netbox-secrets.netbox_secrets.netbox_secrets.forms 79% βœ”
.home.runner._work.netbox-secrets.netbox-secrets.netbox_secrets.netbox_secrets.graphql 98% βœ”
.home.runner._work.netbox-secrets.netbox-secrets.netbox_secrets.netbox_secrets.migrations 69% βœ”
.home.runner._work.netbox-secrets.netbox-secrets.netbox_secrets.netbox_secrets.models 45% ❌
.home.runner._work.netbox-secrets.netbox-secrets.netbox_secrets.netbox_secrets.tests 30% ❌
.home.runner._work.netbox-secrets.netbox-secrets.netbox_secrets.netbox_secrets.utils 55% βœ”
Summary 53% (865 / 1636) βœ”

Minimum allowed line rate is 50%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants