-
Notifications
You must be signed in to change notification settings - Fork 12
added kics description #10
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d38a914
added kics description
AndreGCX f3c765b
preferences view changes
AndreGCX b168b8e
Merge branch 'master' into AST-6569_kics_description
AndreGCX 2605bdc
Merge branch 'master' into AST-6569_kics_description
AndreGCX d9ecaaf
changed javas wrapper
AndreGCX 2f1cd1e
Merge branch 'AST-6569_kics_description' of https://github.com/Checkm…
AndreGCX 301f382
wrapper jar
AndreGCX 0c2d9ba
corrected ui tests
AndreGCX d7ad7cf
added function to wait for connection resul in UITests
AndreGCX 1f4358a
correction
AndreGCX 9a7ee01
changes required on pr
AndreGCX e4fc630
Merge branch 'master' into AST-6569_kics_description
AndreGCX 90a49da
message change in authentication
AndreGCX 0fc3c41
fix conflits
AndreGCX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed
BIN
+12.5 MB
...lugin/lib/ast-cli-java-wrapper-1.0.18.jar → ...lugin/lib/ast-cli-java-wrapper-1.0.22.jar
Binary file not shown.
82 changes: 56 additions & 26 deletions
82
checkmarx-ast-eclipse-plugin/src/com/checkmarx/eclipse/properties/AuthButtonFieldEditor.java
This file contains hidden or 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 |
|---|---|---|
| @@ -1,41 +1,71 @@ | ||
| package com.checkmarx.eclipse.properties; | ||
|
|
||
| import org.eclipse.jface.dialogs.MessageDialog; | ||
| import java.util.concurrent.CompletableFuture; | ||
| import java.util.function.Consumer; | ||
|
|
||
| import org.eclipse.jface.preference.StringButtonFieldEditor; | ||
| import org.eclipse.jface.preference.StringFieldEditor; | ||
| import org.eclipse.swt.custom.CLabel; | ||
| import org.eclipse.swt.widgets.Composite; | ||
| import org.eclipse.swt.widgets.Display; | ||
|
|
||
| import com.checkmarx.eclipse.runner.Authenticator; | ||
| import com.checkmarx.eclipse.utils.CxLogger; | ||
| import com.checkmarx.eclipse.utils.PluginConstants; | ||
|
|
||
| public class AuthButtonFieldEditor extends StringButtonFieldEditor { | ||
|
|
||
| protected AuthButtonFieldEditor(String name, String labelText, | ||
| Composite parent) { | ||
| super(name, labelText, parent); | ||
| setChangeButtonText("Test Connection"); | ||
| Consumer<String> consumer; | ||
|
|
||
| } | ||
| private StringFieldEditor serverUrl; | ||
| private StringFieldEditor authUrl; | ||
| private StringFieldEditor tenant; | ||
| private StringFieldEditor apiKey; | ||
| private StringFieldEditor additionalParams; | ||
| private CLabel connectionLabel; | ||
|
|
||
| @Override | ||
| protected String changePressed() { | ||
| AuthButtonFieldEditor(String name, String labelText, Composite parent, StringFieldEditor serverUrl, | ||
| StringFieldEditor authUrl, StringFieldEditor tenant, StringFieldEditor apiKey, | ||
| StringFieldEditor additionalParams, CLabel connectionLabel) { | ||
| super(name, labelText, parent); | ||
| setChangeButtonText(labelText); | ||
| this.serverUrl = serverUrl; | ||
| this.authUrl = authUrl; | ||
| this.tenant = tenant; | ||
| this.apiKey = apiKey; | ||
| this.additionalParams = additionalParams; | ||
| this.connectionLabel = connectionLabel; | ||
| } | ||
|
|
||
| String result = Authenticator.INSTANCE.doAuthentication(); | ||
| if(!result.isEmpty()) | ||
| { | ||
| MessageDialog.openInformation(null, "Authentication", "Connection successfull !"); | ||
| } | ||
| else | ||
| { | ||
| MessageDialog.openInformation(null, "Authentication", "Please check your credentials!"); | ||
| @Override | ||
| protected String changePressed() { | ||
| connectionLabel.setText(PluginConstants.PREFERENCES_VALIDATING_STATE); | ||
|
|
||
| String serverUrl_str = serverUrl.getStringValue(); | ||
| String authUrl_str = authUrl.getStringValue(); | ||
| String tenant_str = tenant.getStringValue(); | ||
| String apiKey_str = apiKey.getStringValue(); | ||
| String additionalParams_str = additionalParams.getStringValue(); | ||
|
|
||
| CompletableFuture.supplyAsync(() -> { | ||
| try { | ||
| return Authenticator.INSTANCE.doAuthentication(serverUrl_str, authUrl_str, tenant_str, apiKey_str, | ||
| additionalParams_str); | ||
| } catch (Throwable t) { | ||
| CxLogger.error(PluginConstants.ERROR_AUTHENTICATING_AST, new Exception(t)); | ||
| return t.getMessage(); | ||
| } | ||
|
|
||
| return null; | ||
| } | ||
|
|
||
| public void emptyTextfield() { | ||
| setStringValue(""); | ||
| Preferences.store(Preferences.API_KEY, ""); | ||
| } | ||
|
|
||
|
|
||
| }).thenAccept((result) -> Display.getDefault().syncExec(() -> connectionLabel.setText(result))); | ||
|
|
||
| return null; | ||
| } | ||
|
|
||
| public void emptyTextfield() { | ||
| setStringValue(""); | ||
| Preferences.store("", ""); | ||
| } | ||
|
|
||
| void setValues() { | ||
| } | ||
|
|
||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.