6 files changed
+23
-1093
.agents/skills/smbcloud-auth/SKILL.md
+15
-6
@@ -9,8 +9,9 @@ Use this skill when work touches any part of the smbCloud auth stack:
9
10
- `smbcloud-api` Rails auth service
11
- `smbcloud-web-console` Next.js admin UI
12
-- `smbcloud-cli/crates/smbcloud-auth` Rust SDK
13
-- `smbcloud-cli/crates/smbcloud-auth-sdk-wasm` browser SDK
12
+- `smbcloud-cli/crates/smbcloud-auth-sdk` canonical client SDK core (wrapped by the `-py` and `-wasm` bindings; the Apple SDK is the native Swift package `smbcloud-auth-swift`, not a UniFFI binding)
13
+- `smbcloud-cli/crates/smbcloud-auth-sdk-wasm` browser SDK (binding over the core)
14
+- `smbcloud-cli/crates/smbcloud-auth` the smbcloud-cli's own internal auth client — NOT the published SDK
15
- Tauri apps such as Rumi Learn Persian and PBJ Komplit
16
- web apps that use `@smbcloud/sdk-auth`
17
@@ -135,10 +136,18 @@ Do not claim email confirmation exists unless the mailer and route are actually
136
137
## Rust SDK conventions
138
138
-The Rust client surface lives in:
139
+The canonical Rust client surface lives in:
140
140
-- `smbcloud-cli/crates/smbcloud-auth`
141
-- `smbcloud-cli/crates/smbcloud-auth-sdk-wasm`
141
+- `smbcloud-cli/crates/smbcloud-auth-sdk` — the shared SDK core; the published
142
+ bindings (`smbcloud-auth-sdk-py`, `smbcloud-auth-sdk-wasm`) depend on it.
143
+ Change the client contract here.
144
+- `smbcloud-cli/crates/smbcloud-auth-sdk-wasm` — the browser binding (`@smbcloud/sdk-auth`).
145
+- Apple platforms are served by the native Swift port in `smbcloud-auth-swift`
146
+ (`AuthCore`), pinned to this crate by a conformance suite — there is no UniFFI
147
+ Apple binding.
148
+
149
+`smbcloud-cli/crates/smbcloud-auth` is the CLI's own internal auth client (only
150
+the `cli` crate depends on it); don't treat it as the SDK.
151
152
When changing tenant app auth:
153
@@ -277,7 +286,7 @@ Use the smallest relevant checks.
286
287
### Rust SDK
288
280
-- `cargo check -p smbcloud-auth`
289
+- `cargo check -p smbcloud-auth-sdk` (the core; also rebuilds the bindings as needed)
290
- `cargo check -p smbcloud-auth-sdk-wasm`
291
292
### Tauri apps
.github/workflows/verify-sdk-apple.yml
deleted
-274
@@ -1,274 +0,0 @@
1
-name: Apple Bridge SDK Verification
2
-
3
-# Verifies the internal Apple bridge crate used for local UniFFI/XCFramework
4
-# development. This workflow does not publish or update the standalone
5
-# smbcloud-auth-swift repository.
6
-#
7
-# It builds the Rust Apple bridge for supported Apple targets, generates the
8
-# UniFFI Swift bindings, assembles a local XCFramework, and uploads the
9
-# generated artifacts for inspection.
10
-
11
-on:
12
- push:
13
- paths:
14
- - ".github/workflows/verify-sdk-apple.yml"
15
- - "Cargo.toml"
16
- - "Cargo.lock"
17
- - "rust-toolchain.toml"
18
- - "crates/smbcloud-auth-sdk-apple/**"
19
- - "crates/smbcloud-auth-sdk/**"
20
- - "crates/smbcloud-model/**"
21
- - "crates/smbcloud-network/**"
22
- pull_request:
23
- paths:
24
- - ".github/workflows/verify-sdk-apple.yml"
25
- - "Cargo.toml"
26
- - "Cargo.lock"
27
- - "rust-toolchain.toml"
28
- - "crates/smbcloud-auth-sdk-apple/**"
29
- - "crates/smbcloud-auth-sdk/**"
30
- - "crates/smbcloud-model/**"
31
- - "crates/smbcloud-network/**"
32
- workflow_dispatch:
33
-
34
-permissions:
35
- contents: read
36
-
37
-env:
38
- CARGO_TERM_COLOR: always
39
- XCFRAMEWORK_NAME: smbcloud_authFFI.xcframework
40
- STATIC_LIB_NAME: libsmbcloud_auth.a
41
-
42
-jobs:
43
- verify-sdk-apple:
44
- name: Verify smbcloud-auth-sdk-apple
45
- runs-on: macos-latest
46
-
47
- steps:
48
- - name: Checkout
49
- uses: actions/checkout@v6
50
-
51
- - name: Read Rust toolchain
52
- shell: bash
53
- run: |
54
- rust_toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n 1)"
55
- if [ -z "${rust_toolchain}" ]; then
56
- echo "Failed to read Rust toolchain from rust-toolchain.toml" >&2
57
- exit 1
58
- fi
59
-
60
- echo "RUST_TOOLCHAIN=${rust_toolchain}" >> "$GITHUB_ENV"
61
-
62
- - name: Install stable Rust with Apple targets
63
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
64
- with:
65
- toolchain: ${{ env.RUST_TOOLCHAIN }}
66
- targets: aarch64-apple-ios,aarch64-apple-ios-sim,aarch64-apple-darwin
67
-
68
- - name: Install nightly Rust with Apple targets
69
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
70
- with:
71
- toolchain: nightly
72
- components: rust-src
73
- targets: aarch64-apple-tvos,aarch64-apple-tvos-sim,aarch64-apple-visionos,aarch64-apple-visionos-sim
74
-
75
- - name: Setup Rust cache
76
- uses: Swatinem/rust-cache@v2
77
- with:
78
- key: verify-sdk-apple
79
-
80
- - name: Build UniFFI bindgen helper
81
- shell: bash
82
- run: |
83
- cargo +"${RUST_TOOLCHAIN}" build \
84
- --manifest-path crates/smbcloud-auth-sdk-apple/Cargo.toml \
85
- --features bindgen \
86
- --bin uniffi-bindgen \
87
- --release
88
-
89
- - name: Build Apple bridge static libraries
90
- shell: bash
91
- run: |
92
- set -euo pipefail
93
-
94
- IPHONEOS_DEPLOYMENT_TARGET=16.0 cargo +"${RUST_TOOLCHAIN}" rustc \
95
- --manifest-path Cargo.toml \
96
- --package smbcloud-auth-sdk-apple \
97
- --target aarch64-apple-ios \
98
- --release \
99
- --lib \
100
- --crate-type staticlib
101
-
102
- IPHONEOS_DEPLOYMENT_TARGET=16.0 cargo +"${RUST_TOOLCHAIN}" rustc \
103
- --manifest-path Cargo.toml \
104
- --package smbcloud-auth-sdk-apple \
105
- --target aarch64-apple-ios-sim \
106
- --release \
107
- --lib \
108
- --crate-type staticlib
109
-
110
- MACOSX_DEPLOYMENT_TARGET=14.0 cargo +"${RUST_TOOLCHAIN}" rustc \
111
- --manifest-path Cargo.toml \
112
- --package smbcloud-auth-sdk-apple \
113
- --target aarch64-apple-darwin \
114
- --release \
115
- --lib \
116
- --crate-type staticlib
117
-
118
- TVOS_DEPLOYMENT_TARGET=16.0 cargo +nightly rustc -Z build-std \
119
- --manifest-path Cargo.toml \
120
- --package smbcloud-auth-sdk-apple \
121
- --target aarch64-apple-tvos \
122
- --release \
123
- --lib \
124
- --crate-type staticlib
125
-
126
- TVOS_DEPLOYMENT_TARGET=16.0 cargo +nightly rustc -Z build-std \
127
- --manifest-path Cargo.toml \
128
- --package smbcloud-auth-sdk-apple \
129
- --target aarch64-apple-tvos-sim \
130
- --release \
131
- --lib \
132
- --crate-type staticlib
133
-
134
- XROS_DEPLOYMENT_TARGET=1.0 cargo +nightly rustc -Z build-std \
135
- --manifest-path Cargo.toml \
136
- --package smbcloud-auth-sdk-apple \
137
- --target aarch64-apple-visionos \
138
- --release \
139
- --lib \
140
- --crate-type staticlib
141
-
142
- XROS_DEPLOYMENT_TARGET=1.0 cargo +nightly rustc -Z build-std \
143
- --manifest-path Cargo.toml \
144
- --package smbcloud-auth-sdk-apple \
145
- --target aarch64-apple-visionos-sim \
146
- --release \
147
- --lib \
148
- --crate-type staticlib
149
-
150
- - name: Generate Swift bindings and assemble XCFramework
151
- id: package
152
- shell: bash
153
- run: |
154
- set -euo pipefail
155
-
156
- build_root="${RUNNER_TEMP}/sdk-apple-build"
157
- generated_dir="${build_root}/generated"
158
- headers_dir="${build_root}/Headers"
159
- frameworks_dir="${build_root}/frameworks"
160
- output_dir="${GITHUB_WORKSPACE}/dist/sdk-apple"
161
- output_xcframework="${output_dir}/${XCFRAMEWORK_NAME}"
162
- bindgen_bin="${GITHUB_WORKSPACE}/target/release/uniffi-bindgen"
163
-
164
- rm -rf "${build_root}" "${output_dir}"
165
- mkdir -p "${generated_dir}" "${headers_dir}" "${frameworks_dir}" "${output_dir}"
166
-
167
- "${bindgen_bin}" generate \
168
- --library "${GITHUB_WORKSPACE}/target/aarch64-apple-ios/release/${STATIC_LIB_NAME}" \
169
- --language swift \
170
- --out-dir "${generated_dir}"
171
-
172
- cp "${generated_dir}/smbcloud_auth.swift" "${output_dir}/smbcloud_auth.swift"
173
- cp "${generated_dir}/smbcloud_authFFI.h" "${headers_dir}/smbcloud_authFFI.h"
174
- cp "${generated_dir}/smbcloud_authFFI.h" "${output_dir}/smbcloud_authFFI.h"
175
-
176
- stage_framework() {
177
- local lib_input="$1"
178
- local framework_output="$2"
179
-
180
- rm -rf "${framework_output}"
181
- mkdir -p "${framework_output}/Headers" "${framework_output}/Modules"
182
-
183
- cp "${lib_input}" "${framework_output}/smbcloud_authFFI"
184
- cp "${headers_dir}/smbcloud_authFFI.h" "${framework_output}/Headers/smbcloud_authFFI.h"
185
-
186
- printf '%s\n' \
187
- 'framework module smbcloud_authFFI {' \
188
- ' header "smbcloud_authFFI.h"' \
189
- ' export *' \
190
- ' use "Darwin"' \
191
- ' use "_Builtin_stdbool"' \
192
- ' use "_Builtin_stdint"' \
193
- '}' \
194
- > "${framework_output}/Modules/module.modulemap"
195
-
196
- printf '%s\n' \
197
- '<?xml version="1.0" encoding="UTF-8"?>' \
198
- '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">' \
199
- '<plist version="1.0">' \
200
- '<dict>' \
201
- ' <key>CFBundleIdentifier</key>' \
202
- ' <string>xyz.smbcloud.smbcloud-auth-ffi</string>' \
203
- ' <key>CFBundleName</key>' \
204
- ' <string>smbcloud_authFFI</string>' \
205
- ' <key>CFBundleExecutable</key>' \
206
- ' <string>smbcloud_authFFI</string>' \
207
- ' <key>CFBundlePackageType</key>' \
208
- ' <string>FMWK</string>' \
209
- ' <key>CFBundleShortVersionString</key>' \
210
- ' <string>dev</string>' \
211
- ' <key>CFBundleVersion</key>' \
212
- ' <string>1</string>' \
213
- '</dict>' \
214
- '</plist>' \
215
- > "${framework_output}/Info.plist"
216
- }
217
-
218
- stage_framework \
219
- "${GITHUB_WORKSPACE}/target/aarch64-apple-ios/release/${STATIC_LIB_NAME}" \
220
- "${frameworks_dir}/ios/smbcloud_authFFI.framework"
221
- stage_framework \
222
- "${GITHUB_WORKSPACE}/target/aarch64-apple-ios-sim/release/${STATIC_LIB_NAME}" \
223
- "${frameworks_dir}/ios-sim/smbcloud_authFFI.framework"
224
- stage_framework \
225
- "${GITHUB_WORKSPACE}/target/aarch64-apple-darwin/release/${STATIC_LIB_NAME}" \
226
- "${frameworks_dir}/macos/smbcloud_authFFI.framework"
227
- stage_framework \
228
- "${GITHUB_WORKSPACE}/target/aarch64-apple-tvos/release/${STATIC_LIB_NAME}" \
229
- "${frameworks_dir}/tvos/smbcloud_authFFI.framework"
230
- stage_framework \
231
- "${GITHUB_WORKSPACE}/target/aarch64-apple-tvos-sim/release/${STATIC_LIB_NAME}" \
232
- "${frameworks_dir}/tvos-sim/smbcloud_authFFI.framework"
233
- stage_framework \
234
- "${GITHUB_WORKSPACE}/target/aarch64-apple-visionos/release/${STATIC_LIB_NAME}" \
235
- "${frameworks_dir}/visionos/smbcloud_authFFI.framework"
236
- stage_framework \
237
- "${GITHUB_WORKSPACE}/target/aarch64-apple-visionos-sim/release/${STATIC_LIB_NAME}" \
238
- "${frameworks_dir}/visionos-sim/smbcloud_authFFI.framework"
239
-
240
- xcodebuild -create-xcframework \
241
- -framework "${frameworks_dir}/ios/smbcloud_authFFI.framework" \
242
- -framework "${frameworks_dir}/ios-sim/smbcloud_authFFI.framework" \
243
- -framework "${frameworks_dir}/macos/smbcloud_authFFI.framework" \
244
- -framework "${frameworks_dir}/tvos/smbcloud_authFFI.framework" \
245
- -framework "${frameworks_dir}/tvos-sim/smbcloud_authFFI.framework" \
246
- -framework "${frameworks_dir}/visionos/smbcloud_authFFI.framework" \
247
- -framework "${frameworks_dir}/visionos-sim/smbcloud_authFFI.framework" \
248
- -output "${output_xcframework}"
249
-
250
- ditto -c -k --sequesterRsrc --keepParent \
251
- "${output_xcframework}" \
252
- "${output_dir}/${XCFRAMEWORK_NAME}.zip"
253
-
254
- echo "artifact_dir=${output_dir}" >> "$GITHUB_OUTPUT"
255
-
256
- - name: Upload Apple bridge artifacts
257
- uses: actions/upload-artifact@v7
258
- with:
259
- name: sdk-apple-artifacts
260
- path: ${{ steps.package.outputs.artifact_dir }}
261
-
262
- - name: Publish summary
263
- shell: bash
264
- run: |
265
- cat <<EOF >> "$GITHUB_STEP_SUMMARY"
266
- ## Apple bridge SDK verification
267
-
268
- Verified crate: `smbcloud-auth-sdk-apple`
269
-
270
- Generated artifacts:
271
- - UniFFI Swift bindings
272
- - smbcloud_authFFI XCFramework
273
- - zipped XCFramework artifact
274
- EOF
Cargo.lock
+8
-393
@@ -104,61 +104,6 @@ version = "1.0.102"
104
source = "registry+https://github.com/rust-lang/crates.io-index"
105
checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
106
107
-[[package]]
108
-name = "askama"
109
-version = "0.14.0"
110
-source = "registry+https://github.com/rust-lang/crates.io-index"
111
-checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4"
112
-dependencies = [
113
- "askama_derive",
114
- "itoa",
115
- "percent-encoding",
116
- "serde",
117
- "serde_json",
118
-]
119
-
120
-[[package]]
121
-name = "askama_derive"
122
-version = "0.14.0"
123
-source = "registry+https://github.com/rust-lang/crates.io-index"
124
-checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f"
125
-dependencies = [
126
- "askama_parser",
127
- "basic-toml",
128
- "memchr",
129
- "proc-macro2",
130
- "quote",
131
- "rustc-hash",
132
- "serde",
133
- "serde_derive",
134
- "syn 2.0.117",
135
-]
136
-
137
-[[package]]
138
-name = "askama_parser"
139
-version = "0.14.0"
140
-source = "registry+https://github.com/rust-lang/crates.io-index"
141
-checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358"
142
-dependencies = [
143
- "memchr",
144
- "serde",
145
- "serde_derive",
146
- "winnow 0.7.15",
147
-]
148
-
149
-[[package]]
150
-name = "async-compat"
151
-version = "0.2.5"
152
-source = "registry+https://github.com/rust-lang/crates.io-index"
153
-checksum = "a1ba85bc55464dcbf728b56d97e119d673f4cf9062be330a9a26f3acf504a590"
154
-dependencies = [
155
- "futures-core",
156
- "futures-io",
157
- "once_cell",
158
- "pin-project-lite",
159
- "tokio",
160
-]
161
-
107
[[package]]
108
name = "async-trait"
109
version = "0.1.89"
@@ -199,15 +144,6 @@ version = "0.22.1"
144
source = "registry+https://github.com/rust-lang/crates.io-index"
145
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
146
202
-[[package]]
203
-name = "basic-toml"
204
-version = "0.1.10"
205
-source = "registry+https://github.com/rust-lang/crates.io-index"
206
-checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a"
207
-dependencies = [
208
- "serde",
209
-]
210
-
147
[[package]]
148
name = "bitflags"
149
version = "1.3.2"
@@ -262,38 +198,6 @@ version = "1.11.1"
198
source = "registry+https://github.com/rust-lang/crates.io-index"
199
checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
200
265
-[[package]]
266
-name = "camino"
267
-version = "1.2.2"
268
-source = "registry+https://github.com/rust-lang/crates.io-index"
269
-checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48"
270
-dependencies = [
271
- "serde_core",
272
-]
273
-
274
-[[package]]
275
-name = "cargo-platform"
276
-version = "0.1.9"
277
-source = "registry+https://github.com/rust-lang/crates.io-index"
278
-checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea"
279
-dependencies = [
280
- "serde",
281
-]
282
-
283
-[[package]]
284
-name = "cargo_metadata"
285
-version = "0.19.2"
286
-source = "registry+https://github.com/rust-lang/crates.io-index"
287
-checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba"
288
-dependencies = [
289
- "camino",
290
- "cargo-platform",
291
- "semver",
292
- "serde",
293
- "serde_json",
294
- "thiserror 2.0.18",
295
-]
296
-
201
[[package]]
202
name = "cassowary"
203
version = "0.3.0"
@@ -368,7 +272,7 @@ dependencies = [
272
"atty",
273
"bitflags 1.3.2",
274
"strsim 0.8.0",
371
- "textwrap 0.11.0",
275
+ "textwrap",
276
"unicode-width 0.1.14",
277
"vec_map",
278
]
@@ -768,15 +672,6 @@ dependencies = [
672
"percent-encoding",
673
]
674
771
-[[package]]
772
-name = "fs-err"
773
-version = "2.11.0"
774
-source = "registry+https://github.com/rust-lang/crates.io-index"
775
-checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41"
776
-dependencies = [
777
- "autocfg",
778
-]
779
-
675
[[package]]
676
name = "futures-channel"
677
version = "0.3.32"
@@ -793,12 +688,6 @@ version = "0.3.32"
688
source = "registry+https://github.com/rust-lang/crates.io-index"
689
checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
690
796
-[[package]]
797
-name = "futures-io"
798
-version = "0.3.32"
799
-source = "registry+https://github.com/rust-lang/crates.io-index"
800
-checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718"
801
-
691
[[package]]
692
name = "futures-sink"
693
version = "0.3.32"
@@ -913,23 +802,6 @@ dependencies = [
802
"url",
803
]
804
916
-[[package]]
917
-name = "glob"
918
-version = "0.3.3"
919
-source = "registry+https://github.com/rust-lang/crates.io-index"
920
-checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
921
-
922
-[[package]]
923
-name = "goblin"
924
-version = "0.8.2"
925
-source = "registry+https://github.com/rust-lang/crates.io-index"
926
-checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47"
927
-dependencies = [
928
- "log",
929
- "plain",
930
- "scroll",
931
-]
932
-
805
[[package]]
806
name = "hashbrown"
807
version = "0.15.5"
@@ -1538,12 +1410,6 @@ dependencies = [
1410
"autocfg",
1411
]
1412
1541
-[[package]]
1542
-name = "minimal-lexical"
1543
-version = "0.2.1"
1544
-source = "registry+https://github.com/rust-lang/crates.io-index"
1545
-checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
1546
-
1413
[[package]]
1414
name = "mio"
1415
version = "1.2.1"
@@ -1573,16 +1439,6 @@ dependencies = [
1439
"tempfile",
1440
]
1441
1576
-[[package]]
1577
-name = "nom"
1578
-version = "7.1.3"
1579
-source = "registry+https://github.com/rust-lang/crates.io-index"
1580
-checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
1581
-dependencies = [
1582
- "memchr",
1583
- "minimal-lexical",
1584
-]
1585
-
1442
[[package]]
1443
name = "nu-ansi-term"
1444
version = "0.50.3"
@@ -1802,12 +1658,6 @@ version = "0.3.33"
1658
source = "registry+https://github.com/rust-lang/crates.io-index"
1659
checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e"
1660
1805
-[[package]]
1806
-name = "plain"
1807
-version = "0.2.3"
1808
-source = "registry+https://github.com/rust-lang/crates.io-index"
1809
-checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
1810
-
1661
[[package]]
1662
name = "portable-atomic"
1663
version = "1.13.1"
@@ -2389,26 +2239,6 @@ version = "1.2.0"
2239
source = "registry+https://github.com/rust-lang/crates.io-index"
2240
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
2241
2392
-[[package]]
2393
-name = "scroll"
2394
-version = "0.12.0"
2395
-source = "registry+https://github.com/rust-lang/crates.io-index"
2396
-checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
2397
-dependencies = [
2398
- "scroll_derive",
2399
-]
2400
-
2401
-[[package]]
2402
-name = "scroll_derive"
2403
-version = "0.12.1"
2404
-source = "registry+https://github.com/rust-lang/crates.io-index"
2405
-checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d"
2406
-dependencies = [
2407
- "proc-macro2",
2408
- "quote",
2409
- "syn 2.0.117",
2410
-]
2411
-
2242
[[package]]
2243
name = "security-framework"
2244
version = "3.7.0"
@@ -2437,10 +2267,6 @@ name = "semver"
2267
version = "1.0.28"
2268
source = "registry+https://github.com/rust-lang/crates.io-index"
2269
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
2440
-dependencies = [
2441
- "serde",
2442
- "serde_core",
2443
-]
2270
2271
[[package]]
2272
name = "serde"
@@ -2516,15 +2342,6 @@ dependencies = [
2342
"serde",
2343
]
2344
2519
-[[package]]
2520
-name = "serde_spanned"
2521
-version = "1.1.1"
2522
-source = "registry+https://github.com/rust-lang/crates.io-index"
2523
-checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26"
2524
-dependencies = [
2525
- "serde_core",
2526
-]
2527
-
2345
[[package]]
2346
name = "serde_urlencoded"
2347
version = "0.7.1"
@@ -2629,12 +2446,6 @@ version = "1.15.1"
2446
source = "registry+https://github.com/rust-lang/crates.io-index"
2447
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
2448
2632
-[[package]]
2633
-name = "smawk"
2634
-version = "0.3.2"
2635
-source = "registry+https://github.com/rust-lang/crates.io-index"
2636
-checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
2637
-
2449
[[package]]
2450
name = "smbcloud-auth"
2451
version = "0.4.3"
@@ -2665,17 +2476,6 @@ dependencies = [
2476
"uuid",
2477
]
2478
2668
-[[package]]
2669
-name = "smbcloud-auth-sdk-apple"
2670
-version = "0.4.3"
2671
-dependencies = [
2672
- "smbcloud-auth-sdk",
2673
- "smbcloud-model",
2674
- "smbcloud-network",
2675
- "thiserror 2.0.18",
2676
- "uniffi",
2677
-]
2678
-
2479
[[package]]
2480
name = "smbcloud-auth-sdk-py"
2481
version = "0.4.3"
@@ -2739,7 +2539,7 @@ dependencies = [
2539
"tempfile",
2540
"thiserror 2.0.18",
2541
"tokio",
2742
- "toml 0.8.23",
2542
+ "toml",
2543
"tracing",
2544
"tracing-bunyan-formatter",
2545
"tracing-subscriber",
@@ -2857,7 +2657,7 @@ dependencies = [
2657
"serde",
2658
"serde_json",
2659
"smbcloud-model",
2860
- "toml 0.8.23",
2660
+ "toml",
2661
]
2662
2663
[[package]]
@@ -3120,15 +2920,6 @@ dependencies = [
2920
"unicode-width 0.1.14",
2921
]
2922
3123
-[[package]]
3124
-name = "textwrap"
3125
-version = "0.16.2"
3126
-source = "registry+https://github.com/rust-lang/crates.io-index"
3127
-checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057"
3128
-dependencies = [
3129
- "smawk",
3130
-]
3131
-
2923
[[package]]
2924
name = "thiserror"
2925
version = "1.0.69"
@@ -3328,26 +3119,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
3119
checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
3120
dependencies = [
3121
"serde",
3331
- "serde_spanned 0.6.9",
3332
- "toml_datetime 0.6.11",
3122
+ "serde_spanned",
3123
+ "toml_datetime",
3124
"toml_edit",
3125
]
3126
3336
-[[package]]
3337
-name = "toml"
3338
-version = "0.9.12+spec-1.1.0"
3339
-source = "registry+https://github.com/rust-lang/crates.io-index"
3340
-checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863"
3341
-dependencies = [
3342
- "indexmap",
3343
- "serde_core",
3344
- "serde_spanned 1.1.1",
3345
- "toml_datetime 0.7.5+spec-1.1.0",
3346
- "toml_parser",
3347
- "toml_writer",
3348
- "winnow 0.7.15",
3349
-]
3350
-
3127
[[package]]
3128
name = "toml_datetime"
3129
version = "0.6.11"
@@ -3357,15 +3133,6 @@ dependencies = [
3133
"serde",
3134
]
3135
3360
-[[package]]
3361
-name = "toml_datetime"
3362
-version = "0.7.5+spec-1.1.0"
3363
-source = "registry+https://github.com/rust-lang/crates.io-index"
3364
-checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347"
3365
-dependencies = [
3366
- "serde_core",
3367
-]
3368
-
3136
[[package]]
3137
name = "toml_edit"
3138
version = "0.22.27"
@@ -3374,19 +3141,10 @@ checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
3141
dependencies = [
3142
"indexmap",
3143
"serde",
3377
- "serde_spanned 0.6.9",
3378
- "toml_datetime 0.6.11",
3144
+ "serde_spanned",
3145
+ "toml_datetime",
3146
"toml_write",
3380
- "winnow 0.7.15",
3381
-]
3382
-
3383
-[[package]]
3384
-name = "toml_parser"
3385
-version = "1.1.2+spec-1.1.0"
3386
-source = "registry+https://github.com/rust-lang/crates.io-index"
3387
-checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526"
3388
-dependencies = [
3389
- "winnow 1.0.3",
3147
+ "winnow",
3148
]
3149
3150
[[package]]
@@ -3395,12 +3153,6 @@ version = "0.1.2"
3153
source = "registry+https://github.com/rust-lang/crates.io-index"
3154
checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
3155
3398
-[[package]]
3399
-name = "toml_writer"
3400
-version = "1.1.1+spec-1.1.0"
3401
-source = "registry+https://github.com/rust-lang/crates.io-index"
3402
-checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db"
3403
-
3156
[[package]]
3157
name = "tower"
3158
version = "0.5.3"
@@ -3633,128 +3385,6 @@ version = "0.2.6"
3385
source = "registry+https://github.com/rust-lang/crates.io-index"
3386
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
3387
3636
-[[package]]
3637
-name = "uniffi"
3638
-version = "0.31.1"
3639
-source = "registry+https://github.com/rust-lang/crates.io-index"
3640
-checksum = "dc5f2297ee5b893405bed1a6929faec4713a061df158ecf5198089f23910d470"
3641
-dependencies = [
3642
- "anyhow",
3643
- "camino",
3644
- "cargo_metadata",
3645
- "clap 4.6.1",
3646
- "uniffi_bindgen",
3647
- "uniffi_core",
3648
- "uniffi_macros",
3649
- "uniffi_pipeline",
3650
-]
3651
-
3652
-[[package]]
3653
-name = "uniffi_bindgen"
3654
-version = "0.31.1"
3655
-source = "registry+https://github.com/rust-lang/crates.io-index"
3656
-checksum = "8bc0c60a9607e7ab77a2ad47ec5530178015014839db25af7512447d2238016c"
3657
-dependencies = [
3658
- "anyhow",
3659
- "askama",
3660
- "camino",
3661
- "cargo_metadata",
3662
- "fs-err",
3663
- "glob",
3664
- "goblin",
3665
- "heck 0.5.0",
3666
- "indexmap",
3667
- "once_cell",
3668
- "serde",
3669
- "tempfile",
3670
- "textwrap 0.16.2",
3671
- "toml 0.9.12+spec-1.1.0",
3672
- "uniffi_internal_macros",
3673
- "uniffi_meta",
3674
- "uniffi_pipeline",
3675
- "uniffi_udl",
3676
-]
3677
-
3678
-[[package]]
3679
-name = "uniffi_core"
3680
-version = "0.31.1"
3681
-source = "registry+https://github.com/rust-lang/crates.io-index"
3682
-checksum = "77baf5d539fe2e1ad6805e942dbc5dbdeb2b83eb5f2b3a6535d422ca4b02a12f"
3683
-dependencies = [
3684
- "anyhow",
3685
- "async-compat",
3686
- "bytes",
3687
- "once_cell",
3688
- "static_assertions",
3689
-]
3690
-
3691
-[[package]]
3692
-name = "uniffi_internal_macros"
3693
-version = "0.31.1"
3694
-source = "registry+https://github.com/rust-lang/crates.io-index"
3695
-checksum = "b4b42137524f4be6400fcaca9d02c1d4ecb6ad917e4013c0b93235526d8396e5"
3696
-dependencies = [
3697
- "anyhow",
3698
- "indexmap",
3699
- "proc-macro2",
3700
- "quote",
3701
- "syn 2.0.117",
3702
-]
3703
-
3704
-[[package]]
3705
-name = "uniffi_macros"
3706
-version = "0.31.1"
3707
-source = "registry+https://github.com/rust-lang/crates.io-index"
3708
-checksum = "d9273ec45330d8fe9a3701b7b983cea7a4e218503359831967cb95d26b873561"
3709
-dependencies = [
3710
- "camino",
3711
- "fs-err",
3712
- "once_cell",
3713
- "proc-macro2",
3714
- "quote",
3715
- "serde",
3716
- "syn 2.0.117",
3717
- "toml 0.9.12+spec-1.1.0",
3718
- "uniffi_meta",
3719
-]
3720
-
3721
-[[package]]
3722
-name = "uniffi_meta"
3723
-version = "0.31.1"
3724
-source = "registry+https://github.com/rust-lang/crates.io-index"
3725
-checksum = "431d2f443e7828a6c29d188de98b6771a6491ee98bba2d4372643bf93f988a18"
3726
-dependencies = [
3727
- "anyhow",
3728
- "siphasher",
3729
- "uniffi_internal_macros",
3730
- "uniffi_pipeline",
3731
-]
3732
-
3733
-[[package]]
3734
-name = "uniffi_pipeline"
3735
-version = "0.31.1"
3736
-source = "registry+https://github.com/rust-lang/crates.io-index"
3737
-checksum = "761ef74f6175e15603d0424cc5f98854c5baccfe7bf4ccb08e5816f9ab8af689"
3738
-dependencies = [
3739
- "anyhow",
3740
- "heck 0.5.0",
3741
- "indexmap",
3742
- "tempfile",
3743
- "uniffi_internal_macros",
3744
-]
3745
-
3746
-[[package]]
3747
-name = "uniffi_udl"
3748
-version = "0.31.1"
3749
-source = "registry+https://github.com/rust-lang/crates.io-index"
3750
-checksum = "68773ec0e1c067b6505a73bbf6a5782f31a7f9209333a0df97b87565c46bf370"
3751
-dependencies = [
3752
- "anyhow",
3753
- "textwrap 0.16.2",
3754
- "uniffi_meta",
3755
- "weedle2",
3756
-]
3757
-
3388
[[package]]
3389
name = "unindent"
3390
version = "0.2.4"
@@ -4011,15 +3641,6 @@ dependencies = [
3641
"rustls-pki-types",
3642
]
3643
4014
-[[package]]
4015
-name = "weedle2"
4016
-version = "5.0.0"
4017
-source = "registry+https://github.com/rust-lang/crates.io-index"
4018
-checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e"
4019
-dependencies = [
4020
- "nom",
4021
-]
4022
-
3644
[[package]]
3645
name = "whoami"
3646
version = "2.1.2"
@@ -4363,12 +3984,6 @@ dependencies = [
3984
"memchr",
3985
]
3986
4366
-[[package]]
4367
-name = "winnow"
4368
-version = "1.0.3"
4369
-source = "registry+https://github.com/rust-lang/crates.io-index"
4370
-checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1"
4371
-
3987
[[package]]
3988
name = "wit-bindgen"
3989
version = "0.51.0"
crates/smbcloud-auth-sdk-apple/Cargo.toml
deleted
-29
@@ -1,29 +0,0 @@
1
-[package]
2
-name = "smbcloud-auth-sdk-apple"
3
-version = "0.4.3"
4
-edition = "2024"
5
-authors = ["Seto Elkahfi <hej@setoelkahfi.se>"]
6
-description = "Apple platform bindings for the smbCloud Auth SDK."
7
-license = "Apache-2.0"
8
-repository = "https://github.com/smbcloudXYZ/smbcloud-cli"
9
-publish = false
10
-
11
-[lib]
12
-name = "smbcloud_auth"
13
-crate-type = ["lib", "cdylib", "staticlib"]
14
-path = "src/smbcloud_auth_sdk_apple.rs"
15
-
16
-[[bin]]
17
-name = "uniffi-bindgen"
18
-path = "uniffi-bindgen.rs"
19
-required-features = ["bindgen"]
20
-
21
-[features]
22
-bindgen = ["uniffi/cli"]
23
-
24
-[dependencies]
25
-smbcloud-auth-sdk = { workspace = true }
26
-smbcloud-model = { workspace = true }
27
-smbcloud-network = { workspace = true }
28
-thiserror = { workspace = true }
29
-uniffi = { workspace = true, features = ["tokio"] }
crates/smbcloud-auth-sdk-apple/src/smbcloud_auth_sdk_apple.rs
deleted
-388
@@ -1,388 +0,0 @@
1
-uniffi::setup_scaffolding!();
2
-
3
-use smbcloud_auth_sdk::{
4
- apple, client_credentials::ClientCredentials, login, logout, me, oidc, remove, signup,
5
-};
6
-use smbcloud_model::error_codes::ErrorResponse;
7
-use smbcloud_network::environment::Environment;
8
-
9
-// ── Error ────────────────────────────────────────────────────────────────────
10
-
11
-#[derive(Debug, thiserror::Error, uniffi::Error)]
12
-pub enum SmbCloudAuthError {
13
- #[error("[{error_code}] {message}")]
14
- Api { error_code: i32, message: String },
15
-}
16
-
17
-impl From<ErrorResponse> for SmbCloudAuthError {
18
- fn from(error: ErrorResponse) -> Self {
19
- match error {
20
- ErrorResponse::Error {
21
- error_code,
22
- message,
23
- } => Self::Api {
24
- error_code: error_code as i32,
25
- message,
26
- },
27
- }
28
- }
29
-}
30
-
31
-// ── Environment ──────────────────────────────────────────────────────────────
32
-
33
-#[derive(uniffi::Enum)]
34
-pub enum SmbCloudEnvironment {
35
- Dev,
36
- Production,
37
-}
38
-
39
-impl From<SmbCloudEnvironment> for Environment {
40
- fn from(environment: SmbCloudEnvironment) -> Self {
41
- match environment {
42
- SmbCloudEnvironment::Dev => Self::Dev,
43
- SmbCloudEnvironment::Production => Self::Production,
44
- }
45
- }
46
-}
47
-
48
-// ── Account status ───────────────────────────────────────────────────────────
49
-
50
-#[derive(uniffi::Enum)]
51
-pub enum SmbCloudAccountStatus {
52
- NotFound,
53
- Ready { access_token: String },
54
- Incomplete { error_code: u32 },
55
-}
56
-
57
-impl From<smbcloud_model::login::AccountStatus> for SmbCloudAccountStatus {
58
- fn from(status: smbcloud_model::login::AccountStatus) -> Self {
59
- match status {
60
- smbcloud_model::login::AccountStatus::NotFound => Self::NotFound,
61
- smbcloud_model::login::AccountStatus::Ready { access_token } => {
62
- Self::Ready { access_token }
63
- }
64
- smbcloud_model::login::AccountStatus::Incomplete { status } => Self::Incomplete {
65
- error_code: status as u32,
66
- },
67
- }
68
- }
69
-}
70
-
71
-// ── User ─────────────────────────────────────────────────────────────────────
72
-
73
-#[derive(uniffi::Record)]
74
-pub struct SmbCloudUser {
75
- pub id: i32,
76
- pub email: String,
77
- pub created_at: String,
78
- pub updated_at: String,
79
-}
80
-
81
-impl From<smbcloud_model::account::User> for SmbCloudUser {
82
- fn from(user: smbcloud_model::account::User) -> Self {
83
- Self {
84
- id: user.id,
85
- email: user.email,
86
- created_at: user.created_at.to_rfc3339(),
87
- updated_at: user.updated_at.to_rfc3339(),
88
- }
89
- }
90
-}
91
-
92
-// ── Signup result ────────────────────────────────────────────────────────────
93
-
94
-#[derive(uniffi::Record)]
95
-pub struct SmbCloudSignupResult {
96
- pub code: Option<i32>,
97
- pub message: String,
98
- pub user_id: Option<i32>,
99
- pub user_email: Option<String>,
100
- pub user_created_at: Option<String>,
101
-}
102
-
103
-impl From<smbcloud_model::signup::SignupResult> for SmbCloudSignupResult {
104
- fn from(result: smbcloud_model::signup::SignupResult) -> Self {
105
- Self {
106
- code: result.code,
107
- message: result.message,
108
- user_id: result.data.as_ref().map(|data| data.id),
109
- user_email: result.data.as_ref().map(|data| data.email.clone()),
110
- user_created_at: result.data.map(|data| data.created_at),
111
- }
112
- }
113
-}
114
-
115
-// ── OIDC types ───────────────────────────────────────────────────────────────
116
-
117
-#[derive(uniffi::Record)]
118
-pub struct SmbCloudAuthorizationRequest {
119
- pub authorize_url: String,
120
- pub redirect_uri: String,
121
- pub state: String,
122
- pub code_verifier: String,
123
-}
124
-
125
-impl From<oidc::AuthorizationRequest> for SmbCloudAuthorizationRequest {
126
- fn from(request: oidc::AuthorizationRequest) -> Self {
127
- Self {
128
- authorize_url: request.authorize_url,
129
- redirect_uri: request.redirect_uri,
130
- state: request.state,
131
- code_verifier: request.code_verifier,
132
- }
133
- }
134
-}
135
-
136
-#[derive(uniffi::Record)]
137
-pub struct SmbCloudCallbackPayload {
138
- pub code: String,
139
- pub state: String,
140
-}
141
-
142
-impl From<oidc::CallbackPayload> for SmbCloudCallbackPayload {
143
- fn from(payload: oidc::CallbackPayload) -> Self {
144
- Self {
145
- code: payload.code,
146
- state: payload.state,
147
- }
148
- }
149
-}
150
-
151
-#[derive(uniffi::Record)]
152
-pub struct SmbCloudTokenResponse {
153
- pub access_token: String,
154
- pub token_type: String,
155
- pub expires_in: Option<i32>,
156
- pub refresh_token: Option<String>,
157
- pub scope: Option<String>,
158
- pub id_token: Option<String>,
159
-}
160
-
161
-impl From<oidc::TokenResponse> for SmbCloudTokenResponse {
162
- fn from(response: oidc::TokenResponse) -> Self {
163
- Self {
164
- access_token: response.access_token,
165
- token_type: response.token_type,
166
- expires_in: response.expires_in,
167
- refresh_token: response.refresh_token,
168
- scope: response.scope,
169
- id_token: response.id_token,
170
- }
171
- }
172
-}
173
-
174
-#[derive(uniffi::Record)]
175
-pub struct SmbCloudUserInfo {
176
- pub sub: String,
177
- pub email: Option<String>,
178
- pub email_verified: Option<bool>,
179
- pub tenant_id: Option<u64>,
180
- pub tenant_slug: Option<String>,
181
-}
182
-
183
-impl From<oidc::UserInfo> for SmbCloudUserInfo {
184
- fn from(info: oidc::UserInfo) -> Self {
185
- Self {
186
- sub: info.sub,
187
- email: info.email,
188
- email_verified: info.email_verified,
189
- tenant_id: info.tenant_id,
190
- tenant_slug: info.tenant_slug,
191
- }
192
- }
193
-}
194
-
195
-// ── Apple Sign-In types ──────────────────────────────────────────────────────
196
-
197
-#[derive(uniffi::Record)]
198
-pub struct SmbCloudAppleAuthorizationRequest {
199
- pub authorize_url: String,
200
- pub redirect_uri: String,
201
- pub state: String,
202
-}
203
-
204
-impl From<apple::AppleAuthorizationRequest> for SmbCloudAppleAuthorizationRequest {
205
- fn from(request: apple::AppleAuthorizationRequest) -> Self {
206
- Self {
207
- authorize_url: request.authorize_url,
208
- redirect_uri: request.redirect_uri,
209
- state: request.state,
210
- }
211
- }
212
-}
213
-
214
-#[derive(uniffi::Record)]
215
-pub struct SmbCloudAppleAuthSession {
216
- pub access_token: String,
217
- pub refresh_token: Option<String>,
218
- pub email: Option<String>,
219
- pub name: Option<String>,
220
- pub provider: String,
221
- pub provider_account_id: String,
222
- pub state: Option<String>,
223
-}
224
-
225
-impl From<apple::AppleAuthSession> for SmbCloudAppleAuthSession {
226
- fn from(session: apple::AppleAuthSession) -> Self {
227
- Self {
228
- access_token: session.access_token,
229
- refresh_token: session.refresh_token,
230
- email: session.email,
231
- name: session.name,
232
- provider: session.provider,
233
- provider_account_id: session.provider_account_id,
234
- state: session.state,
235
- }
236
- }
237
-}
238
-
239
-// ── Main client object ──────────────────────────────────────────────────────
240
-
241
-#[derive(uniffi::Object)]
242
-pub struct SmbCloudAuth {
243
- environment: Environment,
244
- app_id: String,
245
- app_secret: String,
246
-}
247
-
248
-impl SmbCloudAuth {
249
- fn credentials(&self) -> ClientCredentials<'_> {
250
- ClientCredentials {
251
- app_id: &self.app_id,
252
- app_secret: &self.app_secret,
253
- }
254
- }
255
-}
256
-
257
-#[uniffi::export]
258
-impl SmbCloudAuth {
259
- #[uniffi::constructor]
260
- pub fn new(environment: SmbCloudEnvironment, app_id: String, app_secret: String) -> Self {
261
- Self {
262
- environment: environment.into(),
263
- app_id,
264
- app_secret,
265
- }
266
- }
267
-
268
- // ── Email/password auth ──────────────────────────────────────────────
269
-
270
- pub async fn login(
271
- &self,
272
- email: String,
273
- password: String,
274
- ) -> Result<SmbCloudAccountStatus, SmbCloudAuthError> {
275
- login::login_with_client(self.environment, self.credentials(), email, password)
276
- .await
277
- .map(Into::into)
278
- .map_err(Into::into)
279
- }
280
-
281
- pub async fn signup(
282
- &self,
283
- email: String,
284
- password: String,
285
- ) -> Result<SmbCloudSignupResult, SmbCloudAuthError> {
286
- signup::signup_with_client(self.environment, self.credentials(), email, password)
287
- .await
288
- .map(Into::into)
289
- .map_err(Into::into)
290
- }
291
-
292
- pub async fn logout(&self, access_token: String) -> Result<(), SmbCloudAuthError> {
293
- logout::logout_with_client(self.environment, self.credentials(), access_token)
294
- .await
295
- .map_err(Into::into)
296
- }
297
-
298
- pub async fn me(&self, access_token: String) -> Result<SmbCloudUser, SmbCloudAuthError> {
299
- me::me_with_client(self.environment, self.credentials(), &access_token)
300
- .await
301
- .map(Into::into)
302
- .map_err(Into::into)
303
- }
304
-
305
- pub async fn remove_account(&self, access_token: String) -> Result<(), SmbCloudAuthError> {
306
- remove::remove_with_client(self.environment, self.credentials(), &access_token)
307
- .await
308
- .map_err(Into::into)
309
- }
310
-
311
- // ── Apple Sign-In ────────────────────────────────────────────────────
312
-
313
- pub fn build_apple_authorization_request(
314
- &self,
315
- redirect_uri: String,
316
- state: Option<String>,
317
- ) -> Result<SmbCloudAppleAuthorizationRequest, SmbCloudAuthError> {
318
- apple::build_authorization_request_with_client(
319
- self.environment,
320
- self.credentials(),
321
- redirect_uri,
322
- state,
323
- )
324
- .map(Into::into)
325
- .map_err(Into::into)
326
- }
327
-
328
- pub fn parse_apple_callback_url(
329
- &self,
330
- callback_url: String,
331
- expected_state: Option<String>,
332
- ) -> Result<SmbCloudAppleAuthSession, SmbCloudAuthError> {
333
- apple::parse_callback_url(&callback_url, expected_state.as_deref())
334
- .map(Into::into)
335
- .map_err(Into::into)
336
- }
337
-
338
- // ── OIDC ─────────────────────────────────────────────────────────────
339
-
340
- pub fn build_oidc_authorization_request(
341
- &self,
342
- oidc_client_id: String,
343
- redirect_uri: String,
344
- ) -> Result<SmbCloudAuthorizationRequest, SmbCloudAuthError> {
345
- oidc::build_authorization_request(self.environment, &oidc_client_id, redirect_uri)
346
- .map(Into::into)
347
- .map_err(Into::into)
348
- }
349
-
350
- pub fn parse_oidc_callback_url(
351
- &self,
352
- callback_url: String,
353
- ) -> Result<SmbCloudCallbackPayload, SmbCloudAuthError> {
354
- oidc::parse_callback_url(&callback_url)
355
- .map(Into::into)
356
- .map_err(Into::into)
357
- }
358
-
359
- pub async fn exchange_oidc_code(
360
- &self,
361
- oidc_client_id: String,
362
- redirect_uri: String,
363
- code: String,
364
- code_verifier: String,
365
- ) -> Result<SmbCloudTokenResponse, SmbCloudAuthError> {
366
- oidc::exchange_code(
367
- self.environment,
368
- &oidc_client_id,
369
- &redirect_uri,
370
- &code,
371
- &code_verifier,
372
- )
373
- .await
374
- .map(Into::into)
375
- .map_err(Into::into)
376
- }
377
-
378
- pub async fn get_oidc_userinfo(
379
- &self,
380
- access_token: String,
381
- tenant_id: Option<String>,
382
- ) -> Result<SmbCloudUserInfo, SmbCloudAuthError> {
383
- oidc::get_userinfo(self.environment, &access_token, tenant_id.as_deref())
384
- .await
385
- .map(Into::into)
386
- .map_err(Into::into)
387
- }
388
-}
crates/smbcloud-auth-sdk-apple/uniffi-bindgen.rs
deleted
-3
@@ -1,3 +0,0 @@
1
-fn main() {
2
- uniffi::uniffi_bindgen_main()
3
-}