@smbcloud / cli / commits / d67b5fe

Migrate Ruby gem to smbcloud-auth-sdk and clean up deps

- Switch native extension to use smbcloud-auth-sdk crate - Remove unused smbcloud-networking dependency - Update Cargo.lock to reflect new dependency graph - Add .rubocop.yml for consistent Ruby linting - Minor gemspec style fixes

keypair34 committed Apr 11, 2026 at 19:29 UTC d67b5fe8519ca7d313da9c2eb17e7d7767c740d5
5 files changed +41 -294
sdk/gems/auth/.rubocop.yml new
+21
@@ -0,0 +1,21 @@
1 +AllCops:
2 + TargetRubyVersion: 3.1
3 + NewCops: enable
4 + Exclude:
5 + - "vendor/**/*"
6 + - "tmp/**/*"
7 + - "target/**/*"
8 + - "pkg/**/*"
9 +
10 +# Native extension wrapper gems use a bare `module Auth; end` stub at the
11 +# top level so Magnus can register the native methods into the right namespace.
12 +# Having both that stub and the real `SmbCloud::Auth` implementation in one
13 +# file is intentional — splitting them would break the require chain.
14 +Style/OneClassPerFile:
15 + Enabled: false
16 +
17 +# Yard / CHANGELOG serve as the documentation source for this gem.
18 +# Requiring top-level doc comments on every module and class adds noise
19 +# without benefit for a thin wrapper library.
20 +Style/Documentation:
21 + Enabled: false
sdk/gems/auth/Cargo.lock
+6 -283
@@ -109,10 +109,9 @@ dependencies = [
109 "magnus",
110 "serde",
111 "serde_json",
112 - "smbcloud-auth",
112 + "smbcloud-auth-sdk",
113 "smbcloud-model",
114 "smbcloud-network",
115 - "smbcloud-networking",
115 "tokio",
116 ]
117
@@ -307,16 +306,6 @@ dependencies = [
306 "unicode-segmentation",
307 ]
308
310 -[[package]]
311 -name = "core-foundation"
312 -version = "0.9.4"
313 -source = "registry+https://github.com/rust-lang/crates.io-index"
314 -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
315 -dependencies = [
316 - "core-foundation-sys",
317 - "libc",
318 -]
319 -
309 [[package]]
310 name = "core-foundation"
311 version = "0.10.1"
@@ -379,70 +368,24 @@ version = "1.15.0"
368 source = "registry+https://github.com/rust-lang/crates.io-index"
369 checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
370
382 -[[package]]
383 -name = "encoding_rs"
384 -version = "0.8.35"
385 -source = "registry+https://github.com/rust-lang/crates.io-index"
386 -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
387 -dependencies = [
388 - "cfg-if",
389 -]
390 -
371 [[package]]
372 name = "equivalent"
373 version = "1.0.2"
374 source = "registry+https://github.com/rust-lang/crates.io-index"
375 checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
376
397 -[[package]]
398 -name = "errno"
399 -version = "0.3.14"
400 -source = "registry+https://github.com/rust-lang/crates.io-index"
401 -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
402 -dependencies = [
403 - "libc",
404 - "windows-sys 0.61.2",
405 -]
406 -
407 -[[package]]
408 -name = "fastrand"
409 -version = "2.3.0"
410 -source = "registry+https://github.com/rust-lang/crates.io-index"
411 -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
412 -
377 [[package]]
378 name = "find-msvc-tools"
379 version = "0.1.9"
380 source = "registry+https://github.com/rust-lang/crates.io-index"
381 checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
382
419 -[[package]]
420 -name = "fnv"
421 -version = "1.0.7"
422 -source = "registry+https://github.com/rust-lang/crates.io-index"
423 -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
424 -
383 [[package]]
384 name = "foldhash"
385 version = "0.1.5"
386 source = "registry+https://github.com/rust-lang/crates.io-index"
387 checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
388
431 -[[package]]
432 -name = "foreign-types"
433 -version = "0.3.2"
434 -source = "registry+https://github.com/rust-lang/crates.io-index"
435 -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
436 -dependencies = [
437 - "foreign-types-shared",
438 -]
439 -
440 -[[package]]
441 -name = "foreign-types-shared"
442 -version = "0.1.1"
443 -source = "registry+https://github.com/rust-lang/crates.io-index"
444 -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
445 -
389 [[package]]
390 name = "form_urlencoded"
391 version = "1.2.2"
@@ -467,12 +410,6 @@ version = "0.3.32"
410 source = "registry+https://github.com/rust-lang/crates.io-index"
411 checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
412
470 -[[package]]
471 -name = "futures-sink"
472 -version = "0.3.32"
473 -source = "registry+https://github.com/rust-lang/crates.io-index"
474 -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893"
475 -
413 [[package]]
414 name = "futures-task"
415 version = "0.3.32"
@@ -560,25 +497,6 @@ version = "0.3.3"
497 source = "registry+https://github.com/rust-lang/crates.io-index"
498 checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
499
563 -[[package]]
564 -name = "h2"
565 -version = "0.4.13"
566 -source = "registry+https://github.com/rust-lang/crates.io-index"
567 -checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54"
568 -dependencies = [
569 - "atomic-waker",
570 - "bytes",
571 - "fnv",
572 - "futures-core",
573 - "futures-sink",
574 - "http",
575 - "indexmap",
576 - "slab",
577 - "tokio",
578 - "tokio-util",
579 - "tracing",
580 -]
581 -
500 [[package]]
501 name = "hashbrown"
502 version = "0.15.5"
@@ -673,7 +591,6 @@ dependencies = [
591 "bytes",
592 "futures-channel",
593 "futures-core",
676 - "h2",
594 "http",
595 "http-body",
596 "httparse",
@@ -702,22 +619,6 @@ dependencies = [
619 "tower-service",
620 ]
621
705 -[[package]]
706 -name = "hyper-tls"
707 -version = "0.6.0"
708 -source = "registry+https://github.com/rust-lang/crates.io-index"
709 -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
710 -dependencies = [
711 - "bytes",
712 - "http-body-util",
713 - "hyper",
714 - "hyper-util",
715 - "native-tls",
716 - "tokio",
717 - "tokio-native-tls",
718 - "tower-service",
719 -]
720 -
622 [[package]]
623 name = "hyper-util"
624 version = "0.1.20"
@@ -736,11 +637,9 @@ dependencies = [
637 "percent-encoding",
638 "pin-project-lite",
639 "socket2",
739 - "system-configuration",
640 "tokio",
641 "tower-service",
642 "tracing",
743 - "windows-registry",
643 ]
644
645 [[package]]
@@ -970,12 +869,6 @@ dependencies = [
869 "windows-link",
870 ]
871
973 -[[package]]
974 -name = "linux-raw-sys"
975 -version = "0.12.1"
976 -source = "registry+https://github.com/rust-lang/crates.io-index"
977 -checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
978 -
872 [[package]]
873 name = "litemap"
874 version = "0.8.1"
@@ -1053,12 +946,6 @@ version = "2.8.0"
946 source = "registry+https://github.com/rust-lang/crates.io-index"
947 checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
948
1056 -[[package]]
1057 -name = "mime"
1058 -version = "0.3.17"
1059 -source = "registry+https://github.com/rust-lang/crates.io-index"
1060 -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
1061 -
949 [[package]]
950 name = "minimal-lexical"
951 version = "0.2.1"
@@ -1076,23 +963,6 @@ dependencies = [
963 "windows-sys 0.61.2",
964 ]
965
1079 -[[package]]
1080 -name = "native-tls"
1081 -version = "0.2.18"
1082 -source = "registry+https://github.com/rust-lang/crates.io-index"
1083 -checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2"
1084 -dependencies = [
1085 - "libc",
1086 - "log",
1087 - "openssl",
1088 - "openssl-probe",
1089 - "openssl-sys",
1090 - "schannel",
1091 - "security-framework",
1092 - "security-framework-sys",
1093 - "tempfile",
1094 -]
1095 -
966 [[package]]
967 name = "nom"
968 version = "7.1.3"
@@ -1133,50 +1003,12 @@ version = "1.70.2"
1003 source = "registry+https://github.com/rust-lang/crates.io-index"
1004 checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
1005
1136 -[[package]]
1137 -name = "openssl"
1138 -version = "0.10.76"
1139 -source = "registry+https://github.com/rust-lang/crates.io-index"
1140 -checksum = "951c002c75e16ea2c65b8c7e4d3d51d5530d8dfa7d060b4776828c88cfb18ecf"
1141 -dependencies = [
1142 - "bitflags 2.11.0",
1143 - "cfg-if",
1144 - "foreign-types",
1145 - "libc",
1146 - "once_cell",
1147 - "openssl-macros",
1148 - "openssl-sys",
1149 -]
1150 -
1151 -[[package]]
1152 -name = "openssl-macros"
1153 -version = "0.1.1"
1154 -source = "registry+https://github.com/rust-lang/crates.io-index"
1155 -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
1156 -dependencies = [
1157 - "proc-macro2",
1158 - "quote",
1159 - "syn 2.0.117",
1160 -]
1161 -
1006 [[package]]
1007 name = "openssl-probe"
1008 version = "0.2.1"
1009 source = "registry+https://github.com/rust-lang/crates.io-index"
1010 checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
1011
1168 -[[package]]
1169 -name = "openssl-sys"
1170 -version = "0.9.112"
1171 -source = "registry+https://github.com/rust-lang/crates.io-index"
1172 -checksum = "57d55af3b3e226502be1526dfdba67ab0e9c96fc293004e79576b2b9edb0dbdb"
1173 -dependencies = [
1174 - "cc",
1175 - "libc",
1176 - "pkg-config",
1177 - "vcpkg",
1178 -]
1179 -
1012 [[package]]
1013 name = "percent-encoding"
1014 version = "2.3.2"
@@ -1195,12 +1027,6 @@ version = "0.1.0"
1027 source = "registry+https://github.com/rust-lang/crates.io-index"
1028 checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1029
1198 -[[package]]
1199 -name = "pkg-config"
1200 -version = "0.3.32"
1201 -source = "registry+https://github.com/rust-lang/crates.io-index"
1202 -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
1203 -
1030 [[package]]
1031 name = "potential_utf"
1032 version = "0.1.4"
@@ -1434,20 +1260,15 @@ checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147"
1260 dependencies = [
1261 "base64",
1262 "bytes",
1437 - "encoding_rs",
1263 "futures-core",
1439 - "h2",
1264 "http",
1265 "http-body",
1266 "http-body-util",
1267 "hyper",
1268 "hyper-rustls",
1445 - "hyper-tls",
1269 "hyper-util",
1270 "js-sys",
1271 "log",
1449 - "mime",
1450 - "native-tls",
1272 "percent-encoding",
1273 "pin-project-lite",
1274 "quinn",
@@ -1459,7 +1280,6 @@ dependencies = [
1280 "serde_urlencoded",
1281 "sync_wrapper",
1282 "tokio",
1462 - "tokio-native-tls",
1283 "tokio-rustls",
1284 "tower",
1285 "tower-http",
@@ -1496,19 +1316,6 @@ version = "2.1.2"
1316 source = "registry+https://github.com/rust-lang/crates.io-index"
1317 checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
1318
1499 -[[package]]
1500 -name = "rustix"
1501 -version = "1.1.4"
1502 -source = "registry+https://github.com/rust-lang/crates.io-index"
1503 -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
1504 -dependencies = [
1505 - "bitflags 2.11.0",
1506 - "errno",
1507 - "libc",
1508 - "linux-raw-sys",
1509 - "windows-sys 0.61.2",
1510 -]
1511 -
1319 [[package]]
1320 name = "rustls"
1321 version = "0.23.37"
@@ -1599,7 +1406,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1406 checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"
1407 dependencies = [
1408 "bitflags 2.11.0",
1602 - "core-foundation 0.10.1",
1409 + "core-foundation",
1410 "core-foundation-sys",
1411 "libc",
1412 "security-framework-sys",
@@ -1738,25 +1545,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1545 checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
1546
1547 [[package]]
1741 -name = "smbcloud-auth"
1742 -version = "0.3.33"
1548 +name = "smbcloud-auth-sdk"
1549 +version = "0.3.34"
1550 dependencies = [
1551 "base64",
1745 - "log",
1552 "reqwest",
1553 "serde",
1554 "serde_json",
1555 "sha2",
1556 "smbcloud-model",
1557 "smbcloud-network",
1752 - "smbcloud-networking",
1558 "url-builder",
1559 "uuid",
1560 ]
1561
1562 [[package]]
1563 name = "smbcloud-model"
1759 -version = "0.3.33"
1564 +version = "0.3.35"
1565 dependencies = [
1566 "chrono",
1567 "log",
@@ -1772,7 +1577,7 @@ dependencies = [
1577
1578 [[package]]
1579 name = "smbcloud-network"
1775 -version = "0.3.33"
1580 +version = "0.3.35"
1581 dependencies = [
1582 "clap 4.6.0",
1583 "log",
@@ -1783,14 +1588,6 @@ dependencies = [
1588 "wasm-bindgen",
1589 ]
1590
1786 -[[package]]
1787 -name = "smbcloud-networking"
1788 -version = "0.3.31"
1789 -dependencies = [
1790 - "smbcloud-network",
1791 - "url-builder",
1792 -]
1793 -
1591 [[package]]
1592 name = "socket2"
1593 version = "0.6.3"
@@ -1951,40 +1748,6 @@ dependencies = [
1748 "syn 2.0.117",
1749 ]
1750
1954 -[[package]]
1955 -name = "system-configuration"
1956 -version = "0.7.0"
1957 -source = "registry+https://github.com/rust-lang/crates.io-index"
1958 -checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b"
1959 -dependencies = [
1960 - "bitflags 2.11.0",
1961 - "core-foundation 0.9.4",
1962 - "system-configuration-sys",
1963 -]
1964 -
1965 -[[package]]
1966 -name = "system-configuration-sys"
1967 -version = "0.6.0"
1968 -source = "registry+https://github.com/rust-lang/crates.io-index"
1969 -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
1970 -dependencies = [
1971 - "core-foundation-sys",
1972 - "libc",
1973 -]
1974 -
1975 -[[package]]
1976 -name = "tempfile"
1977 -version = "3.27.0"
1978 -source = "registry+https://github.com/rust-lang/crates.io-index"
1979 -checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
1980 -dependencies = [
1981 - "fastrand",
1982 - "getrandom 0.4.2",
1983 - "once_cell",
1984 - "rustix",
1985 - "windows-sys 0.61.2",
1986 -]
1987 -
1751 [[package]]
1752 name = "textwrap"
1753 version = "0.11.0"
@@ -2062,16 +1825,6 @@ dependencies = [
1825 "windows-sys 0.61.2",
1826 ]
1827
2065 -[[package]]
2066 -name = "tokio-native-tls"
2067 -version = "0.3.1"
2068 -source = "registry+https://github.com/rust-lang/crates.io-index"
2069 -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
2070 -dependencies = [
2071 - "native-tls",
2072 - "tokio",
2073 -]
2074 -
1828 [[package]]
1829 name = "tokio-rustls"
1830 version = "0.26.4"
@@ -2082,19 +1835,6 @@ dependencies = [
1835 "tokio",
1836 ]
1837
2085 -[[package]]
2086 -name = "tokio-util"
2087 -version = "0.7.18"
2088 -source = "registry+https://github.com/rust-lang/crates.io-index"
2089 -checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098"
2090 -dependencies = [
2091 - "bytes",
2092 - "futures-core",
2093 - "futures-sink",
2094 - "pin-project-lite",
2095 - "tokio",
2096 -]
2097 -
1838 [[package]]
1839 name = "tower"
1840 version = "0.5.3"
@@ -2312,12 +2052,6 @@ version = "0.1.1"
2052 source = "registry+https://github.com/rust-lang/crates.io-index"
2053 checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
2054
2315 -[[package]]
2316 -name = "vcpkg"
2317 -version = "0.2.15"
2318 -source = "registry+https://github.com/rust-lang/crates.io-index"
2319 -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
2320 -
2055 [[package]]
2056 name = "vec_map"
2057 version = "0.8.2"
@@ -2563,17 +2297,6 @@ version = "0.2.1"
2297 source = "registry+https://github.com/rust-lang/crates.io-index"
2298 checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
2299
2566 -[[package]]
2567 -name = "windows-registry"
2568 -version = "0.6.1"
2569 -source = "registry+https://github.com/rust-lang/crates.io-index"
2570 -checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"
2571 -dependencies = [
2572 - "windows-link",
2573 - "windows-result",
2574 - "windows-strings",
2575 -]
2576 -
2300 [[package]]
2301 name = "windows-result"
2302 version = "0.4.1"
sdk/gems/auth/auth.gemspec
+2 -2
@@ -5,8 +5,8 @@ require_relative 'lib/auth/version'
5 Gem::Specification.new do |spec|
6 spec.name = 'smbcloud-auth'
7 spec.version = Auth::VERSION
8 - spec.authors = ["Seto Elkahfi"]
9 - spec.email = ["hej@setoelkahfi.se"]
8 + spec.authors = ['Seto Elkahfi']
9 + spec.email = ['hej@setoelkahfi.se']
10
11 spec.summary = 'Ruby bindings for the smbCloud Auth SDK.'
12 spec.description = 'Ruby bindings for smbCloud Auth, powered by the shared Rust SDK and a native Magnus extension.'
sdk/gems/auth/ext/auth/Cargo.toml
+10 -7
@@ -9,11 +9,14 @@ publish = false
9 crate-type = ["cdylib"]
10
11 [dependencies]
12 -magnus = { version = "0.7.1" }
13 -serde = { version = "1", features = ["derive"] }
12 +magnus = { version = "0.7.1" }
13 +serde = { version = "1", features = ["derive"] }
14 serde_json = "1"
15 -tokio = { version = "1", features = ["rt-multi-thread"] }
16 -smbcloud-auth = { path = "./../../../../../crates/smbcloud-auth" }
17 -smbcloud-model = { path = "./../../../../../crates/smbcloud-model" }
18 -smbcloud-network = { path = "./../../../../../crates/smbcloud-network" }
19 -smbcloud-networking = { path = "./../../../../../crates/smbcloud-networking" }
15 +tokio = { version = "1", features = ["rt-multi-thread"] }
16 +
17 +# smbcloud-auth was split into smbcloud-auth-sdk (pure HTTP SDK, no CLI plumbing).
18 +# smbcloud-networking is an internal dep of the old smbcloud-auth crate and is
19 +# not re-exported by smbcloud-auth-sdk, so it is dropped here.
20 +smbcloud-auth-sdk = { path = "./../../../../../crates/smbcloud-auth-sdk" }
21 +smbcloud-model = { path = "./../../../../../crates/smbcloud-model" }
22 +smbcloud-network = { path = "./../../../../../crates/smbcloud-network" }
sdk/gems/auth/ext/auth/src/lib.rs
+2 -2
@@ -1,6 +1,6 @@
1 -use magnus::{Error, Ruby, function, prelude::*};
1 +use magnus::{function, prelude::*, Error, Ruby};
2 use serde::Serialize;
3 -use smbcloud_auth::{
3 +use smbcloud_auth_sdk::{
4 client_credentials::ClientCredentials, login::login_with_client, logout::logout_with_client,
5 me::me_with_client, remove::remove_with_client, signup::signup_with_client,
6 };