Skip to content

Commit

Permalink
Merge pull request #32482 from appsmithorg/release
Browse files Browse the repository at this point in the history
08/04 Daily Promotion
  • Loading branch information
trishaanand authored Apr 8, 2024
2 parents 4b2554a + 08ef7ad commit f62952a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 26 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/caddy-routes-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Caddy routes test
name: Caddy route tests

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * MON"

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Test, build and push Docker Image

run-name: >
${{ github.workflow }} with TED:${{ inputs.ted_tag }}
${{ github.workflow }} with TED:${{ inputs.ted_tag || 'latest' }}
on:
# This workflow will run everyday at 7:00AM, 1:00PM IST on weekdays
Expand Down
20 changes: 2 additions & 18 deletions app/client/src/sagas/ActionExecution/PluginActionSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1213,15 +1213,7 @@ function* executePageLoadAction(
data: payload,
}),
);
yield put(
updateActionData([
{
entityName: action.name,
dataPath: "data",
data: payload.body,
},
]),
);

PerformanceTracker.stopAsyncTracking(
PerformanceTransactionName.EXECUTE_ACTION,
{
Expand Down Expand Up @@ -1276,15 +1268,7 @@ function* executePageLoadAction(
undefined,
pageAction.id,
);
yield put(
updateActionData([
{
entityName: action.name,
dataPath: "data",
data: payload.body,
},
]),
);

yield take(ReduxActionTypes.SET_EVALUATED_TREE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.appsmith.external.models.Property;
import com.appsmith.external.models.SSLDetails;
import com.external.plugins.exceptions.MongoPluginErrorMessages;
import org.springframework.util.LinkedCaseInsensitiveMap;
import org.springframework.util.StringUtils;

import java.util.ArrayList;
Expand Down Expand Up @@ -131,23 +132,23 @@ public static String buildURIFromExtractedInfo(Map extractedInfo, String passwor
}

private static String buildURITail(String tailInfo) {
Map<String, String> optionsMap = new HashMap<>();

// case-insensitive match and preserves order of keys, hence the params ordering in the url remains unchanged
Map<String, String> optionsMap = new LinkedCaseInsensitiveMap<>();
for (final String part : tailInfo.split("[&;]")) {
if (part.isEmpty()) {
continue;
}
int idx = part.indexOf('=');
if (idx >= 0) {
String key = part.substring(0, idx).toLowerCase();
String key = part.substring(0, idx);
String value = part.substring(idx + 1);
optionsMap.put(key, value);
} else {
optionsMap.put(part.toLowerCase(), "");
optionsMap.put(part, "");
}
}
optionsMap.putIfAbsent("authsource", "admin");
optionsMap.put("minpoolsize", "0");
optionsMap.putIfAbsent("minpoolsize", "0");
return optionsMap.entrySet().stream()
.map(entry -> {
if (StringUtils.hasLength(entry.getValue())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,22 @@ public void testBuildClientURI_withoutUserInfoAndAuthSource() {
public void testBuildClientURI_withUserInfoAndAuthSource() {

final String testUri = "mongodb://user:pass@host:port/db?param&authSource=notAdmin";
final String resultUri = "mongodb://user:newPass@host:port/db?param&authsource=notAdmin&minpoolsize=0";
final String resultUri = "mongodb://user:newPass@host:port/db?param&authSource=notAdmin&minpoolsize=0";

DatasourceConfiguration datasourceConfiguration = new DatasourceConfiguration();
final DBAuth dbAuth = new DBAuth();
dbAuth.setPassword("newPass");
datasourceConfiguration.setAuthentication(dbAuth);
datasourceConfiguration.setProperties(List.of(new Property("0", "Yes"), new Property("1", testUri)));
final String clientURI = buildClientURI(datasourceConfiguration);
assertEquals(resultUri, clientURI);
}

@Test
public void testBuildClientURI_withUpperCaseCharacters_CaseRemainsUnchanged() {

final String testUri = "mongodb://user:pass@host:port/db?Param&authSource=notAdmin";
final String resultUri = "mongodb://user:newPass@host:port/db?Param&authSource=notAdmin&minpoolsize=0";

DatasourceConfiguration datasourceConfiguration = new DatasourceConfiguration();
final DBAuth dbAuth = new DBAuth();
Expand Down

0 comments on commit f62952a

Please sign in to comment.