@powersync/service-core 0.0.0-dev-20250116115804 → 0.0.0-dev-20250122110924
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 +13 -8
- package/dist/auth/RemoteJWKSCollector.d.ts +3 -0
- package/dist/auth/RemoteJWKSCollector.js +8 -4
- package/dist/auth/RemoteJWKSCollector.js.map +1 -1
- package/dist/entry/cli-entry.js +2 -0
- package/dist/entry/cli-entry.js.map +1 -1
- package/dist/entry/commands/teardown-action.js +2 -1
- package/dist/entry/commands/teardown-action.js.map +1 -1
- package/dist/entry/commands/test-connection-action.d.ts +2 -0
- package/dist/entry/commands/test-connection-action.js +32 -0
- package/dist/entry/commands/test-connection-action.js.map +1 -0
- package/dist/metrics/Metrics.js +2 -2
- package/dist/metrics/Metrics.js.map +1 -1
- package/dist/replication/AbstractReplicator.d.ts +2 -0
- package/dist/replication/AbstractReplicator.js.map +1 -1
- package/dist/replication/ReplicationEngine.d.ts +2 -0
- package/dist/replication/ReplicationEngine.js +3 -0
- package/dist/replication/ReplicationEngine.js.map +1 -1
- package/dist/replication/ReplicationModule.d.ts +8 -2
- package/dist/replication/ReplicationModule.js +6 -11
- package/dist/replication/ReplicationModule.js.map +1 -1
- package/dist/routes/endpoints/admin.js +3 -3
- package/dist/routes/endpoints/admin.js.map +1 -1
- package/dist/routes/endpoints/socket-route.js +5 -5
- package/dist/routes/endpoints/socket-route.js.map +1 -1
- package/dist/routes/endpoints/sync-rules.js +9 -9
- package/dist/routes/endpoints/sync-rules.js.map +1 -1
- package/dist/routes/endpoints/sync-stream.js +5 -5
- package/dist/routes/endpoints/sync-stream.js.map +1 -1
- package/dist/routes/route-register.js +4 -4
- package/dist/routes/route-register.js.map +1 -1
- package/dist/util/config/compound-config-collector.js +6 -9
- package/dist/util/config/compound-config-collector.js.map +1 -1
- package/dist/util/utils.js +2 -1
- package/dist/util/utils.js.map +1 -1
- package/package.json +5 -5
- package/src/auth/RemoteJWKSCollector.ts +18 -5
- package/src/entry/cli-entry.ts +2 -0
- package/src/entry/commands/teardown-action.ts +2 -1
- package/src/entry/commands/test-connection-action.ts +41 -0
- package/src/metrics/Metrics.ts +2 -2
- package/src/replication/AbstractReplicator.ts +3 -0
- package/src/replication/ReplicationEngine.ts +5 -0
- package/src/replication/ReplicationModule.ts +15 -13
- package/src/routes/endpoints/admin.ts +3 -3
- package/src/routes/endpoints/socket-route.ts +5 -5
- package/src/routes/endpoints/sync-rules.ts +9 -9
- package/src/routes/endpoints/sync-stream.ts +5 -5
- package/src/routes/route-register.ts +4 -4
- package/src/util/config/compound-config-collector.ts +7 -9
- package/src/util/utils.ts +2 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -95,18 +95,16 @@ export class CompoundConfigCollector {
|
|
|
95
95
|
reject_ip_ranges: []
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
if (block_local_jwks == true) {
|
|
98
|
+
if (baseConfig.client_auth?.jwks_reject_ip_ranges != null) {
|
|
100
99
|
jwksLookup = {
|
|
101
|
-
reject_ip_ranges:
|
|
102
|
-
reject_ipv6: true
|
|
103
|
-
};
|
|
104
|
-
} else if (Array.isArray(block_local_jwks)) {
|
|
105
|
-
jwksLookup = {
|
|
106
|
-
reject_ip_ranges: block_local_jwks,
|
|
107
|
-
reject_ipv6: true
|
|
100
|
+
reject_ip_ranges: baseConfig.client_auth?.jwks_reject_ip_ranges
|
|
108
101
|
};
|
|
109
102
|
}
|
|
103
|
+
if (baseConfig.client_auth?.block_local_jwks) {
|
|
104
|
+
// Deprecated - recommend method is to use jwks_reject_ip_ranges
|
|
105
|
+
jwksLookup.reject_ip_ranges.push('local');
|
|
106
|
+
jwksLookup.reject_ipv6 = true;
|
|
107
|
+
}
|
|
110
108
|
|
|
111
109
|
for (let uri of jwks_uris) {
|
|
112
110
|
collectors.add(new auth.CachedKeyCollector(new auth.RemoteJWKSCollector(uri, { lookupOptions: jwksLookup })));
|
package/src/util/utils.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { BucketChecksum, OpId, OplogEntry } from './protocol-types.js';
|
|
|
7
7
|
import * as storage from '../storage/storage-index.js';
|
|
8
8
|
|
|
9
9
|
import { PartialChecksum } from '../storage/ChecksumCache.js';
|
|
10
|
+
import { ServiceAssertionError } from '@powersync/lib-services-framework';
|
|
10
11
|
|
|
11
12
|
export type ChecksumMap = Map<string, BucketChecksum>;
|
|
12
13
|
|
|
@@ -34,7 +35,7 @@ export function timestampToOpId(ts: bigint): OpId {
|
|
|
34
35
|
// Dynamic values are passed in in some cases, so we make extra sure that the
|
|
35
36
|
// number is a bigint and not number or Long.
|
|
36
37
|
if (typeof ts != 'bigint') {
|
|
37
|
-
throw new
|
|
38
|
+
throw new ServiceAssertionError(`bigint expected, got: ${ts} (${typeof ts})`);
|
|
38
39
|
}
|
|
39
40
|
return ts.toString(10);
|
|
40
41
|
}
|