-
Notifications
You must be signed in to change notification settings - Fork 19
[Alpha] Kotlin Multiplatform SDK #1
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
Conversation
… pod and static framework
core/src/commonMain/kotlin/com/powersync/connectors/PowerSyncCredentials.kt
Outdated
Show resolved
Hide resolved
| val parts = jwt.split('.') | ||
| check(parts.size == 3) { "Invalid JWT" } | ||
|
|
||
| val payload = parts[1].decodeBase64String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure this works with base64-url encoding, and without padding. See discussion:
powersync-ja/powersync.dart#58 (review)
Alternatively, just remove getExpiryDate and decodeJwt for the alpha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From ktor's implementation, it does look like they handle padding and byte masks, normalizing the input before decoding.
https://github.com/ktorio/ktor/blob/main/ktor-utils/common/src/io/ktor/util/Base64.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like padding is fine, but I don't see anything handling base64url characters (uses - and _ instead of + and /).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This functionality is unlikely to be used much so it's not a massive blocker, but I'd prefer to remove it rather than have a broken implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
stevensJourney
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from my side.
connectors/src/commonMain/kotlin/com/powersync/connectors/SupabaseConnector.kt
Outdated
Show resolved
Hide resolved
core/src/commonMain/kotlin/com/powersync/bucket/BucketStorage.kt
Outdated
Show resolved
Hide resolved
core/src/commonMain/kotlin/com/powersync/db/internal/PsInternalDatabase.kt
Outdated
Show resolved
Hide resolved
| maven { | ||
| url = uri("https://maven.pkg.github.com/powersync-ja/powersync-kotlin") | ||
| credentials { | ||
| username = localProperties.getProperty("GITHUB_USERNAME") | ||
| password = localProperties.getProperty("GITHUB_TOKEN") | ||
| } | ||
| } | ||
| } |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
…or.supabase` namespace and update demo apps accordingly
| val parts = jwt.split('.') | ||
| check(parts.size == 3) { "Invalid JWT" } | ||
|
|
||
| val payload = parts[1].decodeBase64String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This functionality is unlikely to be used much so it's not a massive blocker, but I'd prefer to remove it rather than have a broken implementation
…from PowerSyncCredentials
PowerSync Kotlin SDK
Alpha Release paper doc
Alpha version
sqlite3_update_hookandsqlite3_commit_hookSupabaseConnectorpublished undercom.powersync:connector-supabasenamespaceTodo's
Remove GitHub auth for maven registry (here) insupabase-todoliteappFuture work/ideas
com.powersync:core