argos-sdk 1.0.0
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 +7 -0
- data/CHANGELOG.md +27 -0
- data/LICENSE +21 -0
- data/README.md +184 -0
- data/docs/architecture.md +55 -0
- data/docs/benchmarks.md +29 -0
- data/docs/limits.md +44 -0
- data/docs/verification.md +52 -0
- data/lib/argos/adapters/http/http_spec_source.rb +30 -0
- data/lib/argos/adapters/http/net_http_transport.rb +106 -0
- data/lib/argos/application/services/response_interpreter.rb +44 -0
- data/lib/argos/application/services/spec_validation_service.rb +76 -0
- data/lib/argos/application/use_cases/block_entity.rb +40 -0
- data/lib/argos/application/use_cases/check_access.rb +65 -0
- data/lib/argos/application/use_cases/detect_environment.rb +31 -0
- data/lib/argos/application/use_cases/event_queue.rb +64 -0
- data/lib/argos/application/use_cases/get_decision.rb +18 -0
- data/lib/argos/application/use_cases/health_check.rb +20 -0
- data/lib/argos/application/use_cases/ingest_batch.rb +38 -0
- data/lib/argos/application/use_cases/ingest_event.rb +90 -0
- data/lib/argos/composition/argos_client.rb +83 -0
- data/lib/argos/domain/caching/blocklist_cache.rb +34 -0
- data/lib/argos/domain/configuration/config.rb +25 -0
- data/lib/argos/domain/errors/errors.rb +27 -0
- data/lib/argos/domain/events/event_normalizer.rb +138 -0
- data/lib/argos/domain/events/payload_builder.rb +67 -0
- data/lib/argos/domain/models/verdict.rb +24 -0
- data/lib/argos/domain/resilience/circuit_breaker.rb +50 -0
- data/lib/argos/domain/resilience/retry_calculator.rb +21 -0
- data/lib/argos/domain/validation/metadata_validator.rb +56 -0
- data/lib/argos/domain/validation/openapi_spec.rb +45 -0
- data/lib/argos/domain/validation/openapi_validator.rb +67 -0
- data/lib/argos/middleware.rb +159 -0
- data/lib/argos/ports/outbound/clock.rb +14 -0
- data/lib/argos/ports/outbound/diagnostics.rb +24 -0
- data/lib/argos/ports/outbound/spec_source.rb +13 -0
- data/lib/argos/ports/outbound/transport.rb +29 -0
- data/lib/argos/railtie.rb +28 -0
- data/lib/argos/version.rb +3 -0
- data/lib/argos-sdk.rb +4 -0
- data/lib/argos.rb +75 -0
- metadata +133 -0
data/lib/argos.rb
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Argos Security SDK for Ruby.
|
|
2
|
+
#
|
|
3
|
+
# Hexagonal architecture:
|
|
4
|
+
# • domain/ pure business logic, no I/O
|
|
5
|
+
# • ports/ interfaces (inbound + outbound)
|
|
6
|
+
# • application/ services + use cases composing the ports
|
|
7
|
+
# • adapters/http/ concrete outbound port implementations (Net::HTTP)
|
|
8
|
+
# • composition/ Argos::Client facade
|
|
9
|
+
# • middleware Rack-compatible driving adapter
|
|
10
|
+
|
|
11
|
+
require "argos/version"
|
|
12
|
+
|
|
13
|
+
# ─── Errors first — everything else may raise these ──────────────────────
|
|
14
|
+
require "argos/domain/errors/errors"
|
|
15
|
+
|
|
16
|
+
# ─── Configuration ──────────────────────────────────────────────────────
|
|
17
|
+
require "argos/domain/configuration/config"
|
|
18
|
+
|
|
19
|
+
# ─── Domain ─────────────────────────────────────────────────────────────
|
|
20
|
+
require "argos/domain/models/verdict"
|
|
21
|
+
require "argos/domain/resilience/circuit_breaker"
|
|
22
|
+
require "argos/domain/resilience/retry_calculator"
|
|
23
|
+
require "argos/domain/caching/blocklist_cache"
|
|
24
|
+
require "argos/domain/validation/openapi_spec"
|
|
25
|
+
require "argos/domain/validation/openapi_validator"
|
|
26
|
+
require "argos/domain/validation/metadata_validator"
|
|
27
|
+
require "argos/domain/events/event_normalizer"
|
|
28
|
+
require "argos/domain/events/payload_builder"
|
|
29
|
+
|
|
30
|
+
# ─── Ports ──────────────────────────────────────────────────────────────
|
|
31
|
+
require "argos/ports/outbound/clock"
|
|
32
|
+
require "argos/ports/outbound/diagnostics"
|
|
33
|
+
require "argos/ports/outbound/transport"
|
|
34
|
+
require "argos/ports/outbound/spec_source"
|
|
35
|
+
|
|
36
|
+
# ─── Application ────────────────────────────────────────────────────────
|
|
37
|
+
require "argos/application/services/response_interpreter"
|
|
38
|
+
require "argos/application/services/spec_validation_service"
|
|
39
|
+
require "argos/application/use_cases/ingest_event"
|
|
40
|
+
require "argos/application/use_cases/ingest_batch"
|
|
41
|
+
require "argos/application/use_cases/check_access"
|
|
42
|
+
require "argos/application/use_cases/block_entity"
|
|
43
|
+
require "argos/application/use_cases/get_decision"
|
|
44
|
+
require "argos/application/use_cases/detect_environment"
|
|
45
|
+
require "argos/application/use_cases/health_check"
|
|
46
|
+
require "argos/application/use_cases/event_queue"
|
|
47
|
+
|
|
48
|
+
# ─── Adapters ───────────────────────────────────────────────────────────
|
|
49
|
+
require "argos/adapters/http/net_http_transport"
|
|
50
|
+
require "argos/adapters/http/http_spec_source"
|
|
51
|
+
|
|
52
|
+
# ─── Composition (the public Client facade) ────────────────────────────
|
|
53
|
+
require "argos/composition/argos_client"
|
|
54
|
+
|
|
55
|
+
# ─── Middleware (Rack-compatible) ──────────────────────────────────────
|
|
56
|
+
require "argos/middleware"
|
|
57
|
+
|
|
58
|
+
if defined?(Rails)
|
|
59
|
+
require "argos/railtie"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# ─── Backwards-compat aliases ───────────────────────────────────────────
|
|
63
|
+
module Argos
|
|
64
|
+
Core = Module.new unless defined?(Core)
|
|
65
|
+
Core.const_set(:CircuitBreaker, Domain::Resilience::CircuitBreaker) unless Core.const_defined?(:CircuitBreaker)
|
|
66
|
+
Core.const_set(:RetryCalculator, Domain::Resilience::RetryCalculator) unless Core.const_defined?(:RetryCalculator)
|
|
67
|
+
Core.const_set(:BlocklistCache, Domain::Caching::BlocklistCache) unless Core.const_defined?(:BlocklistCache)
|
|
68
|
+
|
|
69
|
+
Validation = Module.new unless defined?(Validation)
|
|
70
|
+
Validation.const_set(:MetadataValidator, Domain::Validation::MetadataValidator) unless Validation.const_defined?(:MetadataValidator)
|
|
71
|
+
Validation.const_set(:SpecValidator, Application::Services::SpecValidationService) unless Validation.const_defined?(:SpecValidator)
|
|
72
|
+
|
|
73
|
+
Utils = Module.new unless defined?(Utils)
|
|
74
|
+
Utils.const_set(:PayloadBuilder, Domain::Events::PayloadBuilder) unless Utils.const_defined?(:PayloadBuilder)
|
|
75
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: argos-sdk
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Mohamed Salahy
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: rack
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '2.0'
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '4'
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
requirements:
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: '2.0'
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '4'
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: net-http
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0.2'
|
|
39
|
+
type: :runtime
|
|
40
|
+
prerelease: false
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0.2'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: json
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - ">="
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '2.0'
|
|
53
|
+
type: :runtime
|
|
54
|
+
prerelease: false
|
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '2.0'
|
|
60
|
+
description: A production-grade Ruby SDK for real-time threat detection and fraud
|
|
61
|
+
prevention through the Argos API.
|
|
62
|
+
email:
|
|
63
|
+
- salahi@argossecops.com
|
|
64
|
+
executables: []
|
|
65
|
+
extensions: []
|
|
66
|
+
extra_rdoc_files: []
|
|
67
|
+
files:
|
|
68
|
+
- CHANGELOG.md
|
|
69
|
+
- LICENSE
|
|
70
|
+
- README.md
|
|
71
|
+
- docs/architecture.md
|
|
72
|
+
- docs/benchmarks.md
|
|
73
|
+
- docs/limits.md
|
|
74
|
+
- docs/verification.md
|
|
75
|
+
- lib/argos-sdk.rb
|
|
76
|
+
- lib/argos.rb
|
|
77
|
+
- lib/argos/adapters/http/http_spec_source.rb
|
|
78
|
+
- lib/argos/adapters/http/net_http_transport.rb
|
|
79
|
+
- lib/argos/application/services/response_interpreter.rb
|
|
80
|
+
- lib/argos/application/services/spec_validation_service.rb
|
|
81
|
+
- lib/argos/application/use_cases/block_entity.rb
|
|
82
|
+
- lib/argos/application/use_cases/check_access.rb
|
|
83
|
+
- lib/argos/application/use_cases/detect_environment.rb
|
|
84
|
+
- lib/argos/application/use_cases/event_queue.rb
|
|
85
|
+
- lib/argos/application/use_cases/get_decision.rb
|
|
86
|
+
- lib/argos/application/use_cases/health_check.rb
|
|
87
|
+
- lib/argos/application/use_cases/ingest_batch.rb
|
|
88
|
+
- lib/argos/application/use_cases/ingest_event.rb
|
|
89
|
+
- lib/argos/composition/argos_client.rb
|
|
90
|
+
- lib/argos/domain/caching/blocklist_cache.rb
|
|
91
|
+
- lib/argos/domain/configuration/config.rb
|
|
92
|
+
- lib/argos/domain/errors/errors.rb
|
|
93
|
+
- lib/argos/domain/events/event_normalizer.rb
|
|
94
|
+
- lib/argos/domain/events/payload_builder.rb
|
|
95
|
+
- lib/argos/domain/models/verdict.rb
|
|
96
|
+
- lib/argos/domain/resilience/circuit_breaker.rb
|
|
97
|
+
- lib/argos/domain/resilience/retry_calculator.rb
|
|
98
|
+
- lib/argos/domain/validation/metadata_validator.rb
|
|
99
|
+
- lib/argos/domain/validation/openapi_spec.rb
|
|
100
|
+
- lib/argos/domain/validation/openapi_validator.rb
|
|
101
|
+
- lib/argos/middleware.rb
|
|
102
|
+
- lib/argos/ports/outbound/clock.rb
|
|
103
|
+
- lib/argos/ports/outbound/diagnostics.rb
|
|
104
|
+
- lib/argos/ports/outbound/spec_source.rb
|
|
105
|
+
- lib/argos/ports/outbound/transport.rb
|
|
106
|
+
- lib/argos/railtie.rb
|
|
107
|
+
- lib/argos/version.rb
|
|
108
|
+
homepage: https://www.argossecops.com/docs
|
|
109
|
+
licenses:
|
|
110
|
+
- MIT
|
|
111
|
+
metadata:
|
|
112
|
+
homepage_uri: https://www.argossecops.com/docs
|
|
113
|
+
source_code_uri: https://github.com/Argos-Security/argos-ruby
|
|
114
|
+
changelog_uri: https://github.com/Argos-Security/argos-ruby/blob/main/CHANGELOG.md
|
|
115
|
+
rubygems_mfa_required: 'true'
|
|
116
|
+
rdoc_options: []
|
|
117
|
+
require_paths:
|
|
118
|
+
- lib
|
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - ">="
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '3.1'
|
|
124
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
|
+
requirements:
|
|
126
|
+
- - ">="
|
|
127
|
+
- !ruby/object:Gem::Version
|
|
128
|
+
version: '0'
|
|
129
|
+
requirements: []
|
|
130
|
+
rubygems_version: 3.6.9
|
|
131
|
+
specification_version: 4
|
|
132
|
+
summary: Argos Security SDK for Ruby.
|
|
133
|
+
test_files: []
|