-
Notifications
You must be signed in to change notification settings - Fork 22
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
Release: v0.2 #97
Merged
Merged
Release: v0.2 #97
Conversation
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
* Implemented Parameterizer interface and the frame for static and dynamic parameter * Renamed Parameter object attributes into clear naming way: LinkParameter - > LinkColumnParameter * Added DynamicModeSupport setting for Parameter object
* Added validation warnings for Driver * Implemented type overriding initialization inside Driver * Refactored logic of allowed type validation now it is not relying on initialized driver data * Added chain of inherited types with their name for custom types * Moved column type overriding to Column object itself * Implemented type checking helpers
* Added dynamic parameter tests
* Renamed old Parameter to ParameterDefinition * Renamed old Definition to TransformerDefinition
* Added dynamic parameters test * Refactored parameters init function * fixed error message now it looks clear
* Fixed parameter validation * Introduced TransformerContext that united parameters that were passed to transformer during initialization procedure and initialized transformer * Updated RandomDate transformer implementation, adapted to the dynamic parametrization * Fixed static and dynamic parameters initialization * Deprecated value-parameters methods in ParameterDefinition
* renamed InitParametersV2 to InitParameters * renamed parameter.go to parameter_definition.go
* Clean up code from deprecated attributes and methods in that were in ParameterDefinition * Fixed unit tests * Added attribute documentation for StaticParameter and DynamicParameter
* Adapted 3 transformers for dynamic parameters usage: * RandomDate * RandomInt * RandomFloat
* Implemented cast template logic * Implemented default logic behaviour
* Changed Parametrizer interface * Implemented common function for scanning static objects
* Moved a few files from internal to toolkit * Added to timeToUnix and unixToTime functions * Implemented template context object that allows to get the value or raw value for dynamic parameter and Encode/Decode it into destination type
* Introduced TypeCaster for casting original value to dest type * Implemented cast functions
* Fixed cast_to implementation * Removed auto cast for now. It might be implemented later
fix: Fixed required parameters validation
* Implemented abstract RandomFullName transformer * Implemented database specific RandomFullName * Transformer support dynamic mode in `gender` parameter * Covered with unit tests
wwoytenko
changed the title
Release/v0.2rc
Feat: Transformation core refactoring for v0.2
May 6, 2024
Closed
9 tasks
…/name_transformer
Refactored transformer implementation. Prepared for external DB usage
…/name_transformer
wwoytenko
changed the title
Feat: Transformation core refactoring for v0.2
Release: v0.2
May 8, 2024
Feat: RandomPerson transformer
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.
Pull request description
This PR contains changes in the greenmask core. This is a base of the next major version v0.2. The changes in this PR are a result of the 5 months of continuous development and close connection with greenmask users.
Changes overview
template
and pre-defined cast functions that can be provided viacast_to
. The cast_to functions represented the most on the frequent cast operations such asUnixTimestampToDate
,IntToBool
, etcrandom
- generates the transformer value based on pseudo-randomhash
- generates the transformer value based on hash functions. For now, it issha3
hash functions that have low performance but are secure. In the stable release, it is expected to have the option to choose betweensha3
andSipHash
Notable changes
Core
Parametrizer
interface and it has been implemented for dynamic and static parametersDriver
initialization logicDriver
for overridden typesParametrizer
interfaceTransformationContext
that is a first step towards new feature transformation conditions Feature: conditional transform #34Transformers
Email
- a new transformer that supports both random and deterministic engines. Generate email value in a flexible way. You can use the column values in the template for the generation of the email. At the same time, you have the option to keep the original domain or use any domain from thedomains
parameter.NoiseDate
,NoiseFloat
,NoiseInt
- Supports random and deterministic engines. Provides parameters with dynamic mode support that can control threshold values in themin
andmax
range. The old implementations have only oneratio
parameter and the noise can be generated between the values[0, ratio]
. In a new release we reviewed that logic and introduced two parametersmin_ratio
andmax_ratio
where the noise value will be in the range[min_ratio, max_ratio]
. By applying thehash
engine inNoise*
transformers we can complicate statistical analysis for the attacker when the same salt is used for the backups over a long period of time.NoiseNumeric
- implemented a new transformer that supports the same features as in theNoiseInt
andNoiseFloat
but is implemented to work only with numeric (huge int or float values). Since a Numeric value can be with a fraction the parameterprecision
is introduced.RandomChoice
- addedhash
engine supportRandomDate
,RandomFloat
,RandomInt
- added hash engine support. The threshold parametersmin
andmax
now supports dynamic mode.RandomInt
- implemented a new transformer that supports the same features as in theRandomInt
andRandomFloat
but is implemented to work only with numeric (huge int or float values).RandomString
- added hash engine mode supportRandomUnixTimestamp
- implemented a new transformer that generates Unix Timestamp with unitssec
,milli
,micro
,nano
. The logic is similar toRandomDate
. The transformer supports thehash
engine and dynamic parameters for themin
andmax
thresholds. The units formin
andmax
parameters can be overridden bymin_unit
andmax_unit
parameters.RandomUuid
- addedhash
engine supportRandomPerson
- implemented a new transformer instead ofRandomName
,RandomLastName
, *RandomFirstName
,RandomFirstNameMale
,RandomFirstNameFemale
,RandomTitileMale
andRandomTitileFemale
. This new transformer represents the same but highly customizable features that the previous versions. The transformer generates Personal data such asFirstName
,LastName
, andTitle
based on the providedgender
parameter. Thegender
parameter supportsdynamic
mode. In the next minor versions, we will provide the possibility to override the default names database.tsModify
template functionmin: '{{ now | tsModify "-30 years" | .EncodeValue }}' # 1994