globiguard-ruby
Official dependency-minimal Ruby SDK for GlobiGuard.
The package has no gem runtime dependencies. It uses Ruby stdlib for HTTP, HMAC, JSON, URL handling, and OpenSSL-backed Ed25519 entitlement verification where the installed Ruby/OpenSSL build supports Ed25519.
Install
gem install globiguard
Server client
require "globiguard"
client = GlobiGuard::Client.server(
environment: "sandbox",
services: { "controlPlane" => "https://api.globiguard.com" },
credential: GlobiGuard::Credential.secret("proj_example", "ggsk_example_replace_me", "sandbox")
)
decision = client.governed_actions.(
context: {
actionType: "refund.create",
destination: {
type: "custom",
name: "payments-production"
},
dataClasses: ["CONFIDENTIAL"],
actor: {
id: "support-agent-123",
type: "agent"
},
purpose: "Resolve an approved customer escalation",
correlationId: "case_456",
idempotencyKey: "case_456:refund:v1"
}
)
The governed client includes approval polling, queue review, evidence export,
evidence-package summaries, and incident replay. Only a current, short-lived,
obligation-free ALLOW explicitly authorizes the exact action once. MODIFY,
QUEUE, BLOCK, dry-run, expired, and incomplete responses stop the
authorize-or-throw path before a downstream action runs.
Webhooks
Pass the exact raw request body string. Do not parse and re-serialize JSON before verification.
result = GlobiGuard::TrustWebhook.verify(headers, raw_body, "whsec_example_replace_me")
raise result[:error] unless result[:ok]
Development
ruby -c lib/globiguard.rb
ruby test/smoke_test.rb
gem build globiguard.gemspec