Skip to content

Commit

Permalink
move reorganizer to mapper
Browse files Browse the repository at this point in the history
Signed-off-by: Hugo Queinnec <hugo.queinnec@ibm.com>
  • Loading branch information
hugoqnc committed Aug 23, 2024
1 parent db4dbed commit dce027c
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
package com.ibm.plugin.translation.reorganizer;

import com.ibm.mapper.reorganizer.IReorganizerRule;
import com.ibm.plugin.translation.reorganizer.rules.AeadBlockCipherReorganizer;
import com.ibm.plugin.translation.reorganizer.rules.AsymmetricBlockCipherReorganizer;
import com.ibm.plugin.translation.reorganizer.rules.BlockCipherReorganizer;
import com.ibm.plugin.translation.reorganizer.rules.CipherParameterReorganizer;
import com.ibm.plugin.translation.reorganizer.rules.MacReorganizer;
import com.ibm.plugin.translation.reorganizer.rules.SignerReorganizer;
import com.ibm.mapper.reorganizer.rules.AeadBlockCipherReorganizer;
import com.ibm.mapper.reorganizer.rules.AsymmetricBlockCipherReorganizer;
import com.ibm.mapper.reorganizer.rules.BlockCipherReorganizer;
import com.ibm.mapper.reorganizer.rules.CipherParameterReorganizer;
import com.ibm.mapper.reorganizer.rules.MacReorganizer;
import com.ibm.mapper.reorganizer.rules.SignerReorganizer;
import java.util.List;
import java.util.stream.Stream;
import javax.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ibm.plugin.translation.reorganizer;
package com.ibm.mapper.reorganizer;

import com.ibm.mapper.model.INode;
import com.ibm.mapper.utils.Function3;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.NotNull;

/**
* This class contains public static {@code Function3} implementing usual reorganization actions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ibm.plugin.translation.reorganizer.rules;
package com.ibm.mapper.reorganizer.rules;

import com.ibm.mapper.model.Algorithm;
import com.ibm.mapper.model.AuthenticatedEncryption;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ibm.plugin.translation.reorganizer.rules;
package com.ibm.mapper.reorganizer.rules;

import com.ibm.mapper.ITranslator;
import com.ibm.mapper.model.BlockCipher;
import com.ibm.mapper.model.DigestSize;
import com.ibm.mapper.model.INode;
Expand All @@ -27,7 +28,6 @@
import com.ibm.mapper.model.padding.OAEP;
import com.ibm.mapper.reorganizer.IReorganizerRule;
import com.ibm.mapper.reorganizer.builder.ReorganizerRuleBuilder;
import com.ibm.plugin.translation.translator.JavaTranslator;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -45,7 +45,7 @@ private AsymmetricBlockCipherReorganizer() {
new ReorganizerRuleBuilder()
.createReorganizerRule()
.forNodeKind(PublicKeyEncryption.class)
.forNodeValue(JavaTranslator.UNKNOWN)
.forNodeValue(ITranslator.UNKNOWN)
.includingChildren(
List.of(
new ReorganizerRuleBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ibm.plugin.translation.reorganizer.rules;
package com.ibm.mapper.reorganizer.rules;

import com.ibm.mapper.model.Algorithm;
import com.ibm.mapper.model.BlockCipher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ibm.plugin.translation.reorganizer.rules;
package com.ibm.mapper.reorganizer.rules;

import com.ibm.mapper.model.INode;
import com.ibm.mapper.model.KeyLength;
import com.ibm.mapper.model.TagLength;
import com.ibm.mapper.model.functionality.Decrypt;
import com.ibm.mapper.model.functionality.Encrypt;
import com.ibm.mapper.reorganizer.IReorganizerRule;
import com.ibm.mapper.reorganizer.UsualPerformActions;
import com.ibm.mapper.reorganizer.builder.ReorganizerRuleBuilder;
import com.ibm.plugin.translation.reorganizer.UsualPerformActions;
import java.util.List;
import javax.annotation.Nonnull;
import org.jetbrains.annotations.Unmodifiable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ibm.plugin.translation.reorganizer.rules;
package com.ibm.mapper.reorganizer.rules;

import com.ibm.mapper.model.BlockCipher;
import com.ibm.mapper.model.BlockSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ibm.plugin.translation.reorganizer.rules;
package com.ibm.mapper.reorganizer.rules;

import com.ibm.mapper.reorganizer.IReorganizerRule;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*/
package com.ibm.plugin.rules.detection.asymmetric.DSA;

import static org.assertj.core.api.Assertions.assertThat;

import com.ibm.engine.detection.DetectionStore;
import com.ibm.engine.model.CipherAction;
import com.ibm.engine.model.IValue;
Expand All @@ -38,18 +40,15 @@
import com.ibm.mapper.model.functionality.KeyGeneration;
import com.ibm.mapper.model.functionality.Sign;
import com.ibm.plugin.TestBase;
import java.util.List;
import javax.annotation.Nonnull;
import org.junit.Test;
import org.sonar.plugins.python.api.PythonCheck;
import org.sonar.plugins.python.api.PythonVisitorContext;
import org.sonar.plugins.python.api.symbols.Symbol;
import org.sonar.plugins.python.api.tree.Tree;
import org.sonar.python.checks.utils.PythonCheckVerifier;

import javax.annotation.Nonnull;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;

public class PycaDSASignTest extends TestBase {

@Test
Expand Down

0 comments on commit dce027c

Please sign in to comment.