syntropy 0.8.3 → 0.8.4

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: 3b742120d066c6f610604b187792715c1ef969684719f435a6b3a01c2b3c8995
4
- data.tar.gz: 700c6ca989e8535014236e2923c19a6215c0f4f4114e67f050d43a132d2b2a23
3
+ metadata.gz: 45abad590f75c9decf1a8b087af2e43fc78dbf1a18e9b33d364e7a215dcc7ac2
4
+ data.tar.gz: ae887f37aa7357c6a60a764bbbb651f99ecf70782628417b10816d96de6e325b
5
5
  SHA512:
6
- metadata.gz: 11a35c917205ebaa26a8d628c7c35e03e05c82432ca45d3d0cabe1c27233044e1827ebba2a054c5f9d16c4812decfc93e82ec6477bc825638e0a0658a2d6e58f
7
- data.tar.gz: b8c3c63e074d1d2cf4b66466c160ee70175c31f5f69ca625e1e5caabd5b41c5dc2169c426db35ef7d1ce77a545dfa45a575795501d1abbfa37a8936def913b6c
6
+ metadata.gz: 5eaad0914071bc82b5f223360fd7c40a1756c312653575571cab89fff1dd2c28fa2b695e6e3bed12eb5be640927d803da2e95c767ae4b3528b545475fab56932
7
+ data.tar.gz: 5b4d4ec5eb419e9bbe891a47f02886b98dc9d1855d4a5dba1bfe6b540a1d3e62a03ae1fa7efce454e168e0122897bd0ba472a7f12fb592e5b190693a5317748b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.8.4 2025-07-07
2
+
3
+ - Update TP2
4
+ - Fix Router#path_parent to not break on double slash
5
+
1
6
  ## 0.8.3 2025-07-06
2
7
 
3
8
  - Correctly handle HEAD requests for template modules
data/TODO.md CHANGED
@@ -1,6 +1,13 @@
1
- - Test HEAD requests for:
2
- - markdown
3
- - static files
1
+ - add support for applets
2
+
3
+ - can be implemented as separate gems
4
+ - can route requests to a different directory (i.e. inside the gem directory)
5
+ - simple way to instantiate and setup the applet
6
+ - as a first example, implement an auth/signin applet:
7
+ - session hook
8
+ - session persistence
9
+ - login page
10
+ - support for custom behaviour and custom workflows (2FA, signin using OTP etc.)
4
11
 
5
12
  - Some standard middleware:
6
13
 
@@ -84,7 +84,8 @@ module Syntropy
84
84
  def path_parent(path)
85
85
  return nil if path == '/'
86
86
 
87
- path.match(PATH_PARENT_RE)[1] || '/'
87
+ m = path.match(PATH_PARENT_RE)
88
+ m && (m[1] || '/')
88
89
  end
89
90
 
90
91
  MD_EXT_RE = /\.md$/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Syntropy
4
- VERSION = '0.8.3'
4
+ VERSION = '0.8.4'
5
5
  end
data/syntropy.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.add_dependency 'json', '2.12.2'
26
26
  s.add_dependency 'papercraft', '1.4'
27
27
  s.add_dependency 'qeweney', '0.21'
28
- s.add_dependency 'tp2', '0.13.3'
28
+ s.add_dependency 'tp2', '0.13.4'
29
29
  s.add_dependency 'uringmachine', '0.16'
30
30
 
31
31
  s.add_dependency 'listen', '3.9.0'
data/test/test_router.rb CHANGED
@@ -24,7 +24,7 @@ class RouterTest < Minitest::Test
24
24
  File.join(APP_ROOT, fn)
25
25
  end
26
26
 
27
- def test_find_route
27
+ def test_routing
28
28
  # entry = @router['/']
29
29
  # assert_equal :not_found, entry[:kind]
30
30
 
@@ -50,6 +50,9 @@ class RouterTest < Minitest::Test
50
50
  assert_equal :module, entry[:kind]
51
51
  assert_equal full_path('api+.rb'), entry[:fn]
52
52
 
53
+ entry = @router['/test/api//foo/bar']
54
+ assert_equal :not_found, entry[:kind]
55
+
53
56
  entry = @router['/test/api/foo/../bar']
54
57
  assert_equal :not_found, entry[:kind]
55
58
 
@@ -87,4 +90,27 @@ class RouterTest < Minitest::Test
87
90
  ensure
88
91
  IO.write(@tmp_fn, orig_body) if orig_body
89
92
  end
93
+
94
+ def test_malformed_path_routing
95
+ entry = @router['//xmlrpc.php?rsd']
96
+ assert_equal :not_found, entry[:kind]
97
+
98
+ entry = @router['/test//xmlrpc.php?rsd']
99
+ assert_equal :not_found, entry[:kind]
100
+
101
+ entry = @router['/test///xmlrpc.php?rsd']
102
+ assert_equal :not_found, entry[:kind]
103
+
104
+ entry = @router['/test///xmlrpc.php?rsd']
105
+ assert_equal :not_found, entry[:kind]
106
+
107
+ entry = @router['/test/./qsdf']
108
+ assert_equal :not_found, entry[:kind]
109
+
110
+ entry = @router['/test/../../lib/syntropy.rb']
111
+ assert_equal :not_found, entry[:kind]
112
+
113
+ entry = @router['/../../lib/syntropy.rb']
114
+ assert_equal :not_found, entry[:kind]
115
+ end
90
116
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syntropy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
@@ -71,14 +71,14 @@ dependencies:
71
71
  requirements:
72
72
  - - '='
73
73
  - !ruby/object:Gem::Version
74
- version: 0.13.3
74
+ version: 0.13.4
75
75
  type: :runtime
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - '='
80
80
  - !ruby/object:Gem::Version
81
- version: 0.13.3
81
+ version: 0.13.4
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: uringmachine
84
84
  requirement: !ruby/object:Gem::Requirement