itsi-server 0.1.18 → 0.1.19

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0b3d55f2d27ad60a502f8405fa4271c6fc70157a4e1c0a8ec1da3c4868a557e
4
- data.tar.gz: ce0fb8e64c07660fc6919964f0d67b04afda57432889214b4eca4012b3334f50
3
+ metadata.gz: b9a7089e35c66a9eb90210090e2cf341b2ab4d8dc530b31e886e7aa599ea9cc1
4
+ data.tar.gz: d81ac50219a8e62f65b8a673c4b71b5eabdceb96c177b79ea5fcc27accb1ed06
5
5
  SHA512:
6
- metadata.gz: 641f074e818ac6222f3c44c8e29840e6a783b562b58997c0b90c065b227e5141c62a90942661a89b2ca939c515de07bfc385b9b5e20008a5ef0f29153596c9bf
7
- data.tar.gz: baff794a4da6c8de09f4397692885ec3e5fdbea23e4e94932db9bbdb3e430934752ba59984f6e8a9a66e34760f4b877f7eec23b8775f075e37e487aafef2a5b0
6
+ metadata.gz: 1753446cc0837537d023b4b73f21a0068b4f0dbbfe25a9702e7aeadbb9e21ed5400e9d236f7531a3a2f7acd72ef91b9d03896577b825a7b4594ff7a92b8bbf54
7
+ data.tar.gz: '011096ba26253fd66d7d78a1b3b6d275515c93b67ed475d0b2c2db707edc4c8da83f229292bd3102ad5ad1072d5154119e0a93e5a219e7531132d647ba2e5f0a'
data/Cargo.lock CHANGED
@@ -467,16 +467,6 @@ dependencies = [
467
467
  "crossbeam-utils",
468
468
  ]
469
469
 
470
- [[package]]
471
- name = "core-foundation"
472
- version = "0.9.4"
473
- source = "registry+https://github.com/rust-lang/crates.io-index"
474
- checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
475
- dependencies = [
476
- "core-foundation-sys",
477
- "libc",
478
- ]
479
-
480
470
  [[package]]
481
471
  name = "core-foundation"
482
472
  version = "0.10.0"
@@ -671,15 +661,6 @@ version = "1.15.0"
671
661
  source = "registry+https://github.com/rust-lang/crates.io-index"
672
662
  checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
673
663
 
674
- [[package]]
675
- name = "encoding_rs"
676
- version = "0.8.35"
677
- source = "registry+https://github.com/rust-lang/crates.io-index"
678
- checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
679
- dependencies = [
680
- "cfg-if",
681
- ]
682
-
683
664
  [[package]]
684
665
  name = "equivalent"
685
666
  version = "1.0.2"
@@ -751,21 +732,6 @@ version = "1.0.7"
751
732
  source = "registry+https://github.com/rust-lang/crates.io-index"
752
733
  checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
753
734
 
754
- [[package]]
755
- name = "foreign-types"
756
- version = "0.3.2"
757
- source = "registry+https://github.com/rust-lang/crates.io-index"
758
- checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
759
- dependencies = [
760
- "foreign-types-shared",
761
- ]
762
-
763
- [[package]]
764
- name = "foreign-types-shared"
765
- version = "0.1.1"
766
- source = "registry+https://github.com/rust-lang/crates.io-index"
767
- checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
768
-
769
735
  [[package]]
770
736
  name = "form_urlencoded"
771
737
  version = "1.2.1"
@@ -1096,22 +1062,6 @@ dependencies = [
1096
1062
  "webpki-roots",
1097
1063
  ]
1098
1064
 
1099
- [[package]]
1100
- name = "hyper-tls"
1101
- version = "0.6.0"
1102
- source = "registry+https://github.com/rust-lang/crates.io-index"
1103
- checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
1104
- dependencies = [
1105
- "bytes",
1106
- "http-body-util",
1107
- "hyper",
1108
- "hyper-util",
1109
- "native-tls",
1110
- "tokio",
1111
- "tokio-native-tls",
1112
- "tower-service",
1113
- ]
1114
-
1115
1065
  [[package]]
1116
1066
  name = "hyper-util"
1117
1067
  version = "0.1.10"
@@ -1355,7 +1305,7 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
1355
1305
 
1356
1306
  [[package]]
1357
1307
  name = "itsi-server"
1358
- version = "0.1.18"
1308
+ version = "0.1.19"
1359
1309
  dependencies = [
1360
1310
  "argon2",
1361
1311
  "async-channel",
@@ -1695,23 +1645,6 @@ dependencies = [
1695
1645
  "uuid",
1696
1646
  ]
1697
1647
 
1698
- [[package]]
1699
- name = "native-tls"
1700
- version = "0.2.14"
1701
- source = "registry+https://github.com/rust-lang/crates.io-index"
1702
- checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e"
1703
- dependencies = [
1704
- "libc",
1705
- "log",
1706
- "openssl",
1707
- "openssl-probe",
1708
- "openssl-sys",
1709
- "schannel",
1710
- "security-framework 2.11.1",
1711
- "security-framework-sys",
1712
- "tempfile",
1713
- ]
1714
-
1715
1648
  [[package]]
1716
1649
  name = "nix"
1717
1650
  version = "0.29.0"
@@ -1847,50 +1780,12 @@ version = "1.20.3"
1847
1780
  source = "registry+https://github.com/rust-lang/crates.io-index"
1848
1781
  checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
1849
1782
 
1850
- [[package]]
1851
- name = "openssl"
1852
- version = "0.10.71"
1853
- source = "registry+https://github.com/rust-lang/crates.io-index"
1854
- checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd"
1855
- dependencies = [
1856
- "bitflags 2.8.0",
1857
- "cfg-if",
1858
- "foreign-types",
1859
- "libc",
1860
- "once_cell",
1861
- "openssl-macros",
1862
- "openssl-sys",
1863
- ]
1864
-
1865
- [[package]]
1866
- name = "openssl-macros"
1867
- version = "0.1.1"
1868
- source = "registry+https://github.com/rust-lang/crates.io-index"
1869
- checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
1870
- dependencies = [
1871
- "proc-macro2",
1872
- "quote",
1873
- "syn",
1874
- ]
1875
-
1876
1783
  [[package]]
1877
1784
  name = "openssl-probe"
1878
1785
  version = "0.1.6"
1879
1786
  source = "registry+https://github.com/rust-lang/crates.io-index"
1880
1787
  checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
1881
1788
 
1882
- [[package]]
1883
- name = "openssl-sys"
1884
- version = "0.9.106"
1885
- source = "registry+https://github.com/rust-lang/crates.io-index"
1886
- checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd"
1887
- dependencies = [
1888
- "cc",
1889
- "libc",
1890
- "pkg-config",
1891
- "vcpkg",
1892
- ]
1893
-
1894
1789
  [[package]]
1895
1790
  name = "option-ext"
1896
1791
  version = "0.2.0"
@@ -2339,22 +2234,18 @@ checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb"
2339
2234
  dependencies = [
2340
2235
  "base64",
2341
2236
  "bytes",
2342
- "encoding_rs",
2343
2237
  "futures-core",
2344
2238
  "futures-util",
2345
- "h2",
2346
2239
  "http",
2347
2240
  "http-body",
2348
2241
  "http-body-util",
2349
2242
  "hyper",
2350
2243
  "hyper-rustls",
2351
- "hyper-tls",
2352
2244
  "hyper-util",
2353
2245
  "ipnet",
2354
2246
  "js-sys",
2355
2247
  "log",
2356
2248
  "mime",
2357
- "native-tls",
2358
2249
  "once_cell",
2359
2250
  "percent-encoding",
2360
2251
  "pin-project-lite",
@@ -2366,9 +2257,7 @@ dependencies = [
2366
2257
  "serde_json",
2367
2258
  "serde_urlencoded",
2368
2259
  "sync_wrapper",
2369
- "system-configuration",
2370
2260
  "tokio",
2371
- "tokio-native-tls",
2372
2261
  "tokio-rustls",
2373
2262
  "tokio-util",
2374
2263
  "tower",
@@ -2483,7 +2372,7 @@ dependencies = [
2483
2372
  "openssl-probe",
2484
2373
  "rustls-pki-types",
2485
2374
  "schannel",
2486
- "security-framework 3.2.0",
2375
+ "security-framework",
2487
2376
  ]
2488
2377
 
2489
2378
  [[package]]
@@ -2567,19 +2456,6 @@ version = "1.2.0"
2567
2456
  source = "registry+https://github.com/rust-lang/crates.io-index"
2568
2457
  checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
2569
2458
 
2570
- [[package]]
2571
- name = "security-framework"
2572
- version = "2.11.1"
2573
- source = "registry+https://github.com/rust-lang/crates.io-index"
2574
- checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
2575
- dependencies = [
2576
- "bitflags 2.8.0",
2577
- "core-foundation 0.9.4",
2578
- "core-foundation-sys",
2579
- "libc",
2580
- "security-framework-sys",
2581
- ]
2582
-
2583
2459
  [[package]]
2584
2460
  name = "security-framework"
2585
2461
  version = "3.2.0"
@@ -2587,7 +2463,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
2587
2463
  checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316"
2588
2464
  dependencies = [
2589
2465
  "bitflags 2.8.0",
2590
- "core-foundation 0.10.0",
2466
+ "core-foundation",
2591
2467
  "core-foundation-sys",
2592
2468
  "libc",
2593
2469
  "security-framework-sys",
@@ -2823,27 +2699,6 @@ dependencies = [
2823
2699
  "windows 0.57.0",
2824
2700
  ]
2825
2701
 
2826
- [[package]]
2827
- name = "system-configuration"
2828
- version = "0.6.1"
2829
- source = "registry+https://github.com/rust-lang/crates.io-index"
2830
- checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
2831
- dependencies = [
2832
- "bitflags 2.8.0",
2833
- "core-foundation 0.9.4",
2834
- "system-configuration-sys",
2835
- ]
2836
-
2837
- [[package]]
2838
- name = "system-configuration-sys"
2839
- version = "0.6.0"
2840
- source = "registry+https://github.com/rust-lang/crates.io-index"
2841
- checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
2842
- dependencies = [
2843
- "core-foundation-sys",
2844
- "libc",
2845
- ]
2846
-
2847
2702
  [[package]]
2848
2703
  name = "tagptr"
2849
2704
  version = "0.2.0"
@@ -3005,16 +2860,6 @@ dependencies = [
3005
2860
  "syn",
3006
2861
  ]
3007
2862
 
3008
- [[package]]
3009
- name = "tokio-native-tls"
3010
- version = "0.3.1"
3011
- source = "registry+https://github.com/rust-lang/crates.io-index"
3012
- checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
3013
- dependencies = [
3014
- "native-tls",
3015
- "tokio",
3016
- ]
3017
-
3018
2863
  [[package]]
3019
2864
  name = "tokio-rustls"
3020
2865
  version = "0.26.2"
@@ -3258,12 +3103,6 @@ version = "0.1.1"
3258
3103
  source = "registry+https://github.com/rust-lang/crates.io-index"
3259
3104
  checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
3260
3105
 
3261
- [[package]]
3262
- name = "vcpkg"
3263
- version = "0.2.15"
3264
- source = "registry+https://github.com/rust-lang/crates.io-index"
3265
- checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
3266
-
3267
3106
  [[package]]
3268
3107
  name = "version_check"
3269
3108
  version = "0.9.5"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "itsi-server"
3
- version = "0.1.18"
3
+ version = "0.1.19"
4
4
  edition = "2021"
5
5
  authors = ["Wouter Coppieters <wc@pico.net.nz>"]
6
6
  license = "MIT"
@@ -57,7 +57,10 @@ pin-project = "1.1.9"
57
57
  rand = "0.9.0"
58
58
  rcgen = { version = "0.13.2", features = ["x509-parser", "pem"] }
59
59
  regex = "1.11.1"
60
- reqwest = { version = "0.12.15", features = ["stream"] }
60
+ reqwest = { version = "0.12.15", features = [
61
+ "stream",
62
+ "rustls-tls",
63
+ ], default-features = false }
61
64
  redis = { version = "0.29.2", features = [
62
65
  "tokio-comp",
63
66
  "r2d2",
@@ -242,7 +242,7 @@ impl ItsiHttpRequest {
242
242
  .parts
243
243
  .uri
244
244
  .path()
245
- .strip_prefix(self.script_name.trim_end_matches('/'))
245
+ .strip_prefix(&self.script_name)
246
246
  .unwrap_or(self.parts.uri.path()))
247
247
  }
248
248
 
@@ -29,6 +29,7 @@ module Itsi
29
29
  path = self.path
30
30
  host = self.host
31
31
  version = self.version
32
+
32
33
  {
33
34
  "SERVER_SOFTWARE" => "Itsi",
34
35
  "SCRIPT_NAME" => script_name,
@@ -113,7 +113,7 @@ module Itsi
113
113
  endpoint(route, [:patch], app_proc, nonblocking: nonblocking, &blk)
114
114
  end
115
115
 
116
- def endpoint(route, methods=[], app_proc = nil, nonblocking: false, &blk)
116
+ def endpoint(route=nil, methods=[], app_proc = nil, nonblocking: false, &blk)
117
117
  raise "You must provide either a block or an explicit handler for the endpoint" if app_proc.nil? && blk.nil?
118
118
 
119
119
  app_proc = @controller.method(app_proc).to_proc if app_proc.is_a?(Symbol)
@@ -139,14 +139,18 @@ module Itsi
139
139
  end
140
140
 
141
141
 
142
- if route && methods.any?
142
+ if route || methods.any?
143
143
  # For endpoints, it's usually assumed trailing slash and non-trailing slash behaviour is the same
144
144
  routes = route == "/" ? ["", "/"] : [route]
145
145
  location(*routes, methods: methods) do
146
146
  @middleware[:app] = { preloader: -> { app_proc }, nonblocking: nonblocking }
147
147
  end
148
148
  else
149
- @middleware[:app] = { preloader: -> { app_proc }, nonblocking: nonblocking }
149
+ app = { preloader: -> { app_proc }, nonblocking: nonblocking }
150
+ @middleware[:app] = app
151
+ location("*") do
152
+ @middleware[:app] = app
153
+ end
150
154
  end
151
155
  end
152
156
 
@@ -178,12 +182,21 @@ module Itsi
178
182
  end
179
183
 
180
184
  def run(app, sendfile: true, nonblocking: false, path_info: "/")
181
- @middleware[:app] = { preloader: -> { Itsi::Server::RackInterface.for(app) }, sendfile: sendfile, base_path: "^(?<base_path>#{paths_from_parent.gsub(/\.\*\)$/, ')')}).*$", path_info: path_info, nonblocking: nonblocking }
185
+ app_args = { preloader: -> { Itsi::Server::RackInterface.for(app) }, sendfile: sendfile, base_path: "^(?<base_path>#{paths_from_parent.gsub(/\.\*\)$/, ')')}).*$", path_info: path_info, nonblocking: nonblocking }
186
+ base_path = "^(?<base_path>#{paths_from_parent.gsub(/\.\*\)$/, ')')}).*$"
187
+ @middleware[:app] = app_args
188
+ location("*") do
189
+ @middleware[:app] = app_args
190
+ end
182
191
  end
183
192
 
184
193
  def rackup_file(rackup_file, nonblocking: false, sendfile: true, path_info: "/")
185
194
  raise "Rackup file #{rackup_file} doesn't exist" unless File.exist?(rackup_file)
186
- @middleware[:app] = { preloader: -> { Itsi::Server::RackInterface.for(rackup_file) }, sendfile: sendfile, base_path: "^(?<base_path>#{paths_from_parent.gsub(/\.\*\)$/, ')')}).*$", path_info: path_info, nonblocking: nonblocking }
195
+ app_args = { preloader: -> { Itsi::Server::RackInterface.for(rackup_file) }, sendfile: sendfile, base_path: "^(?<base_path>#{paths_from_parent.gsub(/\.\*\)$/, ')')}).*$", path_info: path_info, nonblocking: nonblocking }
196
+ @middleware[:app] = app_args
197
+ location("*") do
198
+ @middleware[:app] = app_args
199
+ end
187
200
  end
188
201
 
189
202
  def include(path)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Itsi
4
4
  class Server
5
- VERSION = "0.1.18"
5
+ VERSION = "0.1.19"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itsi-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter Coppieters