ronin-web-server 0.1.0.beta2 → 0.1.0

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: 12765156008589491d49fc0daacb1a10ee5cd772e245052c0d7f335fe905c3b3
4
- data.tar.gz: fe1ca6647e5527d39f473356246f19db946cd0cf5fae1b4122038e7ad63e0816
3
+ metadata.gz: b3dee3ef506c739a9e75e0e5055d5554759de129367000a5b87619e801d4fd2c
4
+ data.tar.gz: 1695a44b07a156efff8b0611b148b585511fc9d3d844ad18b7834295e9bc3ec0
5
5
  SHA512:
6
- metadata.gz: 0c27e82e2e45ae189645917324e5a46e6098819a4567b6562c63eee91fd2afdcdf69fba087435af6b3a13f3d87e2872534d29ba5a4f92ae492d1cc306e9ca99d
7
- data.tar.gz: df896a19879909dfe1cd5e7156712069736bb1dbc23e4b64a4c7f2ddfa69637d0079702cf203ecaf27007e03b1fe3ac946a728553c1f1f501dcc746b69a12122
6
+ metadata.gz: e192f8ec835cb380ef519ed2b6ddfba88a40b8213fd1fa3f7d5df9b20f6b23cc75fe21b85bea0663fa52a0009a33b9c5b011697c8fc404760cdee5ed11f2a97e
7
+ data.tar.gz: 06a4928fd050e6c85fc17195739b9c9233ef6c7547e8532d2893fa2257276194e25bb3ac54f92a46fa62f225b51b021ccee84c6426203e4627e777111a60eeea
@@ -21,6 +21,7 @@ jobs:
21
21
  uses: ruby/setup-ruby@v1
22
22
  with:
23
23
  ruby-version: ${{ matrix.ruby }}
24
+ bundler-cache: true
24
25
  - name: Install dependencies
25
26
  run: bundle install --jobs 4 --retry 3
26
27
  - name: Run tests
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![CI](https://github.com/ronin-rb/ronin-web-server/actions/workflows/ruby.yml/badge.svg)](https://github.com/ronin-rb/ronin-web-server/actions/workflows/ruby.yml)
4
4
  [![Code Climate](https://codeclimate.com/github/ronin-rb/ronin-web-server.svg)](https://codeclimate.com/github/ronin-rb/ronin-web-server)
5
+ [![Gem Version](https://badge.fury.io/rb/ronin-web-server.svg)](https://badge.fury.io/rb/ronin-web-server)
5
6
 
6
7
  * [Website](https://ronin-rb.dev/)
7
8
  * [Source](https://github.com/ronin-rb/ronin-web-server)
@@ -21,40 +22,68 @@ security research and development.
21
22
  * Provides a [Sinatra][sinatra] based
22
23
  {Ronin::Web::Server::Base web server base class}.
23
24
  * Supports additional routing helper methods:
24
- * `any` - matches any HTTP request method.
25
- * `default` - default response for the app.
26
- * `basic_auth` - enables Basic-Auth for the app.
27
- * `redirect` - adds a redirect to a given URL for the given path.
28
- * `file` - mounts a local file to the given path.
29
- * `directory` - mounts a local directory of files at the given path.
30
- * `public_dir` - mounts the files/directories within the directory to the root
31
- of the app.
32
- * `vhost` - routes all requests for the given host to another app.
33
- * `mount` - routes all requests for a given directory to another app.
25
+ * [any][docs-any] - matches any HTTP request method.
26
+ * [default][docs-default] - default response for the app.
27
+ * [basic_auth][docs-basic_auth] - enables Basic-Auth for the app.
28
+ * [redirect][docs-redirect] - adds a redirect to a given URL for the given
29
+ path.
30
+ * [file][docs-file] - mounts a local file to the given path.
31
+ * [directory][docs-directory] - mounts a local directory of files at the given
32
+ path.
33
+ * [public_dir][docs-public_dir] - mounts the files/directories within the
34
+ directory to the root of the app.
35
+ * [vhost][docs-vhost] - routes all requests for the given host to another app.
36
+ * [mount][docs-mount] - routes all requests for a given directory to another
37
+ app.
34
38
  * Supports additional routing conditions:
35
- * `client_ip` - matches the client IP Address that sent the request.
36
- * `asn` - matches the AS number of the client's IP address.
37
- * `country_code` - matches the country code of the ASN information for the
38
- client's IP address.
39
- * `asn_name` - matches the company/ISP name of the ASN information for the
40
- client's IP address.
41
- * `host` - matches the `Host` header.
42
- * `referer` - matches the `Referer` header of the request.
43
- * `user_agent` - matches the `User-Agent` header of the request.
44
- * `browser` - matches the browser name from the `User-Agent` header of the
39
+ * [client_ip][docs-client_ip] - matches the client IP Address that sent the
45
40
  request.
46
- * `browser_vendor` - matches the browser vendor from the `User-Agent` header
47
- of the request.
48
- * `browser_version` - matches the browser version from the `User-Agent` header
49
- of the request.
50
- * `device_type` - matches the device type of the `User-Agent` header of the
51
- request.
52
- * `os` - matches the OS from the `User-Agent` header of the request.
53
- * `os_version` - matches the OS version from the `User-Agent` header of the
41
+ * [asn][docs-asn] - matches the AS number of the client's IP address.
42
+ * [country_code][docs-country_code] - matches the country code of the ASN
43
+ information for the client's IP address.
44
+ * [asn_name][docs-asn_name] - matches the company/ISP name of the ASN
45
+ information for the client's IP address.
46
+ * [host][docs-host] - matches the `Host` header.
47
+ * [referer][docs-referer] - matches the `Referer` header of the request.
48
+ * [user_agent][docs-user_agent] - matches the `User-Agent` header of the
54
49
  request.
50
+ * [browser][docs-browser] - matches the browser name from the `User-Agent`
51
+ header of the request.
52
+ * [browser_vendor][docs-browser_vendor] - matches the browser vendor from the
53
+ `User-Agent` header of the request.
54
+ * [browser_version][docs-browser_version] - matches the browser version from
55
+ the `User-Agent` header of the request.
56
+ * [device_type][docs-device_type] - matches the device type of the
57
+ `User-Agent` header of the request.
58
+ * [os][docs-os] - matches the OS from the `User-Agent` header of the request.
59
+ * [os_version][docs-os_version] - matches the OS version from the `User-Agent`
60
+ header of the request.
55
61
  * Has 97% documentation coverage.
56
62
  * Has 85% test coverage.
57
63
 
64
+ [docs-any]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Routing/ClassMethods.html#any-instance_method
65
+ [docs-default]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Routing/ClassMethods.html#default-instance_method
66
+ [docs-basic_auth]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Routing/ClassMethods.html#basic_auth-instance_method
67
+ [docs-redirect]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Routing/ClassMethods.html#redirect-instance_method
68
+ [docs-file]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Routing/ClassMethods.html#file-instance_method
69
+ [docs-directory]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Routing/ClassMethods.html#directory-instance_method
70
+ [docs-public_dir]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Routing/ClassMethods.html#public_dir-instance_method
71
+ [docs-vhost]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Routing/ClassMethods.html#vhost-instance_method
72
+ [docs-mount]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Routing/ClassMethods.html#mount-instance_method
73
+ [docs-client_ip]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#client_ip-instance_method
74
+ [docs-asn]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#asn-instance_method
75
+ [docs-country_code]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#country_code-instance_method
76
+ [docs-asn_name]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#asn_name-instance_method
77
+ [docs-host]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#host-instance_method
78
+ [docs-referer]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#referer-instance_method
79
+ [docs-user_agent]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#user_agent-instance_method
80
+ [docs-browser]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#browser-instance_method
81
+ [docs-browser_vendor]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#browser_vendor-instance_method
82
+ [docs-browser_version]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#browser_version-instance_method
83
+ [docs-device_type]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#device_type-instance_method
84
+ [docs-os]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#os-instance_method
85
+ [docs-os_version]: https://ronin-rb.dev/docs/ronin-web-server/Ronin/Web/Server/Conditions/ClassMethods.html#os_version-instance_method
86
+
58
87
  ## Examples
59
88
 
60
89
  Create and run a simple web app:
data/gemspec.yml CHANGED
@@ -25,7 +25,7 @@ dependencies:
25
25
  rack-user_agent: ~> 0.5
26
26
  sinatra: ~> 3.0
27
27
  # Ronin dependencies:
28
- ronin-support: ~> 1.0.0.beta1
28
+ ronin-support: ~> 1.0
29
29
 
30
30
  development_dependencies:
31
31
  bundler: ~> 2.0
@@ -110,8 +110,8 @@ module Ronin
110
110
  # @param [Hash{String => Object}] env
111
111
  # The rack request env Hash.
112
112
  #
113
- # @return [ReverseProxy::Response]
114
- # The rack response.
113
+ # @return [(Integer, Hash{String => String}, Array<String>)]
114
+ # The rack response tuple (status, headers, body).
115
115
  #
116
116
  def call(env)
117
117
  request = Request.new(env)
@@ -127,7 +127,7 @@ module Ronin
127
127
  end
128
128
  end
129
129
 
130
- return response
130
+ return [response.status, response.headers, response.body]
131
131
  end
132
132
 
133
133
  #
@@ -22,7 +22,7 @@ module Ronin
22
22
  module Web
23
23
  module Server
24
24
  # ronin-web-server version
25
- VERSION = '0.1.0.beta2'
25
+ VERSION = '0.1.0'
26
26
  end
27
27
  end
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-web-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-13 00:00:00.000000000 Z
11
+ date: 2023-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webrick
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.0.0.beta1
75
+ version: '1.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.0.0.beta1
82
+ version: '1.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement