ravenrelay 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/README.md +9 -3
- data/lib/ravenrelay.rb +2 -2
- 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: 5a41d5bb8fd45a8fd69d45230f3ec294644aa3e686dfb7ae65a96fb429fb3580
|
|
4
|
+
data.tar.gz: 542982da296a861ad3095741402b9738b3b280cb0ca2c8082b995a74bf36083b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 34cc84b855f95696313cfbbf4fd164e87463b00cc28a4b148054329671ae37ef9212c057a6d7807eb95da8aaaa5a7377814573ea61cf9996dbb47f42a1148dd5
|
|
7
|
+
data.tar.gz: 2126c430814a84124b9de6cdefc6c9f3c299f38b46543f1b549944fcefe5635351f150800b539ddb825355db9b150cc4a27b111bfe23d3ce719e839aeff457b5
|
data/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# RavenRelay Ruby SDK
|
|
2
2
|
|
|
3
|
-
Ruby 3.1+.
|
|
3
|
+
Ruby 3.1+. Version 0.1.0 is published on RubyGems.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
gem install ravenrelay
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
For Bundler, add `gem 'ravenrelay', '~> 0.1'` to your Gemfile. Build and install locally for development:
|
|
4
10
|
|
|
5
11
|
```sh
|
|
6
12
|
cd sdks/ruby
|
|
@@ -16,7 +22,7 @@ email = client.emails.get(result['id'])
|
|
|
16
22
|
page = client.emails.list(status: 'sent', recipient: 'user@example.com')
|
|
17
23
|
```
|
|
18
24
|
|
|
19
|
-
Saved templates use `template`/`variables` instead of subject/body. Responses are hashes with string keys, preserving API fields. `RavenRelay::APIError` exposes `status`/`code`. `TransportError` means acceptance may be uncertain; `ProtocolError` indicates an invalid successful response. No automatic retries; retry only with the same idempotency key and body. The ten-second default timeout covers the whole request. Redirects are refused. Default origin: `https://api.
|
|
25
|
+
Saved templates use `template`/`variables` instead of subject/body. Responses are hashes with string keys, preserving API fields. `RavenRelay::APIError` exposes `status`/`code`. `TransportError` means acceptance may be uncertain; `ProtocolError` indicates an invalid successful response. No automatic retries; retry only with the same idempotency key and body. The ten-second default timeout covers the whole request. Redirects are refused. Default origin: `https://api.getravenrelay.com`; supply your deployed origin explicitly. Keep API keys server-side.
|
|
20
26
|
|
|
21
27
|
`RavenRelay.verify_webhook_signature(secret:, timestamp:, signature:, body:)` verifies original bytes with HMAC-SHA256, constant-time comparison, and a five-minute tolerance. Verify before parsing JSON and durably deduplicate event IDs. Optional `now` is Unix seconds for testing.
|
|
22
28
|
|
|
@@ -24,6 +30,6 @@ Saved templates use `template`/`variables` instead of subject/body. Responses ar
|
|
|
24
30
|
python3 sdks/testing/contract_server.py ruby sdks/ruby/test/contract.rb
|
|
25
31
|
```
|
|
26
32
|
|
|
27
|
-
|
|
33
|
+
Future releases use `.github/workflows/ruby-publish.yml` with RubyGems Trusted Publishing. See `docs/sdk-release-runbook.md`. No reuse license has been granted.
|
|
28
34
|
|
|
29
35
|
Security: remote origins must use HTTPS. Plain HTTP is accepted only for literal `localhost`, `127.0.0.1` and IPv6 loopback hosts. Credentials/query/fragment, whitespace and backslashes are rejected in API origins. Authentication/idempotency headers must be printable ASCII; `.` and `..` email IDs are rejected. Response bodies are limited to 16 MiB, valid UTF-8 and 64 JSON nesting levels. TLS certificate verification stays enabled. Use vendor-supported runtimes with current security patches; the compatibility floor does not promise that an old runtime is secure. See `docs/sdk-security-review.md` for dependency and release controls.
|
data/lib/ravenrelay.rb
CHANGED
|
@@ -6,7 +6,7 @@ require 'uri'
|
|
|
6
6
|
require 'timeout'
|
|
7
7
|
|
|
8
8
|
module RavenRelay
|
|
9
|
-
VERSION = '0.1.
|
|
9
|
+
VERSION = '0.1.1'
|
|
10
10
|
class APIError < StandardError
|
|
11
11
|
attr_reader :status, :code
|
|
12
12
|
def initialize(status, code, message)
|
|
@@ -19,7 +19,7 @@ module RavenRelay
|
|
|
19
19
|
|
|
20
20
|
class Client
|
|
21
21
|
attr_reader :emails
|
|
22
|
-
def initialize(api_key:, base_url: 'https://api.
|
|
22
|
+
def initialize(api_key:, base_url: 'https://api.getravenrelay.com', timeout: 10)
|
|
23
23
|
validate_header(api_key)
|
|
24
24
|
raise ArgumentError, 'Invalid base_url' if base_url.match?(/[\\\x00-\x20\x7f]/)
|
|
25
25
|
url = URI.parse(base_url)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ravenrelay
|
|
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
|
- RavenRelay
|
|
@@ -73,7 +73,7 @@ extra_rdoc_files: []
|
|
|
73
73
|
files:
|
|
74
74
|
- README.md
|
|
75
75
|
- lib/ravenrelay.rb
|
|
76
|
-
homepage: https://
|
|
76
|
+
homepage: https://getravenrelay.com
|
|
77
77
|
licenses:
|
|
78
78
|
- Nonstandard
|
|
79
79
|
metadata:
|