Skip to content

Commit ed884bd

Browse files
committed
merging base
2 parents ce79c49 + e76a262 commit ed884bd

28 files changed

+3067
-100
lines changed

.circleci/Dockerfile-ubuntu22

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
FROM ubuntu:22.04
2+
3+
RUN apt-get update && apt-get upgrade -y
4+
5+
RUN apt-get install build-essential -y
6+
7+
RUN apt-get install -y git-core
8+
9+
RUN apt-get install -y wget
10+
11+
# Install OpenJDK 12
12+
RUN wget https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz
13+
14+
RUN mkdir /usr/java
15+
16+
RUN mv openjdk-12.0.2_linux-x64_bin.tar.gz /usr/java
17+
18+
RUN cd /usr/java && tar -xzvf openjdk-12.0.2_linux-x64_bin.tar.gz
19+
20+
RUN echo 'JAVA_HOME=/usr/java/jdk-12.0.2' >> /etc/profile
21+
RUN echo 'PATH=$PATH:$HOME/bin:$JAVA_HOME/bin' >> /etc/profile
22+
23+
RUN apt-get install jq -y
24+
25+
RUN apt-get install curl -y
26+
27+
RUN apt-get install unzip -y
28+
29+
ADD ./runPostgreSQL.sh /runPostgreSQL.sh
30+
31+
RUN chmod +x /runPostgreSQL.sh
32+
33+
# Install OpenJDK 15.0.1
34+
RUN wget https://download.java.net/java/GA/jdk15.0.1/51f4f36ad4ef43e39d0dfdbaf6549e32/9/GPL/openjdk-15.0.1_linux-x64_bin.tar.gz
35+
36+
RUN mv openjdk-15.0.1_linux-x64_bin.tar.gz /usr/java
37+
38+
RUN cd /usr/java && tar -xzvf openjdk-15.0.1_linux-x64_bin.tar.gz
39+
40+
RUN echo 'JAVA_HOME=/usr/java/jdk-15.0.1' >> /etc/profile
41+
RUN echo 'PATH=$PATH:$HOME/bin:$JAVA_HOME/bin' >> /etc/profile
42+
RUN echo 'export JAVA_HOME' >> /etc/profile
43+
RUN echo 'export JRE_HOME' >> /etc/profile
44+
RUN echo 'export PATH' >> /etc/profile
45+
46+
RUN update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-12.0.2/bin/java" 1
47+
RUN update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-12.0.2/bin/javac" 1
48+
49+
#install postgres 13
50+
# Import Repository Signing Key
51+
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
52+
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
53+
RUN apt install curl gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates sudo -y
54+
# Add PostgreSQL repository
55+
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
56+
# Update again
57+
RUN apt update
58+
# Install PostgreSQL 13
59+
RUN apt install -y postgresql-13
60+
# Verify PostgreSQL 13 Installation on Ubuntu 22.04|20.04|18.04
61+
RUN psql --version
62+
63+
USER postgres
64+
65+
RUN service postgresql start && psql --command "CREATE USER root WITH SUPERUSER PASSWORD 'root';" \
66+
&& createdb -O root root \
67+
&& createdb -O root supertokens
68+
69+
USER root
70+
71+
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/13/main/pg_hba.conf
72+
73+
74+
RUN echo "listen_addresses='*'" >> /etc/postgresql/13/main/postgresql.conf
75+
76+
77+
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
78+
79+
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]

.circleci/config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ orbs:
44
jobs:
55
test:
66
docker:
7-
- image: rishabhpoddar/supertokens_postgresql_plugin_test
7+
- image: tamassupertokens/supertokens_postgresql_plugin_test
88
- image: rishabhpoddar/oauth-server-cicd
99
resource_class: large
1010
steps:
@@ -15,7 +15,7 @@ jobs:
1515
- run:
1616
name: update postgresql max_connections
1717
command: |
18-
sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/9.5/main/postgresql.conf
18+
sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/13/main/postgresql.conf
1919
- run:
2020
name: starting postgresql
2121
command: |
@@ -80,7 +80,7 @@ jobs:
8080
- slack/status
8181
test-onemillionusers:
8282
docker:
83-
- image: rishabhpoddar/supertokens_postgresql_plugin_test
83+
- image: tamassupertokens/supertokens_postgresql_plugin_test
8484
resource_class: large
8585
steps:
8686
- add_ssh_keys:
@@ -90,7 +90,7 @@ jobs:
9090
- run:
9191
name: update postgresql max_connections
9292
command: |
93-
sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/9.5/main/postgresql.conf
93+
sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/13/main/postgresql.conf
9494
- run:
9595
name: starting postgresql
9696
command: |
@@ -155,7 +155,7 @@ jobs:
155155
- slack/status
156156
mark-passed:
157157
docker:
158-
- image: rishabhpoddar/supertokens_postgresql_plugin_test
158+
- image: tamassupertokens/supertokens_postgresql_plugin_test
159159
steps:
160160
- checkout
161161
- run: (cd .circleci && ./markPassed.sh)
@@ -172,15 +172,15 @@ workflows:
172172
tags:
173173
only: /dev-v[0-9]+(\.[0-9]+)*/
174174
branches:
175-
ignore: /.*/
175+
only: /test-cicd\/.*/
176176
- test-onemillionusers:
177177
context:
178178
- slack-notification
179179
filters:
180180
tags:
181181
only: /dev-v[0-9]+(\.[0-9]+)*/
182182
branches:
183-
ignore: /.*/
183+
only: /test-cicd\/.*/
184184
- mark-passed:
185185
context:
186186
- slack-notification

.circleci/doTests.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ do
102102
pluginY=$(cut -d'.' -f2 <<<"$pluginVersion")
103103
echo -e "core,$coreVersionX2\nplugin-interface,$piVersion\npostgresql-plugin,$pluginX.$pluginY" > modules.txt
104104
./loadModules
105+
106+
#gradle properties overrides
107+
export _JAVA_OPTIONS="-Xms1g -Xmx4g"
108+
105109
cd supertokens-core
106110
git checkout $coreVersionTag
107111
cd ../supertokens-plugin-interface

CHANGELOG.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,60 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
## [8.0.2]
11+
12+
- Fixes `NullPointerException` in user search API
13+
14+
## [8.0.1]
15+
16+
- Fixes slow queries for account linking
17+
18+
### Migration
19+
20+
```sql
21+
CREATE INDEX IF NOT EXISTS emailpassword_users_email_index ON emailpassword_users (app_id, email);
22+
CREATE INDEX IF NOT EXISTS emailpassword_user_to_tenant_email_index ON emailpassword_user_to_tenant (app_id, tenant_id, email);
23+
24+
CREATE INDEX IF NOT EXISTS passwordless_users_email_index ON passwordless_users (app_id, email);
25+
CREATE INDEX IF NOT EXISTS passwordless_users_phone_number_index ON passwordless_users (app_id, phone_number);
26+
CREATE INDEX IF NOT EXISTS passwordless_user_to_tenant_email_index ON passwordless_user_to_tenant (app_id, tenant_id, email);
27+
CREATE INDEX IF NOT EXISTS passwordless_user_to_tenant_phone_number_index ON passwordless_user_to_tenant (app_id, tenant_id, phone_number);
28+
29+
CREATE INDEX IF NOT EXISTS thirdparty_user_to_tenant_third_party_user_id_index ON thirdparty_user_to_tenant (app_id, tenant_id, third_party_id, third_party_user_id);
30+
```
31+
32+
## [8.0.0]
33+
34+
- Adds tables and queries for Bulk Import
35+
- Optimize getUserIdMappingWithEitherSuperTokensUserIdOrExternalUserId query
36+
- Adds indexing for `session_info` table on `user_id, app_id` columns
37+
38+
### Migration
39+
40+
```sql
41+
"CREATE TABLE IF NOT EXISTS bulk_import_users (
42+
id CHAR(36),
43+
app_id VARCHAR(64) NOT NULL DEFAULT 'public',
44+
primary_user_id VARCHAR(36),
45+
raw_data TEXT NOT NULL,
46+
status VARCHAR(128) DEFAULT 'NEW',
47+
error_msg TEXT,
48+
created_at BIGINT NOT NULL,
49+
updated_at BIGINT NOT NULL,
50+
CONSTRAINT bulk_import_users_pkey PRIMARY KEY(app_id, id),
51+
CONSTRAINT bulk_import_users__app_id_fkey FOREIGN KEY(app_id) REFERENCES apps(app_id) ON DELETE CASCADE
52+
);
53+
54+
CREATE INDEX IF NOT EXISTS bulk_import_users_status_updated_at_index ON bulk_import_users (app_id, status, updated_at);
55+
56+
CREATE INDEX IF NOT EXISTS bulk_import_users_pagination_index1 ON bulk_import_users (app_id, status, created_at DESC,
57+
id DESC);
58+
59+
CREATE INDEX IF NOT EXISTS bulk_import_users_pagination_index2 ON bulk_import_users (app_id, created_at DESC, id DESC);
60+
61+
CREATE INDEX IF NOT EXISTS session_info_user_id_app_id_index ON session_info (user_id, app_id);
62+
```
63+
1064
## [7.2.0] - 2024-10-03
1165
1266
- Compatible with plugin interface version 6.3

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'java-library'
33
}
44

5-
version = "7.2.0"
5+
version = "8.0.2"
66

77
repositories {
88
mavenCentral()

jar/postgresql-plugin-7.2.0.jar

-230 KB
Binary file not shown.

jar/postgresql-plugin-8.0.2.jar

266 KB
Binary file not shown.

pluginInterfaceSupported.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"_comment": "contains a list of plugin interfaces branch names that this core supports",
33
"versions": [
4-
"6.3"
4+
"7.0"
55
]
6-
}
6+
}

0 commit comments

Comments
 (0)