Skip to content

Conversation

@GeekInTheNorth
Copy link
Owner

No description provided.

Copy link
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

This PR implements secure token hashing for Opal tokens in the database using PBKDF2 with SHA256. Previously, tokens were stored in plain text, which posed a significant security risk.

  • Introduces a token hashing service using PBKDF2-SHA256 with 100,000 iterations
  • Replaces plain text token storage with hashed tokens and display tokens
  • Updates authentication flow to verify tokens against hashes instead of plain text comparison

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
TokenModel.cs Adds CreatedDate property for salt generation
TokenHashService.cs New service implementing secure PBKDF2 token hashing
ITokenHashService.cs Interface for token hashing operations
OpalTokenEntity.cs Replaces Token field with TokenHash, DisplayToken, and TokenSalt fields
OpalTokenRepository.cs Updates to hash tokens on save and verify via GetByToken method
OpalTokenController.cs Adds validation and error handling improvements
OpalAuthorizationAttribute.cs Updates to use GetByToken method for hash-based verification
RobotsServiceExtensions.cs Registers TokenHashService in DI container
TokenHashServiceTests.cs Comprehensive unit tests for hashing service
OpalTokenControllerTests.cs Removes obsolete token obfuscation tests
OpalAuthorizationAttributeTests.cs Updates tests to work with new hashing approach

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

@GeekInTheNorth GeekInTheNorth merged commit 668a25e into develop Sep 16, 2025
2 checks passed
@GeekInTheNorth GeekInTheNorth deleted the feature/hash_opal_tokens branch September 16, 2025 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants