-
Notifications
You must be signed in to change notification settings - Fork 1.9k
This PR adds models Java client APIs for CouchBase and adds tests for 2 queries #21082
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
Changes from 1 commit
b22077c
fd78c94
15ee88e
cb34160
1e1fb43
4c8058d
0464e64
dda042f
89f0e79
d335f03
4b7662f
29f23ee
9efefa6
5cef037
f71b6c1
9f725f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| extensions: | ||
| - addsTo: | ||
| pack: codeql/java-all | ||
| extensible: sinkModel | ||
| data: | ||
| - ["com.couchbase.client.core.env", "CertificateAuthenticator", true, "fromKey", "(PrivateKey,String,List)", "", "Argument[0]", "credentials-key", "manual"] | ||
| - ["com.couchbase.client.core.env", "CertificateAuthenticator", true, "fromKey", "(PrivateKey,String,List)", "", "Argument[1]", "credentials-password", "manual"] | ||
| - ["com.couchbase.client.core.env", "CertificateAuthenticator", true, "fromKeyStore", "(Path,String,Optional<String>)", "", "Argument[1]", "credentials-password", "manual"] | ||
| - ["com.couchbase.client.core.env", "CertificateAuthenticator", true, "fromKeyStore", "(KeyStore,String)", "", "Argument[1]", "credentials-password", "manual"] | ||
| - ["com.couchbase.client.core.env", "PasswordAuthenticator$Builder", true, "username", "(String)", "", "Argument[0]", "credentials-username", "manual"] | ||
| - ["com.couchbase.client.core.env", "PasswordAuthenticator$Builder", true, "username", "(Supplier<String>)", "", "Argument[0]", "credentials-username", "manual"] | ||
mbaluda marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - ["com.couchbase.client.core.env", "PasswordAuthenticator$Builder", true, "password", "(String)", "", "Argument[0]", "credentials-password", "manual"] | ||
mbaluda marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| extensions: | ||
| - addsTo: | ||
| pack: codeql/java-all | ||
| extensible: sinkModel | ||
| data: | ||
| - ["com.couchbase.client.java","ClusterOptions",true,"clusterOptions","(String,String)","","Argument[0]","credentials-username","manual"] | ||
| - ["com.couchbase.client.java","ClusterOptions",true,"clusterOptions","(String,String)","","Argument[1]","credentials-password","manual"] | ||
| - ["com.couchbase.client.java","Cluster",true,"connect","(String,String,String)","","Argument[1]","credentials-username","manual"] | ||
| - ["com.couchbase.client.java","Cluster",true,"connect","(String,String,String)","","Argument[2]","credentials-password","manual"] |
mbaluda marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import static com.couchbase.client.java.ClusterOptions.clusterOptions; | ||
|
|
||
| import com.couchbase.client.core.env.Authenticator; | ||
| import com.couchbase.client.core.env.CertificateAuthenticator; | ||
| import com.couchbase.client.core.env.PasswordAuthenticator; | ||
| import com.couchbase.client.java.Cluster; | ||
|
|
||
| public class HardcodedCouchBaseCredentials { | ||
| public static void test() { | ||
| Cluster cluster1 = | ||
| Cluster.connect( | ||
| "127.0.0.1", | ||
| "Administrator", // $ HardcodedCredentialsApiCall $ HardcodedCredentialsSourceCall | ||
| "password"); // $ HardcodedCredentialsApiCall $ HardcodedCredentialsSourceCall | ||
| Cluster cluster2 = | ||
| Cluster.connect( | ||
| "127.0.0.1", | ||
| clusterOptions( | ||
| "Administrator", // $ HardcodedCredentialsApiCall $ HardcodedCredentialsSourceCall | ||
| "password")); // $ HardcodedCredentialsApiCall $ HardcodedCredentialsSourceCall | ||
| PasswordAuthenticator authenticator1 = | ||
| PasswordAuthenticator.builder() | ||
| .username( | ||
| "Administrator") // $ HardcodedCredentialsApiCall $ HardcodedCredentialsSourceCall | ||
| .password("password") // $ HardcodedCredentialsApiCall $ HardcodedCredentialsSourceCall | ||
| .onlyEnablePlainSaslMechanism() | ||
| .build(); | ||
|
|
||
| Authenticator authenticator2 = | ||
| CertificateAuthenticator.fromKeyStore( | ||
| null, | ||
| "keyStorePassword"); // $ HardcodedCredentialsApiCall | ||
| Cluster cluster = Cluster.connect("127.0.0.1", clusterOptions(authenticator2)); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| // semmle-extractor-options: --javac-args -cp ${testdir}/../../../../../stubs/amazon-aws-sdk-1.11.700:${testdir}/../../../../../stubs/azure-sdk-for-java:${testdir}/../../../../../stubs/shiro-core-1.4.0:${testdir}/../../../../../stubs/jsch-0.1.55:${testdir}/../../../../../stubs/ganymed-ssh-2-260:${testdir}/../../../../../stubs/apache-mina-sshd-2.8.0:${testdir}/../../../../../stubs/sshj-0.33.0:${testdir}/../../../../../stubs/j2ssh-1.5.5:${testdir}/../../../../../stubs/trilead-ssh2-212:${testdir}/../../../../../stubs/apache-commons-net-3.8.0:${testdir}/../../../../../stubs/mongodbClient:${testdir}/../../../../../stubs/mssql-jdbc-12.2.0:${testdir}/../../../../../stubs/auth0-jwt-2.3 | ||
| // semmle-extractor-options: --javac-args -cp ${testdir}/../../../../../stubs/amazon-aws-sdk-1.11.700:${testdir}/../../../../../stubs/azure-sdk-for-java:${testdir}/../../../../../stubs/shiro-core-1.4.0:${testdir}/../../../../../stubs/jsch-0.1.55:${testdir}/../../../../../stubs/ganymed-ssh-2-260:${testdir}/../../../../../stubs/apache-mina-sshd-2.8.0:${testdir}/../../../../../stubs/sshj-0.33.0:${testdir}/../../../../../stubs/j2ssh-1.5.5:${testdir}/../../../../../stubs/trilead-ssh2-212:${testdir}/../../../../../stubs/apache-commons-net-3.8.0:${testdir}/../../../../../stubs/mongodbClient:${testdir}/../../../../../stubs/couchbaseClient:${testdir}/../../../../../stubs/mssql-jdbc-12.2.0:${testdir}/../../../../../stubs/auth0-jwt-2.3 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.