Skip to content

ITEP-87923: Validate user password and username API fields#1335

Merged
saratpoluri merged 7 commits into
mainfrom
fix/ITEP-87923-validate-user-api-fields
May 1, 2026
Merged

ITEP-87923: Validate user password and username API fields#1335
saratpoluri merged 7 commits into
mainfrom
fix/ITEP-87923-validate-user-api-fields

Conversation

@daddo-intel
Copy link
Copy Markdown
Contributor

📝 Description

Small change to serializer.py to validate password and username API fields for user

✨ Type of Change

Select the type of change your PR introduces:

  • 🐞 Bug fix – Non-breaking change which fixes an issue
  • 🚀 New feature – Non-breaking change which adds functionality
  • 🔨 Refactor – Non-breaking change which refactors the code base
  • 💥 Breaking change – Changes that break existing functionality
  • 📚 Documentation update
  • 🔒 Security update
  • 🧪 Tests
  • 🚂 CI

🧪 Testing Scenarios

Describe how the changes were tested and how reviewers can test them too:

  • ✅ Tested manually
  • 🤖 Ran automated end-to-end tests

✅ Checklist

Before submitting the PR, ensure the following:

  • 🔍 PR title is clear and descriptive
  • 📝 For internal contributors: If applicable, include the JIRA ticket number (e.g., ITEP-123456) in the PR title. Do not include full URLs
  • 💬 I have commented my code, especially in hard-to-understand areas
  • 📄 I have made corresponding changes to the documentation
  • ✅ I have added tests that prove my fix is effective or my feature works

@daddo-intel daddo-intel requested a review from sbelhaik April 27, 2026 18:29
@daddo-intel daddo-intel added the bug Something isn't working label Apr 27, 2026
@sbelhaik
Copy link
Copy Markdown
Contributor

@daddo-intel The user can be created with invalid scene uid

@ltalarcz ltalarcz enabled auto-merge (squash) April 28, 2026 19:39
@ltalarcz ltalarcz disabled auto-merge April 28, 2026 19:41
@daddo-intel
Copy link
Copy Markdown
Contributor Author

@daddo-intel The user can be created with invalid scene uid

Not sure I understand this comment

@sbelhaik
Copy link
Copy Markdown
Contributor

@daddo-intel The user can be created with invalid scene uid

Not sure I understand this comment

The user definition in spec includes scene property, however, when creating a user with username, password and scene, it ignores scene field and creates user without validating whether the provided scene is valid.

Copy link
Copy Markdown
Contributor

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

Adds object-level validation to the Manager service’s UserSerializer to enforce username/password presence on user creation and prevent blank values when those fields are updated.

Changes:

  • Add UserSerializer.validate() to require username and password on create.
  • Add update-time checks to reject blank username / password when those keys are provided in the request.

Comment thread manager/src/manager/serializers.py
Comment thread manager/src/manager/serializers.py Outdated
Comment thread manager/src/manager/serializers.py
@daddo-intel
Copy link
Copy Markdown
Contributor Author

@daddo-intel The user can be created with invalid scene uid

Not sure I understand this comment

The user definition in spec includes scene property, however, when creating a user with username, password and scene, it ignores scene field and creates user without validating whether the provided scene is valid.

The scene field is not needed when creating a user. Will update the spec

@saratpoluri saratpoluri enabled auto-merge (squash) May 1, 2026 00:45
@saratpoluri saratpoluri added the auto-update Keep branch up to date with base label May 1, 2026
@scenescapecicd scenescapecicd removed the auto-update Keep branch up to date with base label May 1, 2026
@saratpoluri saratpoluri merged commit 86eec27 into main May 1, 2026
36 of 37 checks passed
@saratpoluri saratpoluri deleted the fix/ITEP-87923-validate-user-api-fields branch May 1, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants