-
Notifications
You must be signed in to change notification settings - Fork 16
[CUS-10144] ADDED existing NLP to salesforce application type. #307
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
base: dev
Are you sure you want to change the base?
Conversation
|
|
📝 WalkthroughWalkthroughA new Maven module adds the Google Authenticator code generator addon for Testsigma, consisting of a POM configuration file and a Java class that generates time-based one-time passwords (TOTP) from a provided secret key and stores the result in a runtime variable. Changes
Sequence DiagramsequenceDiagram
participant Client as Test Runner
participant Action as GoogleAuthCodeGenerator
participant OTP as Aerogear OTP Library
participant Runtime as Runtime Variable Storage
Client->>Action: execute(secret: "...")
activate Action
Action->>OTP: new Totp(secret)
activate OTP
OTP-->>Action: Totp instance
deactivate OTP
Action->>OTP: now()
activate OTP
OTP-->>Action: generated TOTP code
deactivate OTP
Action->>Runtime: setTestData(totp_code)
activate Runtime
Runtime-->>Action: acknowledged
deactivate Runtime
Action-->>Client: Result.success("TOTP generated")
deactivate Action
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@Google` Authenticator code
generator/src/main/java/com/testsigma/addons/salesforce/GoogleAuthCodeGenerator.java:
- Line 37: The debug log call logs a sensitive Totp object
(otpGenerator.toString()), potentially exposing secret keys; remove or replace
the logger.debug(otpGenerator.toString()) call in GoogleAuthCodeGenerator and
instead log a non-sensitive indication (e.g., success/flow state) or
masked/hashed identifier if you need correlation, ensuring you never call
toString() on the Totp/otpGenerator object or print any secret material.
- Around line 33-51: The method in GoogleAuthCodeGenerator initializes
com.testsigma.sdk.Result result = com.testsigma.sdk.Result.SUCCESS but never
changes it on error; update the catch block to set result =
com.testsigma.sdk.Result.FAILED (or Result.FAILED) before returning so failures
are reported correctly, and keep returning the result variable at the end of the
method.
🧹 Nitpick comments (4)
Google Authenticator code generator/src/main/java/com/testsigma/addons/salesforce/GoogleAuthCodeGenerator.java (2)
11-11: Unused import.
NoSuchElementExceptionis imported but never used. Theexecute()method declares it in the throws clause, but no code actually throws this exception.Suggested fix
-import org.openqa.selenium.NoSuchElementException;And update the method signature:
- public com.testsigma.sdk.Result execute() throws NoSuchElementException { + public com.testsigma.sdk.Result execute() {
45-48: Improve error logging consistency.The catch block uses
logger.debugfor the error message butlogger.infofor the stack trace. For error scenarios, consider using consistent log levels. Also, concatenatingerror.getMessage() + error.getCause()can produce confusing output (e.g.,"some message" + null).Suggested improvement
} catch (Exception error) { - logger.debug(error.getMessage() + error.getCause()); - logger.info("stack trace : " + ExceptionUtils.getStackTrace(error)); + logger.error("TOTP generation failed: {}", error.getMessage()); + logger.debug("Stack trace: {}", ExceptionUtils.getStackTrace(error)); setErrorMessage("Operation Failed.Please check the logs for more info");Google Authenticator code generator/pom.xml (2)
42-46: TestNG version is outdated.TestNG 6.14.3 is from 2018. Consider upgrading to a more recent version (7.x) for better compatibility and bug fixes.
Suggested update
<dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> - <version>6.14.3</version> + <version>7.8.0</version> + <scope>test</scope> </dependency>
36-46: Both JUnit 5 and TestNG are included as test dependencies.The POM includes both JUnit Jupiter and TestNG. If only one testing framework is actually used, consider removing the unused one to reduce dependency footprint. Also note that TestNG is missing the
<scope>test</scope>declaration.
please review this addon and publish as PUBLIC
Addon name : Google Authenticator code generator
Addon accont: https://jarvis.testsigma.com/ui/tenants/2817/addons
Jira: https://testsigma.atlassian.net/browse/CUS-10144
fix
Added existing NLP to salesforce application type.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.