Skip to content

feat/CUS-10969-Added SHA-256 hash generator - #349

Merged
akhil-testsigma merged 1 commit into
devfrom
feat/CUS-10969-Added-SHA-256-hash-generator
Mar 2, 2026
Merged

akhil-testsigma merged 1 commit into
devfrom
feat/CUS-10969-Added-SHA-256-hash-generator

Conversation

@akhil-testsigma

@akhil-testsigma akhil-testsigma commented Feb 27, 2026 •

Copy link
Copy Markdown
Contributor

Publish this addon as PUBLIC

Addon Name: SHA-256 Hash Generator
Jarvis Link: https://jarvis.testsigma.com/ui/tenants/2817/addons
Jira : https://testsigma.atlassian.net/browse/CUS-10969
Added SHA-256 hash generator

Summary by CodeRabbit

Release Notes

  • New Features
    • Added SHA-256 hash generation action across Android, iOS, Mobile Web, REST API, Web, and Windows platforms. The action computes SHA-256 hashes for input strings and stores results as runtime variables for test automation.

@coderabbitai

coderabbitai Bot commented Feb 27, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

A new Testsigma addon module for SHA-256 hash generation is introduced, supporting multiple application types (Android, iOS, mobile web, REST API, web, and Windows) with corresponding Maven build configuration and SDK properties.

Changes

Cohort / File(s) Summary
Maven Project Configuration
sha-256_hash_generator/pom.xml
Establishes Maven project structure with coordinates (com.testsigma.addons:sha-256_hash_generator:1.0.0), Java 11 build settings, and dependencies including testsigma-java-sdk, Lombok, JUnit 5, TestNG, Selenium, Appium, Jackson, and Apache Commons Lang. Configures Maven Shade and Source plugins.
SHA-256 Action Implementations
sha-256_hash_generator/src/main/java/com/testsigma/addons/android/..., ios/..., mobileweb/..., restapi/..., web/..., windows/...
Six platform-specific action classes implementing SHA-256 hash computation. Each extends the appropriate base action (AndroidAction, IOSAction, WebAction, RestApiAction, WindowsAction), accepts input-string and variable-name test data, computes SHA-256 hash, stores result in runtime data, and includes error handling with logging.
SDK Configuration
sha-256_hash_generator/src/main/resources/testsigma-sdk.properties
Contains testsigma-sdk.api.key with JWT token for SDK authentication.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • Ganesh-Testsigma
  • vigneshtestsigma

Poem

🐰 A hash for every platform, hops from web to win,
SHA-256 spins its cryptic yarn, where test actions begin,
From Android to REST, each addon's nest, no detail left thin,
The rabbit's gift of hashing swift, let automation's dawn spin! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding a SHA-256 hash generator addon, which aligns with all file additions and the PR objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/CUS-10969-Added-SHA-256-hash-generator

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
sha-256_hash_generator/src/main/java/com/testsigma/addons/mobileweb/GenerateSHA256Hash.java (1)

32-63: Extract shared SHA-256 flow into a common utility/base helper.

This execute logic is duplicated across multiple platform classes. Centralizing digest/hex/runtime-write logic will reduce drift and future bug fixes to one place.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@sha-256_hash_generator/src/main/java/com/testsigma/addons/mobileweb/GenerateSHA256Hash.java`
around lines 32 - 63, Extract the SHA-256 digest and runtime-write logic from
GenerateSHA256Hash.execute into a reusable helper (e.g., class Sha256Helper with
methods generateHex(String) and storeAsRuntimeVariable(String hex, String
varName, RunTimeData runTimeData)); replace the in-method
MessageDigest/hexString loop and the runTimeData.setValue/setKey calls in
GenerateSHA256Hash.execute with calls to these helper methods (keep logging and
exception handling in execute but delegate digesting and variable storage to the
helper) so other platform classes can call the same helper to eliminate
duplicated code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@sha-256_hash_generator/src/main/java/com/testsigma/addons/mobileweb/GenerateSHA256Hash.java`:
- Around line 38-39: The code in GenerateSHA256Hash is logging sensitive values
(originalText and the computed hashes); remove or redact any logger calls that
print originalText, generatedHash, or similar variables and replace them with
non-sensitive operational messages (e.g., log only success/failure and a
non-sensitive identifier such as a key or request ID). Locate logger.info
invocations in GenerateSHA256Hash that reference originalText, generatedHash, or
hashedValue and change them to generic messages like "SHA256 generation
succeeded for key: <keyId>" or log only exceptions/errors without revealing the
plaintext or hash.

In `@sha-256_hash_generator/src/main/resources/testsigma-sdk.properties`:
- Line 1: The file contains a hardcoded secret value for the property
testsigma-sdk.api.key; remove this committed API key immediately from the file
and git history, rotate/revoke the exposed key with the provider, and replace
the literal with a runtime-secret lookup (e.g., read testsigma-sdk.api.key from
environment or a secrets manager in your configuration/bootstrap code). After
rotating the key, scrub the repository history (git filter-repo / BFG) or remove
the commit and force-push, update CI/deployment to inject the secret securely,
and ensure testsigma-sdk.properties no longer contains any plaintext secret.

---

Nitpick comments:
In
`@sha-256_hash_generator/src/main/java/com/testsigma/addons/mobileweb/GenerateSHA256Hash.java`:
- Around line 32-63: Extract the SHA-256 digest and runtime-write logic from
GenerateSHA256Hash.execute into a reusable helper (e.g., class Sha256Helper with
methods generateHex(String) and storeAsRuntimeVariable(String hex, String
varName, RunTimeData runTimeData)); replace the in-method
MessageDigest/hexString loop and the runTimeData.setValue/setKey calls in
GenerateSHA256Hash.execute with calls to these helper methods (keep logging and
exception handling in execute but delegate digesting and variable storage to the
helper) so other platform classes can call the same helper to eliminate
duplicated code.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c253bb2 and 5e37e65.

📒 Files selected for processing (8)
  • sha-256_hash_generator/pom.xml
  • sha-256_hash_generator/src/main/java/com/testsigma/addons/android/GenerateSHA256Hash.java
  • sha-256_hash_generator/src/main/java/com/testsigma/addons/ios/GenerateSHA256Hash.java
  • sha-256_hash_generator/src/main/java/com/testsigma/addons/mobileweb/GenerateSHA256Hash.java
  • sha-256_hash_generator/src/main/java/com/testsigma/addons/restapi/GenerateSHA256Hash.java
  • sha-256_hash_generator/src/main/java/com/testsigma/addons/web/GenerateSHA256Hash.java
  • sha-256_hash_generator/src/main/java/com/testsigma/addons/windows/GenerateSHA256Hash.java
  • sha-256_hash_generator/src/main/resources/testsigma-sdk.properties

Comment on lines +38 to +39
logger.info("Original text is: " + originalText);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Do not log plaintext input or generated hash values.

Line 38 logs raw input; Lines 50 and 55 expose derived hash values. This can leak sensitive data in logs/reports. Keep only non-sensitive operational logs (e.g., success/failure, variable key only).

Also applies to: 50-55

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@sha-256_hash_generator/src/main/java/com/testsigma/addons/mobileweb/GenerateSHA256Hash.java`
around lines 38 - 39, The code in GenerateSHA256Hash is logging sensitive values
(originalText and the computed hashes); remove or redact any logger calls that
print originalText, generatedHash, or similar variables and replace them with
non-sensitive operational messages (e.g., log only success/failure and a
non-sensitive identifier such as a key or request ID). Locate logger.info
invocations in GenerateSHA256Hash that reference originalText, generatedHash, or
hashedValue and change them to generic messages like "SHA256 generation
succeeded for key: <keyId>" or log only exceptions/errors without revealing the
plaintext or hash.

@@ -0,0 +1 @@
testsigma-sdk.api.key=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMjMyMmM2Ni04NWYzLWIyN2UtN2FiOS0zM2U2M2Q4OWM1MGIiLCJ1bmlxdWVJZCI6IjYwMDkiLCJpZGVudGl0eUFjY291bnRVVUlkIjoiMzUifQ.pFlgZ1lCeHGOn8-F4tUnnto8khVAvO1AmVYVGCpnUxkD3SW5fgQNYt00psO72nDdDKB16scbb3XXGBArg5GnnQ No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Remove committed API key from source control immediately.

A live-looking SDK key is hardcoded on Line 1. This is a direct secret exposure risk, especially for a public addon. Rotate/revoke this key, remove it from git history, and inject it via secure secret management at runtime/CI.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sha-256_hash_generator/src/main/resources/testsigma-sdk.properties` at line
1, The file contains a hardcoded secret value for the property
testsigma-sdk.api.key; remove this committed API key immediately from the file
and git history, rotate/revoke the exposed key with the provider, and replace
the literal with a runtime-secret lookup (e.g., read testsigma-sdk.api.key from
environment or a secrets manager in your configuration/bootstrap code). After
rotating the key, scrub the repository history (git filter-repo / BFG) or remove
the commit and force-push, update CI/deployment to inject the secret securely,
and ensure testsigma-sdk.properties no longer contains any plaintext secret.

@akhil-testsigma
akhil-testsigma merged commit b7baa58 into dev Mar 2, 2026
2 checks passed
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