camada 0.1.0 → 0.1.1
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 +4 -4
- data/lib/camada/engine.rb +2 -0
- data/lib/camada/env.rb +1 -1
- data/lib/camada/guarded.rb +4 -2
- data/lib/camada/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 224b2ccff9dd0cc4492209fd6b520d2d38201bfddfcf8c5fdc2425af601be015
|
|
4
|
+
data.tar.gz: deb7fa791f06d83e3ec9d7d07f9c10e6db7d6a21c6c7604347e30cc14f3e66fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e84aae8eaa7a27f1b677fd00c6b38f0c3a5bed61fb2d8be08af2674fdd08a84cfda7739aa45900d3628982d2b3f78eb437674aa5ab2c4af2d713b685b050ae73
|
|
7
|
+
data.tar.gz: f77f2624491b8d5e49acbc66b209579375176f6fb38960565d05d222b94dbb92de0f8f1df2813089de646090c4b590f3c24bc52dbd05954553c8275cd3ee00ae
|
data/lib/camada/engine.rb
CHANGED
|
@@ -204,6 +204,7 @@ module Camada
|
|
|
204
204
|
return INERT if disabled? || @snap.nil?
|
|
205
205
|
|
|
206
206
|
t0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
207
|
+
ts0 = now_ms # ts is the request start, the moment dur counts from
|
|
207
208
|
@snap.ensure_fresh
|
|
208
209
|
ip = client_ip(req)
|
|
209
210
|
|
|
@@ -265,6 +266,7 @@ module Camada
|
|
|
265
266
|
next if ctx["challenged"] || excluded || !sampled
|
|
266
267
|
|
|
267
268
|
ev = event(req, rid, sid, new_session, ip)
|
|
269
|
+
ev["ts"] = ts0
|
|
268
270
|
ev["st"] = status
|
|
269
271
|
ev["dur"] = ((Process.clock_gettime(Process::CLOCK_MONOTONIC) - t0) * 1000).to_i
|
|
270
272
|
ev["rt"] = req.route if req.route
|
data/lib/camada/env.rb
CHANGED
|
@@ -23,7 +23,7 @@ module Camada
|
|
|
23
23
|
class Env
|
|
24
24
|
# PLACEHOLDER default, the same one @camada/node and camada-python carry — confirm the
|
|
25
25
|
# production ingest domain before any RubyGems publish.
|
|
26
|
-
DEFAULT_INGEST_URL = "https://in.camada.
|
|
26
|
+
DEFAULT_INGEST_URL = "https://in.camada.app"
|
|
27
27
|
|
|
28
28
|
# nil (SDK stays inert, one log line) rather than raising on bad config. `env` is anything
|
|
29
29
|
# answering #[] with strings: ENV, or a Hash.
|
data/lib/camada/guarded.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Camada
|
|
|
4
4
|
# The fail-open envelope: a camada bug must never 5xx the customer. Every public entry point of
|
|
5
5
|
# the SDK catches, falls back, and reports through log_rate_limited: at most one line a minute.
|
|
6
6
|
module Guarded
|
|
7
|
-
@last_log =
|
|
7
|
+
@last_log = nil # monotonic seconds of the last line; nil until the first one
|
|
8
8
|
@logger = nil
|
|
9
9
|
|
|
10
10
|
class << self
|
|
@@ -12,8 +12,10 @@ module Camada
|
|
|
12
12
|
attr_accessor :logger
|
|
13
13
|
|
|
14
14
|
def log_rate_limited(err)
|
|
15
|
+
# CLOCK_MONOTONIC counts from boot, so a numeric "never" sentinel like 0.0 would
|
|
16
|
+
# swallow the first line on a host younger than a minute (fresh CI runners are).
|
|
15
17
|
now = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
16
|
-
return if now - @last_log < 60
|
|
18
|
+
return if @last_log && now - @last_log < 60
|
|
17
19
|
|
|
18
20
|
@last_log = now
|
|
19
21
|
line = "[camada] suppressed error (SDK fails open): #{describe(err)}"
|
data/lib/camada/version.rb
CHANGED
|
@@ -5,6 +5,6 @@ module Camada
|
|
|
5
5
|
# source: camada.gemspec reads it at build, and the sibling drift guards (camada-backend,
|
|
6
6
|
# camada-web, camada-mkt) parse this file with /^\s*VERSION = "([^"]+)"/m the way they parse
|
|
7
7
|
# a package.json. Plain X.Y.Z only: the analyst's SDK_RE drops anything else.
|
|
8
|
-
VERSION = "0.1.
|
|
8
|
+
VERSION = "0.1.1"
|
|
9
9
|
SDK_ID = "@camada/ruby/#{VERSION}".freeze
|
|
10
10
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: camada
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- camada
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: 'camada SDK for Ruby: inline enforcement of your snapshot (ordered custom
|
|
14
14
|
rules, then allow, block, challenge), first-party beacon and proof-of-work challenge,
|