smplkit 2.0.6 → 2.0.8
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0750ea6383e472f36e7f3b2ffdb4b7a28117c311213da66cf20deaa8c28c1d74
|
|
4
|
+
data.tar.gz: 5dca82e7751526abc2d2fd2842d9b4f92be45892b09987e1b7c3d4dfd06ecfe0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dce04a53acfc4b3b6de5b89ac54392ab60ba175d0bf2294ab5d1432474c78ef6fa18d5fe379be321d23a3e0da869e21dc9fd31dd48e33a80c681116051ce73d8
|
|
7
|
+
data.tar.gz: 53ac80d537a14f41770fa1476755b261fd1aa42778f70d0bd4fae1079794ad4ba2c4052f4091982e032937364592ae572b9ac46421836349490eb0bf7189972b
|
|
@@ -83,7 +83,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
# List Events
|
|
86
|
-
# List audit events for the authenticated account. Default sort is ``-created_at``; cursor pagination via ``page[after]`` (the opaque cursor returned in ``links.next``). Filters are exact-match except ``filter[occurred_at]`` which uses the platform's range notation (``[2026-01-01T00:00:00Z,*)``).
|
|
86
|
+
# List audit events for the authenticated account. Default sort is ``-created_at``; cursor pagination via ``page[after]`` (the opaque cursor returned in ``links.next``). Filters are exact-match except ``filter[occurred_at]`` which uses the platform's range notation (``[2026-01-01T00:00:00Z,*)``) and ``filter[search]`` which is a case-insensitive substring match (per ADR-014; targets ``resource_id`` only at this revision).
|
|
87
87
|
# @param [Hash] opts the optional parameters
|
|
88
88
|
# @option opts [String] :filter_occurred_at
|
|
89
89
|
# @option opts [String] :filter_actor_type
|
|
@@ -91,6 +91,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
91
91
|
# @option opts [String] :filter_action
|
|
92
92
|
# @option opts [String] :filter_resource_type
|
|
93
93
|
# @option opts [String] :filter_resource_id
|
|
94
|
+
# @option opts [String] :filter_search Case-insensitive substring match. Searches against ``resource_id`` only — see ADR-014 for the platform-wide ``filter[search]`` convention. Use ``filter[resource_id]`` for an exact match.
|
|
94
95
|
# @option opts [Integer] :page_size
|
|
95
96
|
# @option opts [String] :page_after
|
|
96
97
|
# @return [EventListResponse]
|
|
@@ -100,7 +101,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
100
101
|
end
|
|
101
102
|
|
|
102
103
|
# List Events
|
|
103
|
-
# List audit events for the authenticated account. Default sort is ``-created_at``; cursor pagination via ``page[after]`` (the opaque cursor returned in ``links.next``). Filters are exact-match except ``filter[occurred_at]`` which uses the platform's range notation (``[2026-01-01T00:00:00Z,*)``).
|
|
104
|
+
# List audit events for the authenticated account. Default sort is ``-created_at``; cursor pagination via ``page[after]`` (the opaque cursor returned in ``links.next``). Filters are exact-match except ``filter[occurred_at]`` which uses the platform's range notation (``[2026-01-01T00:00:00Z,*)``) and ``filter[search]`` which is a case-insensitive substring match (per ADR-014; targets ``resource_id`` only at this revision).
|
|
104
105
|
# @param [Hash] opts the optional parameters
|
|
105
106
|
# @option opts [String] :filter_occurred_at
|
|
106
107
|
# @option opts [String] :filter_actor_type
|
|
@@ -108,6 +109,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
108
109
|
# @option opts [String] :filter_action
|
|
109
110
|
# @option opts [String] :filter_resource_type
|
|
110
111
|
# @option opts [String] :filter_resource_id
|
|
112
|
+
# @option opts [String] :filter_search Case-insensitive substring match. Searches against ``resource_id`` only — see ADR-014 for the platform-wide ``filter[search]`` convention. Use ``filter[resource_id]`` for an exact match.
|
|
111
113
|
# @option opts [Integer] :page_size
|
|
112
114
|
# @option opts [String] :page_after
|
|
113
115
|
# @return [Array<(EventListResponse, Integer, Hash)>] EventListResponse data, response status code and response headers
|
|
@@ -130,6 +132,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
130
132
|
query_params[:'filter[action]'] = opts[:'filter_action'] if !opts[:'filter_action'].nil?
|
|
131
133
|
query_params[:'filter[resource_type]'] = opts[:'filter_resource_type'] if !opts[:'filter_resource_type'].nil?
|
|
132
134
|
query_params[:'filter[resource_id]'] = opts[:'filter_resource_id'] if !opts[:'filter_resource_id'].nil?
|
|
135
|
+
query_params[:'filter[search]'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?
|
|
133
136
|
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
134
137
|
query_params[:'page[after]'] = opts[:'page_after'] if !opts[:'page_after'].nil?
|
|
135
138
|
|
|
@@ -46,7 +46,7 @@ describe 'EventsApi' do
|
|
|
46
46
|
|
|
47
47
|
# unit tests for list_events
|
|
48
48
|
# List Events
|
|
49
|
-
# List audit events for the authenticated account. Default sort is ``-created_at``; cursor pagination via ``page[after]`` (the opaque cursor returned in ``links.next``). Filters are exact-match except ``filter[occurred_at]`` which uses the platform's range notation (``[2026-01-01T00:00:00Z,*)``).
|
|
49
|
+
# List audit events for the authenticated account. Default sort is ``-created_at``; cursor pagination via ``page[after]`` (the opaque cursor returned in ``links.next``). Filters are exact-match except ``filter[occurred_at]`` which uses the platform's range notation (``[2026-01-01T00:00:00Z,*)``) and ``filter[search]`` which is a case-insensitive substring match (per ADR-014; targets ``resource_id`` only at this revision).
|
|
50
50
|
# @param [Hash] opts the optional parameters
|
|
51
51
|
# @option opts [String] :filter_occurred_at
|
|
52
52
|
# @option opts [String] :filter_actor_type
|
|
@@ -54,6 +54,7 @@ describe 'EventsApi' do
|
|
|
54
54
|
# @option opts [String] :filter_action
|
|
55
55
|
# @option opts [String] :filter_resource_type
|
|
56
56
|
# @option opts [String] :filter_resource_id
|
|
57
|
+
# @option opts [String] :filter_search Case-insensitive substring match. Searches against ``resource_id`` only — see ADR-014 for the platform-wide ``filter[search]`` convention. Use ``filter[resource_id]`` for an exact match.
|
|
57
58
|
# @option opts [Integer] :page_size
|
|
58
59
|
# @option opts [String] :page_after
|
|
59
60
|
# @return [EventListResponse]
|
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
module Smplkit
|
|
4
4
|
module Audit
|
|
5
|
+
# Public-facing enum for SIEM streaming destination types.
|
|
6
|
+
#
|
|
7
|
+
# Mirrors the +ForwarderType+ enum the audit OpenAPI spec emits
|
|
8
|
+
# (ADR-047 §2.12). Customers pass these constants — or any string
|
|
9
|
+
# in {VALUES} — to {Forwarders#create} / {Forwarders#update} /
|
|
10
|
+
# {Forwarders#list}. The wrapper validates membership before
|
|
11
|
+
# round-tripping to the wire.
|
|
12
|
+
module ForwarderType
|
|
13
|
+
HTTP = "http"
|
|
14
|
+
DATADOG = "datadog"
|
|
15
|
+
SPLUNK_HEC = "splunk_hec"
|
|
16
|
+
SUMO_LOGIC = "sumo_logic"
|
|
17
|
+
NEW_RELIC = "new_relic"
|
|
18
|
+
HONEYCOMB = "honeycomb"
|
|
19
|
+
ELASTIC = "elastic"
|
|
20
|
+
|
|
21
|
+
# Every supported value, in spec order. Useful for membership
|
|
22
|
+
# checks, dropdown population, or test parametrization.
|
|
23
|
+
VALUES = [HTTP, DATADOG, SPLUNK_HEC, SUMO_LOGIC, NEW_RELIC, HONEYCOMB, ELASTIC].freeze
|
|
24
|
+
|
|
25
|
+
# Coerce +value+ to a known wire-format slug, or raise ArgumentError.
|
|
26
|
+
# Strings round-trip transparently; nil passes through.
|
|
27
|
+
def self.coerce(value)
|
|
28
|
+
return nil if value.nil?
|
|
29
|
+
|
|
30
|
+
s = value.to_s
|
|
31
|
+
return s if VALUES.include?(s)
|
|
32
|
+
|
|
33
|
+
raise ArgumentError,
|
|
34
|
+
"Unknown ForwarderType #{value.inspect}; expected one of #{VALUES.inspect}"
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
5
38
|
# SIEM streaming forwarders for the authenticated account.
|
|
6
39
|
#
|
|
7
40
|
# Pro tier only — every method here raises a wrapped 402
|
|
@@ -17,14 +50,15 @@ module Smplkit
|
|
|
17
50
|
|
|
18
51
|
def create(name:, forwarder_type:, http:, enabled: true,
|
|
19
52
|
filter: nil, transform: nil, data: nil)
|
|
20
|
-
body = wrap_forwarder(nil, name, forwarder_type,
|
|
53
|
+
body = wrap_forwarder(nil, name, ForwarderType.coerce(forwarder_type),
|
|
54
|
+
http, enabled, filter, transform, data)
|
|
21
55
|
resp = @api.create_forwarder(body)
|
|
22
56
|
Forwarder.from_resource(resp.data)
|
|
23
57
|
end
|
|
24
58
|
|
|
25
59
|
def list(forwarder_type: nil, enabled: nil, page_size: nil, page_after: nil)
|
|
26
60
|
opts = {}
|
|
27
|
-
opts[:filter_forwarder_type] = forwarder_type if forwarder_type
|
|
61
|
+
opts[:filter_forwarder_type] = ForwarderType.coerce(forwarder_type) if forwarder_type
|
|
28
62
|
opts[:filter_enabled] = enabled unless enabled.nil?
|
|
29
63
|
opts[:page_size] = page_size if page_size
|
|
30
64
|
opts[:page_after] = page_after if page_after
|
|
@@ -40,7 +74,8 @@ module Smplkit
|
|
|
40
74
|
|
|
41
75
|
def update(forwarder_id, name:, forwarder_type:, http:, enabled: true,
|
|
42
76
|
filter: nil, transform: nil, data: nil)
|
|
43
|
-
body = wrap_forwarder(forwarder_id, name, forwarder_type,
|
|
77
|
+
body = wrap_forwarder(forwarder_id, name, ForwarderType.coerce(forwarder_type),
|
|
78
|
+
http, enabled, filter, transform, data)
|
|
44
79
|
resp = @api.update_forwarder(forwarder_id, body)
|
|
45
80
|
Forwarder.from_resource(resp.data)
|
|
46
81
|
end
|