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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 628f9e7c2f9d061a56e7627695b0fccb7e7d3416d284878e9b931b3be4dc82bf
4
- data.tar.gz: 735de6952ab6f22dc6e5c5c72773458d3ec9d165c6db9cb71dbc933a0e8fe401
3
+ metadata.gz: 224b2ccff9dd0cc4492209fd6b520d2d38201bfddfcf8c5fdc2425af601be015
4
+ data.tar.gz: deb7fa791f06d83e3ec9d7d07f9c10e6db7d6a21c6c7604347e30cc14f3e66fe
5
5
  SHA512:
6
- metadata.gz: 4d14f47f17124f90ebca0bcfba5cb314bec5f17d4807d2e2adcd0ba9ac58ba8bd5277983732c07ba06778222b69882ee46c7b2049439f7f58e4c180a7e961e1c
7
- data.tar.gz: 76a85c3d6d4720d79c9f0c1ba223e7dfdc5109edeb16b9659ce876eccb19923e8ff4d3ff1a2c5df94260e52a41d4266c694fbd65ec99dbcf34e9fdfba0f18d30
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.dev"
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.
@@ -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 = 0.0
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)}"
@@ -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.0"
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.0
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-09-14 00:00:00.000000000 Z
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,