Skip to content
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

chore: Move to Postgres #35346

Draft
wants to merge 955 commits into
base: release
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
955 commits
Select commit Hold shift + click to select a range
46415de
Merge branch 'release' into pg
Sep 18, 2024
d0c310b
remove mongo migration
AnaghHegde Sep 18, 2024
f22787a
Merge branch 'release' into pg
Sep 18, 2024
87ec629
Revert "fix null values"
AnaghHegde Sep 19, 2024
6f2d6fa
Merge branch 'release' into pg
Sep 19, 2024
69fcedf
fix tests
AnaghHegde Sep 19, 2024
66d1780
Merge branch 'release' into pg
Sep 19, 2024
0130491
add config for aop failures
AnaghHegde Sep 19, 2024
9743688
Merge branch 'release' into pg
Sep 19, 2024
ecb520d
Merge branch 'release' into pg
Sep 19, 2024
fd62dc5
Merge branch 'release' into pg
Sep 19, 2024
73d6315
Merge pull request #36354 from appsmithorg/fix/serilisation-null-values
AnaghHegde Sep 19, 2024
e105307
Merge branch 'release' into pg
Sep 19, 2024
d6aace7
Merge branch 'release' into pg
Sep 19, 2024
7f36140
Merge branch 'release' into pg
Sep 19, 2024
a366472
Merge branch 'release' into pg
Sep 19, 2024
b7d7332
chore: Merge release
abhvsn Sep 19, 2024
14b5ca7
Merge branch 'release' into pg
Sep 19, 2024
078d39a
fix: Server artifact location after release image is made adaptive
abhvsn Sep 19, 2024
24ca629
Merge branch 'pg' of github.com:appsmithorg/appsmith into pg
abhvsn Sep 19, 2024
809aeb4
Merge branch 'release' of github.com:appsmithorg/appsmith into pg
abhvsn Sep 19, 2024
cdf6a50
Merge branch 'release' of github.com:appsmithorg/appsmith into pg
AnaghHegde Sep 20, 2024
40086ef
spotless fix
AnaghHegde Sep 20, 2024
becff15
Merge branch 'release' into pg
Sep 20, 2024
cb75f49
Merge branch 'release' into pg
Sep 20, 2024
52b149b
Merge branch 'release' into pg
Sep 20, 2024
34f5cb4
Merge branch 'release' into pg
Sep 23, 2024
4eac52c
Merge branch 'release' into pg
Sep 23, 2024
63599a5
Merge branch 'release' into pg
Sep 23, 2024
5c35c29
Merge branch 'release' into pg
Sep 23, 2024
1a06761
Merge branch 'release' into pg
Sep 23, 2024
a4222d6
Merge branch 'release' into pg
Sep 23, 2024
a96efab
Merge branch 'release' into pg
Sep 23, 2024
c93f144
Merge branch 'release' into pg
Sep 24, 2024
8e734fd
Merge branch 'release' into pg
Sep 24, 2024
23616e5
for datasource storage migrate the class to key type for pg
AnaghHegde Sep 24, 2024
51d92eb
Create a new bounded scheduler for all the db ops
AnaghHegde Sep 25, 2024
177a50f
Merge branch 'release' of github.com:appsmithorg/appsmith into pg
AnaghHegde Sep 25, 2024
e51c71b
chore: Merge release
abhvsn Sep 27, 2024
663d9be
Merge branch 'release' into pg
Sep 27, 2024
6ccbe3b
Merge branch 'release' into pg
Sep 27, 2024
b433a0a
Merge branch 'release' into pg
Sep 27, 2024
ea41e37
Merge branch 'release' into pg
Sep 27, 2024
72c799c
Merge branch 'release' into pg
Sep 27, 2024
80bfdc7
Merge branch 'release' into pg
Sep 30, 2024
4d9c691
Merge branch 'release' of github.com:appsmithorg/appsmith into pg
abhvsn Sep 30, 2024
db68173
Merge branch 'release' into pg
Sep 30, 2024
c77ad23
Merge branch 'release' into pg
Sep 30, 2024
5aa648f
Merge branch 'release' into pg
Sep 30, 2024
fb6af84
Merge branch 'release' into pg
Sep 30, 2024
146c163
Merge branch 'release' into pg
Sep 30, 2024
bd6a1d3
Merge branch 'release' into pg
Sep 30, 2024
e3c4cd0
chore: fix for CVE-2024-1597⁠ for postgres build (#36615)
abhvsn Sep 30, 2024
aa74d83
chore: Merge release
abhvsn Oct 2, 2024
1f1fe30
fix: Build failure
abhvsn Oct 2, 2024
128832e
Merge branch 'release' into pg
Oct 2, 2024
f6f5e45
Merge branch 'release' into pg
Oct 2, 2024
06e41b7
Merge branch 'release' into pg
Oct 2, 2024
c17d168
Merge branch 'release' into pg
Oct 2, 2024
27e0aef
Merge branch 'release' into pg
Oct 2, 2024
96cea51
Merge branch 'release' into pg
Oct 2, 2024
bca1521
chore: Fix flyway upgrade error
abhvsn Oct 2, 2024
259e1b8
chore: Fix hypersistence dependency
abhvsn Oct 2, 2024
14f4c6b
chore: Fix test failures
abhvsn Oct 2, 2024
90547d2
Merge branch 'pg' of github.com:appsmithorg/appsmith into pg
abhvsn Oct 2, 2024
07d22ca
chore: Add specific priviledges on appsmith user
abhvsn Oct 2, 2024
95548d1
Merge branch 'release' into pg
Oct 2, 2024
3ee0197
Merge branch 'release' into pg
Oct 2, 2024
616002f
Merge branch 'release' into pg
Oct 3, 2024
7a7de4b
Merge branch 'release' into pg
Oct 3, 2024
3c814bc
Merge branch 'pg' of github.com:appsmithorg/appsmith into pg
AnaghHegde Oct 3, 2024
2b7e9ad
Merge branch 'release' into pg
Oct 3, 2024
d55327e
Merge branch 'release' into pg
Oct 3, 2024
75c7493
Merge branch 'release' into pg
Oct 3, 2024
8879b51
Merge branch 'release' into pg
Oct 3, 2024
248c9ef
Merge branch 'release' into pg
Oct 4, 2024
c6a4525
Merge branch 'release' of github.com:appsmithorg/appsmith into pg
abhvsn Oct 4, 2024
bf40729
chore: Remove duplicate grant assignment
abhvsn Oct 4, 2024
a5a0e13
Merge branch 'release' into pg
Oct 4, 2024
9343015
Merge branch 'release' into pg
Oct 4, 2024
a636d12
Merge branch 'release' into pg
Oct 5, 2024
4738bf9
chore: Merge release
abhvsn Oct 7, 2024
76e578c
Merge branch 'release' into pg
Oct 7, 2024
644a95e
Merge branch 'release' into pg
Oct 7, 2024
b81ad39
Merge branch 'release' into pg
Oct 7, 2024
9e2bb9b
Merge branch 'release' into pg
Oct 7, 2024
167786d
Merge branch 'release' into pg
Oct 7, 2024
676c7d3
Merge branch 'release' into pg
Oct 7, 2024
b3ed867
Merge branch 'release' into pg
Oct 7, 2024
3157585
Merge branch 'release' into pg
Oct 8, 2024
e1a2565
fix: Clean-up stage in server tests (#36730)
abhvsn Oct 8, 2024
eb6c8e9
Merge branch 'release' into pg
Oct 8, 2024
74fcbfd
add GIN index for the permission group
AnaghHegde Oct 8, 2024
618e768
Merge branch 'pg' of github.com:appsmithorg/appsmith into pg
AnaghHegde Oct 8, 2024
7c9938d
Merge branch 'release' into pg
Oct 9, 2024
f7d36ab
Merge branch 'release' into pg
Oct 9, 2024
ba4df44
Merge branch 'release' into pg
Oct 9, 2024
e009867
Merge branch 'release' into pg
Oct 9, 2024
416f1f7
Merge branch 'release' into pg
Oct 9, 2024
7289998
Merge branch 'release' into pg
Oct 9, 2024
d74e322
Merge branch 'release' into pg
Oct 9, 2024
da7ba1a
Merge branch 'release' into pg
Oct 9, 2024
94894d6
Merge branch 'release' into pg
Oct 9, 2024
f97f7e2
Merge branch 'release' into pg
Oct 9, 2024
efdf600
Merge branch 'release' into pg
Oct 9, 2024
51808ff
Merge branch 'release' into pg
Oct 9, 2024
5e1a610
Merge branch 'release' into pg
Oct 9, 2024
1a624d1
Merge branch 'release' into pg
Oct 9, 2024
93ad280
Merge branch 'release' into pg
Oct 10, 2024
438e115
Merge branch 'release' into pg
Oct 10, 2024
e05212d
Merge branch 'release' into pg
Oct 10, 2024
2b6a77b
Merge branch 'release' into pg
Oct 10, 2024
8839636
Merge branch 'release' into pg
Oct 10, 2024
d983248
Merge branch 'release' into pg
Oct 10, 2024
b3717c0
Merge branch 'release' into pg
Oct 10, 2024
f134160
Merge branch 'release' into pg
Oct 10, 2024
4e7c614
Merge branch 'release' into pg
Oct 10, 2024
0683171
Merge branch 'release' into pg
Oct 11, 2024
c1fb810
Merge branch 'release' into pg
Oct 11, 2024
38f8250
Merge branch 'release' into pg
Oct 11, 2024
0e06825
Merge branch 'release' into pg
Oct 14, 2024
5ce6f13
Merge branch 'release' into pg
Oct 14, 2024
1b81db8
Merge branch 'release' of github.com:appsmithorg/appsmith into pg
AnaghHegde Oct 14, 2024
2d37fd3
Merge branch 'release' into pg
Oct 14, 2024
59c9cb7
chore: Merge release
abhvsn Oct 14, 2024
f1a8b08
Merge branch 'release' into pg
Oct 14, 2024
4226680
chore: Add cleanup stage for refactor setvice test
abhvsn Oct 15, 2024
92d6c29
Merge branch 'release' into pg
Oct 15, 2024
29589c5
Merge branch 'release' into pg
Oct 15, 2024
e18647e
Merge branch 'release' into pg
Oct 16, 2024
a8acfae
Merge branch 'release' into pg
Oct 16, 2024
5a2f2f7
Merge branch 'release' into pg
Oct 16, 2024
65dc937
Merge branch 'release' into pg
Oct 16, 2024
6f42001
Merge branch 'release' into pg
Oct 16, 2024
c0f11cc
Merge branch 'release' into pg
Oct 16, 2024
70d96e6
Merge branch 'release' into pg
Oct 16, 2024
fd39f77
Merge branch 'release' into pg
Oct 16, 2024
5791e96
Merge branch 'release' into pg
Oct 16, 2024
549245d
Merge branch 'release' into pg
Oct 16, 2024
09e5fdc
Merge branch 'release' into pg
Oct 16, 2024
7bc63b4
Merge branch 'release' into pg
Oct 17, 2024
253b502
Merge branch 'release' into pg
Oct 17, 2024
d872658
Merge branch 'release' into pg
Oct 17, 2024
75f162f
Merge branch 'release' into pg
Oct 17, 2024
99b80b5
Merge branch 'release' into pg
Oct 17, 2024
0228764
Merge branch 'release' into pg
Oct 17, 2024
0007cb8
Merge branch 'release' into pg
Oct 17, 2024
d8d7710
Merge branch 'release' into pg
Oct 17, 2024
4015f28
Merge branch 'release' into pg
Oct 17, 2024
04092c9
Merge branch 'release' into pg
Oct 17, 2024
ac0cb96
Merge branch 'release' into pg
Oct 17, 2024
cb10b3a
Merge branch 'release' into pg
Oct 17, 2024
5c2cb30
Merge branch 'release' into pg
Oct 18, 2024
1640c48
Merge branch 'release' into pg
Oct 18, 2024
bb9b91b
Merge branch 'release' into pg
Oct 18, 2024
0176f3d
Merge branch 'release' into pg
Oct 18, 2024
df4b7e1
Merge branch 'release' into pg
Oct 18, 2024
ec1f111
Merge branch 'release' into pg
Oct 18, 2024
8a544d9
Merge branch 'release' into pg
Oct 18, 2024
4b0592a
Merge branch 'release' into pg
Oct 20, 2024
b1c6139
Merge branch 'release' into pg
Oct 21, 2024
bb7f454
chore: Dynamic class based projections for nested fields in jsonb col…
abhvsn Oct 22, 2024
2cf8944
chore: Keep NoArgsConstructor for RecentlyUsedEntityDTO
abhvsn Oct 22, 2024
ff92788
Merge branch 'release' into pg
Oct 22, 2024
536cad7
Merge branch 'release' into pg
Oct 22, 2024
1d7bc14
Merge branch 'release' into pg
Oct 22, 2024
b515e93
Merge branch 'release' into pg
Oct 22, 2024
a35d9c1
Merge branch 'release' into pg
Oct 22, 2024
10a7298
Merge branch 'release' into pg
Oct 23, 2024
8186cbc
Merge branch 'release' into pg
Oct 23, 2024
ff25892
Merge branch 'release' into pg
Oct 23, 2024
06893ca
Merge branch 'release' into pg
Oct 23, 2024
9933442
Merge branch 'release' into pg
Oct 23, 2024
1d4b461
Merge branch 'release' into pg
Oct 23, 2024
12fbcc2
Merge branch 'release' into pg
Oct 23, 2024
d575262
Merge branch 'release' into pg
Oct 23, 2024
3b46518
Merge branch 'release' into pg
Oct 24, 2024
7503007
Merge branch 'release' into pg
Oct 24, 2024
2a441ed
Merge branch 'release' into pg
Oct 24, 2024
e678743
Merge branch 'release' into pg
Oct 24, 2024
18c96fb
Merge branch 'release' into pg
Oct 24, 2024
80b5ed0
Merge branch 'release' into pg
Oct 24, 2024
71ba055
Merge branch 'release' into pg
Oct 24, 2024
b0768c1
Merge branch 'release' into pg
Oct 25, 2024
fdfb7e1
Merge branch 'release' into pg
Oct 25, 2024
4d07472
Merge branch 'release' into pg
Oct 25, 2024
5f63ae3
Merge branch 'release' into pg
Oct 25, 2024
007efe6
Merge branch 'release' into pg
Oct 25, 2024
886813d
Merge branch 'release' into pg
Oct 25, 2024
96ad460
Merge branch 'release' into pg
Oct 25, 2024
3218c0b
Merge branch 'release' into pg
Oct 25, 2024
e8d3e7e
Merge branch 'release' into pg
Oct 25, 2024
3e8ed77
Merge branch 'release' into pg
Oct 25, 2024
ef291ea
Merge branch 'release' into pg
Oct 25, 2024
163686f
Merge branch 'release' into pg
Oct 26, 2024
1d885de
Merge branch 'release' into pg
Oct 28, 2024
c6fd2ed
Merge branch 'release' into pg
Oct 28, 2024
ba9e4e0
Merge branch 'release' into pg
Oct 28, 2024
d57ba94
Merge branch 'release' into pg
Oct 28, 2024
7fa2641
Merge branch 'release' into pg
Oct 28, 2024
b0909bb
Merge branch 'release' into pg
Oct 29, 2024
664e702
make elastic threadpool configurable
AnaghHegde Oct 29, 2024
c416d9d
Merge branch 'release' into pg
Oct 29, 2024
1af6c1f
Merge branch 'release' into pg
Oct 30, 2024
c344c41
Merge branch 'release' into pg
Oct 30, 2024
0219ad2
Merge branch 'release' into pg
Oct 30, 2024
36a2144
Merge branch 'release' into pg
Oct 30, 2024
c50dffc
Merge branch 'release' into pg
Oct 30, 2024
4e5528e
Merge branch 'release' into pg
Oct 30, 2024
93292fa
Merge branch 'release' into pg
Oct 30, 2024
5c1b3ba
Merge branch 'release' into pg
Oct 31, 2024
2e89384
Merge branch 'release' into pg
Oct 31, 2024
5192843
chore: Merge release
abhvsn Nov 5, 2024
c18523b
Merge branch 'release' into pg
Nov 5, 2024
aa13d10
Merge branch 'release' into pg
Nov 5, 2024
7bbf55a
Merge branch 'release' into pg
Nov 5, 2024
6935cf0
Merge branch 'release' into pg
Nov 5, 2024
e1f0c21
Merge branch 'release' into pg
Nov 5, 2024
cdea5ef
Merge branch 'release' into pg
Nov 5, 2024
6588fbe
Merge branch 'release' into pg
Nov 6, 2024
1a2cb59
Merge branch 'release' into pg
Nov 6, 2024
fcc8a6e
Merge branch 'release' of github.com:appsmithorg/appsmith into pg
AnaghHegde Nov 6, 2024
88d53d8
Merge branch 'release' into pg
Nov 6, 2024
ed6e33a
Merge branch 'release' into pg
Nov 6, 2024
48777ca
Merge branch 'release' into pg
Nov 6, 2024
3e661e0
Merge branch 'release' into pg
Nov 6, 2024
9839ebb
Merge branch 'release' into pg
Nov 7, 2024
8eed240
ignore checksum validation for flyway
AnaghHegde Nov 7, 2024
e559073
chore: Add spotless for pg migrations (#37105)
AnaghHegde Nov 11, 2024
15134ae
Merge branch 'release' of github.com:appsmithorg/appsmith into pg
abhvsn Nov 12, 2024
7c7a992
Merge branch 'release' into pg
Nov 12, 2024
6f54908
Merge branch 'release' into pg
Nov 12, 2024
10cf1dc
Merge branch 'release' into pg
Nov 12, 2024
22dc06b
Merge branch 'release' into pg
Nov 12, 2024
f9c67a7
Merge branch 'release' into pg
Nov 13, 2024
9681428
Merge branch 'release' into pg
Nov 13, 2024
a07715d
Merge branch 'release' into pg
Nov 13, 2024
b95ce35
Merge branch 'release' into pg
Nov 13, 2024
e99f73f
Merge branch 'release' into pg
Nov 13, 2024
b47d9b8
Merge branch 'release' into pg
Nov 13, 2024
d4b9f65
Merge branch 'release' into pg
Nov 13, 2024
d4fbc7f
Merge branch 'release' into pg
Nov 13, 2024
0efe93e
Merge branch 'release' into pg
Nov 13, 2024
84948b3
Merge branch 'release' into pg
Nov 13, 2024
74b8f53
Merge branch 'release' into pg
Nov 13, 2024
39c75b1
Merge branch 'release' into pg
Nov 13, 2024
ac63c19
Merge branch 'release' into pg
Nov 13, 2024
03e8af9
Merge branch 'release' into pg
Nov 13, 2024
172619e
Merge branch 'release' into pg
Nov 13, 2024
a6be7dc
Merge branch 'release' into pg
Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ jobs:
run: |
scripts/prepare_server_artifacts.sh

- name: Place server artifacts-es
run: |
scripts/prepare_server_artifacts.sh

- name: Set base image tag
id: set_base_tag
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ jobs:
tags: ${{ needs.parse-tags.outputs.tags}}
spec: ${{ needs.parse-tags.outputs.spec}}
matrix: ${{ needs.parse-tags.outputs.matrix}}
is-pg-build: ${{ github.event.pull_request.base.ref == 'pg' }}
is-pg-build: ${{ github.event.pull_request.base.ref == 'pg' || github.event.pull_request.head.ref == 'pg' }}
7 changes: 4 additions & 3 deletions .github/workflows/test-build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ jobs:
id-token: write

# Run this job as soon as the docker image is ready, if this is the release branch
if: ( always() && github.ref == 'refs/heads/release' )
if: |
always() && (github.ref_name == 'release' || github.ref_name == 'pg')

steps:
- name: Checkout the head commit of the branch
Expand Down Expand Up @@ -373,7 +374,7 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push release image to Docker Hub
- name: Build and push image to Docker Hub
if: success()
uses: depot/build-push-action@v1
with:
Expand All @@ -383,7 +384,7 @@ jobs:
build-args: |
APPSMITH_SEGMENT_CE_KEY=${{ secrets.APPSMITH_SEGMENT_CE_KEY_RELEASE }}
APPSMITH_CLOUD_SERVICES_BASE_URL=https://release-cs.appsmith.com
BASE=${{ vars.DOCKER_HUB_ORGANIZATION }}/base-${{ vars.EDITION }}:release
BASE=${{ vars.DOCKER_HUB_ORGANIZATION }}/base-${{ vars.EDITION }}:${{ github.ref_name }}
tags: |
${{ vars.DOCKER_HUB_ORGANIZATION }}/appsmith-${{ vars.EDITION }}:${{ github.ref_name }}

Expand Down
2 changes: 2 additions & 0 deletions app/server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ container-volumes
*.env
dependency-reduced-pom.xml
appsmith-server/failedServerTests.txt
*Cake.java
!Base*Cake.java
2 changes: 1 addition & 1 deletion app/server/.run/ServerApplication.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
</component>
39 changes: 28 additions & 11 deletions app/server/appsmith-interfaces/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
</properties>

<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<!-- Overriding version to get fix for CVE-2024-1597. Remove once spring-boot is at least at 3.1.9 or 3.2.3 -->
<version>42.6.1</version>
</dependency>

<dependency>
<groupId>com.hierynomus</groupId>
<artifactId>sshj</artifactId>
Expand All @@ -30,6 +37,21 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.2.Final</version>
</dependency>
<dependency>
<groupId>io.hypersistence</groupId>
<artifactId>hypersistence-utils-hibernate-63</artifactId>
<version>3.8.3</version>
</dependency>

<!-- Actual Junit5 implementation. Will transitively include junit-jupiter-api -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -62,17 +84,6 @@
<version>${org.pf4j.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
</dependency>

<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
Expand All @@ -90,6 +101,12 @@
<artifactId>spring-security-crypto</artifactId>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.appsmith.external.annotations.encryption;

import com.appsmith.external.helpers.EncryptionHelper;
import jakarta.persistence.PostLoad;
import jakarta.persistence.PrePersist;
import org.springframework.stereotype.Component;

/**
* This isn't used today. Encryption/decryption with Postgres, only happens for nested fields in JSONB columns, and
* is handled in the {@link com.fasterxml.jackson.databind.ObjectMapper} directly, as part of
* {@link com.appsmith.external.helpers.CustomJsonType}.
* Yet the code is kept for now, as we potentially may have to revisit, when we need to have encryption/decryption for
* top-level fields in entity classes, since Jackson can't help there.
*/
@Component
@SuppressWarnings(
// Can't fix this since it's the only way to autowire beans for entity listeners.
"SpringJavaAutowiredFieldsWarningInspection")
public class EncryptionEntityListener {

@PrePersist
public void prePersist(Object entity) {
new EncryptionHandler().convertEncryption(entity, EncryptionHelper::encrypt);
}

@PostLoad
public void postLoad(Object entity) {
new EncryptionHandler().convertEncryption(entity, EncryptionHelper::decrypt);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ List<CandidateField> findCandidateFieldsForType(@NonNull Object source) {
return finalCandidateFields;
}

synchronized boolean convertEncryption(Object source, UnaryOperator<String> transformer) {
public synchronized boolean convertEncryption(Object source, UnaryOperator<String> transformer) {
if (source == null) {
return false;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.google.gson.JsonDeserializationContext;
Expand Down Expand Up @@ -50,7 +51,15 @@ public static class HttpMethodDeserializer extends com.fasterxml.jackson.databin
@Override
public HttpMethod deserialize(JsonParser jsonParser, DeserializationContext deserializationContext)
throws IOException {
return HttpMethod.valueOf(deserializationContext.readValue(jsonParser, String.class));
JsonNode value = deserializationContext.readValue(jsonParser, JsonNode.class);
// Custom handling is required because while migrating data from MongoDB this field is stored as:
// => "httpMethod": {"name": "GET"}
// But when stored via pg server we are storing the enum string:
// => "httpMethod": "GET"
if (value.has("name")) {
return HttpMethod.valueOf(value.get("name").asText());
}
return HttpMethod.valueOf(value.asText());
}
}
}
Loading
Loading