@powersync/service-module-postgres 0.0.0-dev-20250724111728 → 0.0.0-dev-20250729121434

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,25 +1,29 @@
1
1
  # @powersync/service-module-postgres
2
2
 
3
- ## 0.0.0-dev-20250724111728
3
+ ## 0.0.0-dev-20250729121434
4
4
 
5
5
  ### Minor Changes
6
6
 
7
+ - 2378e36: Drop support for legacy Supabase keys via app.settings.jwt_secret.
8
+ - 2378e36: Add automatic support for Supabase JWT Signing Keys.
7
9
  - d56eeb9: Delay switching over to new sync rules until we have a consistent checkpoint.
8
10
 
9
11
  ### Patch Changes
10
12
 
11
13
  - a700ec9: Reporting mongo storage added to storage engine.
14
+ - Updated dependencies [2378e36]
12
15
  - Updated dependencies [f1d187b]
13
16
  - Updated dependencies [4ebc3bf]
17
+ - Updated dependencies [2378e36]
14
18
  - Updated dependencies [a882b94]
15
19
  - Updated dependencies [1aafdaf]
16
20
  - Updated dependencies [d56eeb9]
17
21
  - Updated dependencies [a700ec9]
18
- - @powersync/service-core@0.0.0-dev-20250724111728
19
- - @powersync/service-types@0.0.0-dev-20250724111728
20
- - @powersync/service-jpgwire@0.0.0-dev-20250724111728
21
- - @powersync/lib-services-framework@0.0.0-dev-20250724111728
22
- - @powersync/lib-service-postgres@0.0.0-dev-20250724111728
22
+ - @powersync/service-core@0.0.0-dev-20250729121434
23
+ - @powersync/service-types@0.0.0-dev-20250729121434
24
+ - @powersync/service-jpgwire@0.0.0-dev-20250729121434
25
+ - @powersync/lib-services-framework@0.0.0-dev-20250729121434
26
+ - @powersync/lib-service-postgres@0.0.0-dev-20250729121434
23
27
 
24
28
  ## 0.14.4
25
29
 
@@ -1,7 +1,7 @@
1
+ import { NormalizedBasePostgresConnectionConfig } from '@powersync/lib-service-postgres';
1
2
  import { api, ConnectionTestResult, modules, replication, system } from '@powersync/service-core';
2
3
  import * as types from '../types/types.js';
3
4
  import { PostgresConnectionConfig } from '../types/types.js';
4
- import { NormalizedBasePostgresConnectionConfig } from '@powersync/lib-service-postgres';
5
5
  export declare class PostgresModule extends replication.ReplicationModule<types.PostgresConnectionConfig> {
6
6
  constructor();
7
7
  onInitialized(context: system.ServiceContextContainer): Promise<void>;
@@ -12,7 +12,6 @@ export declare class PostgresModule extends replication.ReplicationModule<types.
12
12
  */
13
13
  private resolveConfig;
14
14
  teardown(options: modules.TearDownOptions): Promise<void>;
15
- private registerSupabaseAuth;
16
15
  testConnection(config: PostgresConnectionConfig): Promise<ConnectionTestResult>;
17
16
  static testConnection(normalizedConfig: NormalizedBasePostgresConnectionConfig): Promise<ConnectionTestResult>;
18
17
  }
@@ -1,7 +1,8 @@
1
- import { auth, ConfigurationFileSyncRulesProvider, replication } from '@powersync/service-core';
1
+ import { baseUri } from '@powersync/lib-service-postgres';
2
+ import { ConfigurationFileSyncRulesProvider, replication } from '@powersync/service-core';
2
3
  import * as jpgwire from '@powersync/service-jpgwire';
4
+ import { ReplicationMetric } from '@powersync/service-types';
3
5
  import { PostgresRouteAPIAdapter } from '../api/PostgresRouteAPIAdapter.js';
4
- import { SupabaseKeyCollector } from '../auth/SupabaseKeyCollector.js';
5
6
  import { ConnectionManagerFactory } from '../replication/ConnectionManagerFactory.js';
6
7
  import { PgManager } from '../replication/PgManager.js';
7
8
  import { PostgresErrorRateLimiter } from '../replication/PostgresErrorRateLimiter.js';
@@ -9,8 +10,6 @@ import { checkSourceConfiguration, cleanUpReplicationSlot } from '../replication
9
10
  import { PUBLICATION_NAME } from '../replication/WalStream.js';
10
11
  import { WalStreamReplicator } from '../replication/WalStreamReplicator.js';
11
12
  import * as types from '../types/types.js';
12
- import { baseUri } from '@powersync/lib-service-postgres';
13
- import { ReplicationMetric } from '@powersync/service-types';
14
13
  import { getApplicationName } from '../utils/application-name.js';
15
14
  export class PostgresModule extends replication.ReplicationModule {
16
15
  constructor() {
@@ -21,16 +20,6 @@ export class PostgresModule extends replication.ReplicationModule {
21
20
  });
22
21
  }
23
22
  async onInitialized(context) {
24
- const client_auth = context.configuration.base_config.client_auth;
25
- if (client_auth?.supabase && client_auth?.supabase_jwt_secret == null) {
26
- // Only use the deprecated SupabaseKeyCollector when there is no
27
- // secret hardcoded. Hardcoded secrets are handled elsewhere, using
28
- // StaticSupabaseKeyCollector.
29
- // Support for SupabaseKeyCollector is deprecated and support will be
30
- // completely removed by Supabase soon. We can keep support a while
31
- // longer for self-hosted setups, before also removing that on our side.
32
- this.registerSupabaseAuth(context);
33
- }
34
23
  // Record replicated bytes using global jpgwire metrics. Only registered if this module is replicating
35
24
  if (context.replicationEngine) {
36
25
  jpgwire.setMetricsRecorder({
@@ -91,32 +80,6 @@ export class PostgresModule extends replication.ReplicationModule {
91
80
  await connectionManager.end();
92
81
  }
93
82
  }
94
- // TODO: This should rather be done by registering the key collector in some kind of auth engine
95
- registerSupabaseAuth(context) {
96
- const { configuration } = context;
97
- // Register the Supabase key collector(s)
98
- configuration.connections
99
- ?.map((baseConfig) => {
100
- if (baseConfig.type != types.POSTGRES_CONNECTION_TYPE) {
101
- return;
102
- }
103
- try {
104
- return this.resolveConfig(types.PostgresConnectionConfig.decode(baseConfig));
105
- }
106
- catch (ex) {
107
- this.logger.warn('Failed to decode configuration.', ex);
108
- }
109
- })
110
- .filter((c) => !!c)
111
- .forEach((config) => {
112
- const keyCollector = new SupabaseKeyCollector(config);
113
- context.lifeCycleEngine.withLifecycle(keyCollector, {
114
- // Close the internal pool
115
- stop: (collector) => collector.shutdown()
116
- });
117
- configuration.client_keystore.collector.add(new auth.CachedKeyCollector(keyCollector));
118
- });
119
- }
120
83
  async testConnection(config) {
121
84
  this.decodeConfig(config);
122
85
  const normalizedConfig = this.resolveConfig(this.decodedConfig);
@@ -1 +1 @@
1
- {"version":3,"file":"PostgresModule.js","sourceRoot":"","sources":["../../src/module/PostgresModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EACJ,kCAAkC,EAGlC,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AC;QAC/D,CAAC;gBAAS,CAAC;YACT,MAAM,iBAAiB,CAAC,GAAG,EAAE,CAAC;QAChC,CAAC;QACD,OAAO;YACL,qBAAqB,EAAE,OAAO,CAAC,gBAAgB,CAAC;SACjD,CAAC;IACJ,CAAC;CACF"}
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "version": "0.0.0-dev-20250724111728",
8
+ "version": "0.0.0-dev-20250729121434",
9
9
  "main": "dist/index.js",
10
10
  "license": "FSL-1.1-Apache-2.0",
11
11
  "type": "module",
@@ -28,20 +28,20 @@
28
28
  "ts-codec": "^1.3.0",
29
29
  "uri-js": "^4.4.1",
30
30
  "uuid": "^11.1.0",
31
- "@powersync/lib-service-postgres": "0.0.0-dev-20250724111728",
32
- "@powersync/lib-services-framework": "0.0.0-dev-20250724111728",
33
- "@powersync/service-core": "0.0.0-dev-20250724111728",
34
- "@powersync/service-types": "0.0.0-dev-20250724111728",
35
- "@powersync/service-jpgwire": "0.0.0-dev-20250724111728",
31
+ "@powersync/lib-service-postgres": "0.0.0-dev-20250729121434",
32
+ "@powersync/lib-services-framework": "0.0.0-dev-20250729121434",
33
+ "@powersync/service-core": "0.0.0-dev-20250729121434",
34
+ "@powersync/service-types": "0.0.0-dev-20250729121434",
35
+ "@powersync/service-jpgwire": "0.0.0-dev-20250729121434",
36
36
  "@powersync/service-jsonbig": "0.17.10",
37
37
  "@powersync/service-sync-rules": "0.27.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/semver": "^7.5.4",
41
- "@powersync/service-core-tests": "0.0.0-dev-20250724111728",
42
- "@powersync/service-module-mongodb-storage": "0.0.0-dev-20250724111728",
43
- "@powersync/lib-service-postgres": "0.0.0-dev-20250724111728",
44
- "@powersync/service-module-postgres-storage": "0.0.0-dev-20250724111728"
41
+ "@powersync/service-core-tests": "0.0.0-dev-20250729121434",
42
+ "@powersync/service-module-mongodb-storage": "0.0.0-dev-20250729121434",
43
+ "@powersync/lib-service-postgres": "0.0.0-dev-20250729121434",
44
+ "@powersync/service-module-postgres-storage": "0.0.0-dev-20250729121434"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "tsc -b",
@@ -1,6 +1,6 @@
1
+ import { baseUri, NormalizedBasePostgresConnectionConfig } from '@powersync/lib-service-postgres';
1
2
  import {
2
3
  api,
3
- auth,
4
4
  ConfigurationFileSyncRulesProvider,
5
5
  ConnectionTestResult,
6
6
  modules,
@@ -8,8 +8,8 @@ import {
8
8
  system
9
9
  } from '@powersync/service-core';
10
10
  import * as jpgwire from '@powersync/service-jpgwire';
11
+ import { ReplicationMetric } from '@powersync/service-types';
11
12
  import { PostgresRouteAPIAdapter } from '../api/PostgresRouteAPIAdapter.js';
12
- import { SupabaseKeyCollector } from '../auth/SupabaseKeyCollector.js';
13
13
  import { ConnectionManagerFactory } from '../replication/ConnectionManagerFactory.js';
14
14
  import { PgManager } from '../replication/PgManager.js';
15
15
  import { PostgresErrorRateLimiter } from '../replication/PostgresErrorRateLimiter.js';
@@ -18,8 +18,6 @@ import { PUBLICATION_NAME } from '../replication/WalStream.js';
18
18
  import { WalStreamReplicator } from '../replication/WalStreamReplicator.js';
19
19
  import * as types from '../types/types.js';
20
20
  import { PostgresConnectionConfig } from '../types/types.js';
21
- import { baseUri, NormalizedBasePostgresConnectionConfig } from '@powersync/lib-service-postgres';
22
- import { ReplicationMetric } from '@powersync/service-types';
23
21
  import { getApplicationName } from '../utils/application-name.js';
24
22
 
25
23
  export class PostgresModule extends replication.ReplicationModule<types.PostgresConnectionConfig> {
@@ -32,19 +30,6 @@ export class PostgresModule extends replication.ReplicationModule<types.Postgres
32
30
  }
33
31
 
34
32
  async onInitialized(context: system.ServiceContextContainer): Promise<void> {
35
- const client_auth = context.configuration.base_config.client_auth;
36
-
37
- if (client_auth?.supabase && client_auth?.supabase_jwt_secret == null) {
38
- // Only use the deprecated SupabaseKeyCollector when there is no
39
- // secret hardcoded. Hardcoded secrets are handled elsewhere, using
40
- // StaticSupabaseKeyCollector.
41
-
42
- // Support for SupabaseKeyCollector is deprecated and support will be
43
- // completely removed by Supabase soon. We can keep support a while
44
- // longer for self-hosted setups, before also removing that on our side.
45
- this.registerSupabaseAuth(context);
46
- }
47
-
48
33
  // Record replicated bytes using global jpgwire metrics. Only registered if this module is replicating
49
34
  if (context.replicationEngine) {
50
35
  jpgwire.setMetricsRecorder({
@@ -110,32 +95,6 @@ export class PostgresModule extends replication.ReplicationModule<types.Postgres
110
95
  }
111
96
  }
112
97
 
113
- // TODO: This should rather be done by registering the key collector in some kind of auth engine
114
- private registerSupabaseAuth(context: system.ServiceContextContainer) {
115
- const { configuration } = context;
116
- // Register the Supabase key collector(s)
117
- configuration.connections
118
- ?.map((baseConfig) => {
119
- if (baseConfig.type != types.POSTGRES_CONNECTION_TYPE) {
120
- return;
121
- }
122
- try {
123
- return this.resolveConfig(types.PostgresConnectionConfig.decode(baseConfig as any));
124
- } catch (ex) {
125
- this.logger.warn('Failed to decode configuration.', ex);
126
- }
127
- })
128
- .filter((c) => !!c)
129
- .forEach((config) => {
130
- const keyCollector = new SupabaseKeyCollector(config!);
131
- context.lifeCycleEngine.withLifecycle(keyCollector, {
132
- // Close the internal pool
133
- stop: (collector) => collector.shutdown()
134
- });
135
- configuration.client_keystore.collector.add(new auth.CachedKeyCollector(keyCollector));
136
- });
137
- }
138
-
139
98
  async testConnection(config: PostgresConnectionConfig): Promise<ConnectionTestResult> {
140
99
  this.decodeConfig(config);
141
100
  const normalizedConfig = this.resolveConfig(this.decodedConfig!);