macaw_framework 1.2.2 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75201cbb67c0e3d1f913751ed085cf3102f42794a3d5f3721b4acd00234ac257
4
- data.tar.gz: 1b15fe1043c6213fe8a7f5be7ea22f2ed1bd6c917215de79edf66b622e6c2e85
3
+ metadata.gz: 17a2ff330e9f546997fcbbcbbc8bc0e08af19c08980056999b60f3307aaf898d
4
+ data.tar.gz: 2af901040509fcd7feecaa5bc9cc762967f9530cd6277b6fc0d4ac1fe5a3bb20
5
5
  SHA512:
6
- metadata.gz: 0f6feb4910080a14c3908a8f5d89d5768fbf40e40882f8d98e6ecfdcf99475ec86e0522bd09f0db9b73577e2e1b72912f1db9da169271ac5b403bc680e09a0a4
7
- data.tar.gz: 2417693c644f10af4c4a23186dde6451405c1a34c595ec507292f5eba1f7451193a4e728b9cd28195bc1010ab22f8f4a7368240e016e3f871515cb3ec22ea242
6
+ metadata.gz: 07127b57e24d02a95a9bc444bc444bb3ce44d9f80c6fc9f08b5155c88a3355bd20ee93ae5831f028596b114a4cb200c31bd5247bff8ba043d65f844c426a6bd7
7
+ data.tar.gz: 4ca1a0f63ea1feb4de1b712f63b786286b791bc9df255011b4ef7acf5a740076c65821b13311bf5c3741bfde945ba0f83dae8ad0073bb56dab6962295b1dc7b5
data/CHANGELOG.md CHANGED
@@ -119,3 +119,12 @@
119
119
  ## [1.2.2]
120
120
 
121
121
  - Including possibility of setting port, bind and threads programmatically
122
+
123
+ ## [1.2.3]
124
+
125
+ - Fixing import of pathname
126
+
127
+ ## [1.2.4]
128
+
129
+ - Fixing small bug on lof during endpoint declaration
130
+ - Disclosing security issue on session storage
data/Gemfile CHANGED
@@ -2,20 +2,15 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- # Specify your gem's dependencies in macaw_framework.gemspec
6
5
  gemspec
7
6
 
8
- gem "rake", "~> 13.0"
9
-
10
- gem "minitest", "~> 5.0"
11
-
12
- gem "rubocop", "~> 1.21"
13
-
14
- gem "prometheus-client", "~> 4.1"
15
-
16
7
  gem "openssl"
8
+ gem "prometheus-client", "~> 4.1"
17
9
 
18
10
  group :test do
11
+ gem "minitest", "~> 5.0"
12
+ gem "rake", "~> 13.0"
13
+ gem "rubocop", "~> 1.21"
19
14
  gem "simplecov", "~> 0.21.2"
20
15
  gem "simplecov-json"
21
16
  gem "simplecov_json_formatter", "~> 0.1.2"
data/README.md CHANGED
@@ -111,7 +111,7 @@ end
111
111
 
112
112
  *Observation: To activate caching, you also have to set its properties in the `application.json` file. If you don't, the caching strategy will not work. See the Configuration section below for more details.*
113
113
 
114
- ### Session management: Handle user sessions securely with server-side in-memory storage
114
+ ### Session management: Handle user sessions with server-side in-memory storage
115
115
 
116
116
  ```ruby
117
117
  m.get('/login') do |context|
@@ -129,6 +129,8 @@ m.get('/dashboard') do |context|
129
129
  end
130
130
  ```
131
131
 
132
+ **Caution: This feature is vulnerable to IP spoofing and may disrupt sessions on devices sharing the same network (e.g., Wi-Fi).**
133
+
132
134
  ### Configuration: Customize various aspects of the framework through the application.json configuration file, such as rate limiting, SSL support, and Prometheus integration
133
135
 
134
136
  ```json
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MacawFramework
4
- VERSION = "1.2.2"
4
+ VERSION = "1.2.4"
5
5
  end
@@ -9,6 +9,7 @@ require_relative "macaw_framework/core/thread_server"
9
9
  require_relative "macaw_framework/version"
10
10
  require "prometheus/client"
11
11
  require "securerandom"
12
+ require "pathname"
12
13
  require "logger"
13
14
  require "socket"
14
15
  require "json"
@@ -197,7 +198,8 @@ module MacawFramework
197
198
  def map_new_endpoint(prefix, cache, path, &block)
198
199
  @endpoints_to_cache << "#{prefix}.#{RequestDataFiltering.sanitize_method_name(path)}" if cache
199
200
  path_clean = RequestDataFiltering.extract_path(path)
200
- @macaw_log&.info("Defining #{prefix.upcase} endpoint at /#{path}")
201
+ slash = path[0] == "/" ? "" : "/"
202
+ @macaw_log&.info("Defining #{prefix.upcase} endpoint at #{slash}#{path}")
201
203
  define_singleton_method("#{prefix}.#{path_clean}", block || lambda {
202
204
  |context = { headers: {}, body: "", params: {} }|
203
205
  })
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: macaw_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aria Diniz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-11 00:00:00.000000000 Z
11
+ date: 2024-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prometheus-client