Skip to content

Commit 931d287

Browse files
Merge pull request #2 from synonymdev/feat/jwt-auth
feat: lnurl-auth jwt support
2 parents 05ca96e + a61f655 commit 931d287

File tree

22 files changed

+1459
-992
lines changed

22 files changed

+1459
-992
lines changed

Cargo.lock

Lines changed: 177 additions & 115 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "vss-rust-client-ffi"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
edition = "2021"
55
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
66

@@ -15,7 +15,11 @@ serde = { version = "^1.0.209", features = ["derive"] }
1515
tokio = "1.40.0"
1616
once_cell = "1.19.0"
1717
thiserror = "2.0.12"
18-
vss-client = { version = "0.1.0" }
18+
vss-client = "0.3"
19+
bitcoin = "0.32.0"
20+
bip39 = "2.0.0"
21+
prost = "0.11.6"
22+
rand = "0.8.5"
1923

2024
[dev-dependencies]
2125
tokio = { version = "1.40.0", features = ["full"] }

README.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ cargo build --release
3232
```swift
3333
import vss_rust_client_ffi
3434

35-
// Initialize VSS client
36-
try await vssNewClient(
35+
// Initialize VSS client with LNURL-auth
36+
try await vssNewClientWithLnurlAuth(
3737
baseUrl: "https://vss.example.com",
38-
storeId: "my-app-store"
38+
storeId: "my-app-store",
39+
mnemonic: "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
40+
passphrase: nil,
41+
lnurlAuthServerUrl: "https://auth.example.com/lnurl"
3942
)
4043

4144
// Store data
@@ -70,11 +73,13 @@ vssShutdownClient()
7073
```python
7174
from vss_rust_client_ffi import *
7275

73-
# Initialize VSS client
74-
await vss_new_client(
76+
# Initialize VSS client with LNURL-auth
77+
await vss_new_client_with_lnurl_auth(
7578
"https://vss.example.com",
76-
"my-app-store",
77-
None
79+
"my-app-store",
80+
"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
81+
None, # passphrase
82+
"https://auth.example.com/lnurl"
7883
)
7984

8085
# Store data
@@ -112,10 +117,13 @@ vss_shutdown_client()
112117
```kotlin
113118
import uniffi.vss_rust_client_ffi.*
114119

115-
// Initialize VSS client
116-
vssNewClient(
120+
// Initialize VSS client with LNURL-auth
121+
vssNewClientWithLnurlAuth(
117122
baseUrl = "https://vss.example.com",
118-
storeId = "my-app-store"
123+
storeId = "my-app-store",
124+
mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
125+
passphrase = null,
126+
lnurlAuthServerUrl = "https://auth.example.com/lnurl"
119127
)
120128

121129
// Store data
@@ -146,11 +154,20 @@ vssShutdownClient()
146154
### Client Management
147155

148156
#### `vssNewClient(baseUrl: String, storeId: String) -> Void`
149-
Initialize the global VSS client connection.
157+
Initialize the global VSS client connection without authentication.
150158

151159
- `baseUrl`: VSS server URL (e.g., "https://vss.example.com")
152160
- `storeId`: Unique identifier for your storage namespace
153161

162+
#### `vssNewClientWithLnurlAuth(baseUrl: String, storeId: String, mnemonic: String, passphrase: String?, lnurlAuthServerUrl: String) -> Void`
163+
Initialize the global VSS client connection with LNURL-auth authentication. Provides automatic JWT token management and data encryption.
164+
165+
- `baseUrl`: VSS server URL (e.g., "https://vss.example.com")
166+
- `storeId`: Unique identifier for your storage namespace
167+
- `mnemonic`: BIP39 mnemonic phrase (12 or 24 words)
168+
- `passphrase`: Optional BIP39 passphrase (pass `null` if none)
169+
- `lnurlAuthServerUrl`: LNURL-auth server URL for authentication
170+
154171
#### `vssShutdownClient() -> Void`
155172
Shutdown the VSS client and clean up resources. Optional but recommended for clean application shutdown.
156173

bindings/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ android.useAndroidX=true
33
android.nonTransitiveRClass=true
44
kotlin.code.style=official
55
# project settings:
6-
version=0.1.0
6+
version=0.2.0
Binary file not shown.
Binary file not shown.
-3.53 MB
Binary file not shown.
-4.27 MB
Binary file not shown.

0 commit comments

Comments
 (0)