forked from tspence/csharp-searchlight
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added support for encrypted vlaue columns * update comments * pr suggestions * added tests for encrypted fields
- Loading branch information
1 parent
9a0e24c
commit 076fbd6
Showing
8 changed files
with
162 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Searchlight.Encryption | ||
{ | ||
/// <summary> | ||
/// An interface for encrypting strings prior to being used in a query filter. | ||
/// </summary> | ||
public interface ISearchlightStringEncryptor | ||
{ | ||
/// <summary> | ||
/// A method to encrypt a string using the same algorithm used to store the encrypted data. | ||
/// </summary> | ||
/// <param name="plainText"></param> | ||
/// <returns></returns> | ||
string Encrypt(string plainText); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma warning disable CS1591 | ||
namespace Searchlight.Exceptions | ||
{ | ||
/// <summary> | ||
/// The operation used in the filter on a given field is not supported. | ||
/// | ||
/// Example: `(someField gt 5)` where `someField` is an encrypted field. | ||
/// </summary> | ||
public class InvalidOperation : SearchlightException | ||
{ | ||
public string OriginalFilter { get; internal set; } | ||
|
||
public string FieldName { get; internal set; } | ||
|
||
public string Operation { get; internal set; } | ||
|
||
public string ErrorMessage | ||
{ | ||
get => | ||
$"The query filter, {OriginalFilter}, uses {Operation} on {FieldName} which is not supported."; | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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