karst 0.2.0 → 0.4.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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/ARCHITECTURE.md +6 -1
  3. data/CHANGELOG.md +82 -2
  4. data/CONTRIBUTING.md +9 -1
  5. data/README.md +118 -2
  6. data/docs/advanced-configuration.md +106 -0
  7. data/docs/rails8-authentication.md +24 -4
  8. data/docs/request-reproduction.md +242 -0
  9. data/lib/generators/karst/install/templates/karst_initializer.rb +6 -0
  10. data/lib/karst/access/approved_populations.rb +15 -6
  11. data/lib/karst/access/errors.rb +16 -0
  12. data/lib/karst/access/identity_probe.rb +151 -0
  13. data/lib/karst/access/local_path.rb +42 -0
  14. data/lib/karst/access/observed_endpoint.rb +46 -0
  15. data/lib/karst/access/outcome_groups.rb +93 -0
  16. data/lib/karst/access/population_discovery.rb +25 -1
  17. data/lib/karst/access/principal_source.rb +24 -3
  18. data/lib/karst/access/probe.rb +397 -0
  19. data/lib/karst/access/search.rb +14 -6
  20. data/lib/karst/access/sweep.rb +42 -112
  21. data/lib/karst/cli/identity_serialization.rb +82 -0
  22. data/lib/karst/cli/outcome_summary.rb +131 -0
  23. data/lib/karst/cli/principal_reference.rb +51 -0
  24. data/lib/karst/cli/reproduction.rb +267 -0
  25. data/lib/karst/cli/verification.rb +219 -55
  26. data/lib/karst/configuration.rb +52 -6
  27. data/lib/karst/identity/evidence.rb +110 -0
  28. data/lib/karst/identity/observation.rb +167 -0
  29. data/lib/karst/identity/warden_adapter.rb +26 -1
  30. data/lib/karst/identity.rb +157 -22
  31. data/lib/karst/mcp/compatibility.rb +24 -0
  32. data/lib/karst/mcp/reproduce_request_tool.rb +137 -0
  33. data/lib/karst/mcp/reproduction.rb +58 -0
  34. data/lib/karst/mcp/server.rb +27 -8
  35. data/lib/karst/mcp/verify_access_tool.rb +36 -2
  36. data/lib/karst/reproduction/curl.rb +73 -0
  37. data/lib/karst/reproduction/exercise.rb +246 -0
  38. data/lib/karst/reproduction/observation.rb +87 -0
  39. data/lib/karst/reproduction/sanitizer.rb +210 -0
  40. data/lib/karst/version.rb +1 -1
  41. data/lib/karst/web/middleware.rb +105 -16
  42. data/lib/karst/web/panel.rb +302 -47
  43. data/lib/karst.rb +2 -0
  44. data/lib/rails/commands/karst/mcp/mcp_command.rb +30 -3
  45. data/lib/rails/commands/karst/reproduce/reproduce_command.rb +67 -0
  46. data/lib/rails/commands/karst/verify/verify_command.rb +14 -2
  47. metadata +33 -6
@@ -12,17 +12,29 @@ module Rails
12
12
  include Karst::Boot
13
13
 
14
14
  class_option :json, type: :boolean, default: false, desc: "Emit stable JSON evidence"
15
+ class_option :anonymous, type: :boolean, default: false,
16
+ desc: "Probe with no principal established, and verify the " \
17
+ "application observed none"
18
+ class_option :as, type: :string,
19
+ desc: "Run as one specific existing principal instead of sampling one, " \
20
+ "e.g. --as User:72. Resolved only through Karst's own configured " \
21
+ "principal source(s); cannot be combined with --anonymous"
15
22
 
16
23
  desc "Verify bounded GET access to a local application path"
24
+ # rubocop:disable Metrics/AbcSize
17
25
  def perform(*arguments)
18
26
  method, path = parse(arguments)
19
27
  boot_karst_application!
20
- exit(::Karst::CLI::Verification.new(path: path, http_method: method, json: options[:json]).call)
28
+ exit(::Karst::CLI::Verification.new(path: path, http_method: method, json: options[:json],
29
+ identity: (:anonymous if options[:anonymous]),
30
+ as: options[:as]).call)
21
31
  rescue ArgumentError => e
22
- document = { schema_version: 1, error: { type: "input_error", message: e.message } }
32
+ document = { schema_version: ::Karst::CLI::Verification::SCHEMA_VERSION,
33
+ error: { type: "input_error", message: e.message } }
23
34
  puts(options[:json] ? JSON.generate(document) : "Karst cannot verify this route:\n#{e.message}")
24
35
  exit(2)
25
36
  end
37
+ # rubocop:enable Metrics/AbcSize
26
38
 
27
39
  private
28
40
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karst
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karst contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-13 00:00:00.000000000 Z
11
+ date: 2026-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -34,16 +34,22 @@ dependencies:
34
34
  name: mcp
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 1.5.0
40
+ - - "<"
38
41
  - !ruby/object:Gem::Version
39
- version: 0.9.0
42
+ version: '1.7'
40
43
  type: :development
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
44
- - - "~>"
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 1.5.0
50
+ - - "<"
45
51
  - !ruby/object:Gem::Version
46
- version: 0.9.0
52
+ version: '1.7'
47
53
  description: Karst tests Rails routes as a bounded set of existing users and reports
48
54
  runtime access evidence.
49
55
  email:
@@ -60,6 +66,7 @@ files:
60
66
  - SECURITY.md
61
67
  - docs/advanced-configuration.md
62
68
  - docs/rails8-authentication.md
69
+ - docs/request-reproduction.md
63
70
  - lib/generators/karst/install/install_generator.rb
64
71
  - lib/generators/karst/install/templates/karst_identity_controller.rb
65
72
  - lib/generators/karst/install/templates/karst_initializer.rb
@@ -67,6 +74,11 @@ files:
67
74
  - lib/karst/access/approved_populations.rb
68
75
  - lib/karst/access/candidate_population.rb
69
76
  - lib/karst/access/database_isolation.rb
77
+ - lib/karst/access/errors.rb
78
+ - lib/karst/access/identity_probe.rb
79
+ - lib/karst/access/local_path.rb
80
+ - lib/karst/access/observed_endpoint.rb
81
+ - lib/karst/access/outcome_groups.rb
70
82
  - lib/karst/access/population_approval.rb
71
83
  - lib/karst/access/population_approvals.rb
72
84
  - lib/karst/access/population_discovery.rb
@@ -75,20 +87,34 @@ files:
75
87
  - lib/karst/access/principal_selection.rb
76
88
  - lib/karst/access/principal_source.rb
77
89
  - lib/karst/access/principal_source_selection.rb
90
+ - lib/karst/access/probe.rb
78
91
  - lib/karst/access/probe_application.rb
79
92
  - lib/karst/access/search.rb
80
93
  - lib/karst/access/selected_principal_sources.rb
81
94
  - lib/karst/access/sensitive_attribute_names.rb
82
95
  - lib/karst/access/sweep.rb
96
+ - lib/karst/cli/identity_serialization.rb
97
+ - lib/karst/cli/outcome_summary.rb
98
+ - lib/karst/cli/principal_reference.rb
99
+ - lib/karst/cli/reproduction.rb
83
100
  - lib/karst/cli/verification.rb
84
101
  - lib/karst/configuration.rb
85
102
  - lib/karst/execution_context.rb
86
103
  - lib/karst/identity.rb
87
104
  - lib/karst/identity/devise_support.rb
105
+ - lib/karst/identity/evidence.rb
106
+ - lib/karst/identity/observation.rb
88
107
  - lib/karst/identity/warden_adapter.rb
108
+ - lib/karst/mcp/compatibility.rb
109
+ - lib/karst/mcp/reproduce_request_tool.rb
110
+ - lib/karst/mcp/reproduction.rb
89
111
  - lib/karst/mcp/server.rb
90
112
  - lib/karst/mcp/verify_access_tool.rb
91
113
  - lib/karst/railtie.rb
114
+ - lib/karst/reproduction/curl.rb
115
+ - lib/karst/reproduction/exercise.rb
116
+ - lib/karst/reproduction/observation.rb
117
+ - lib/karst/reproduction/sanitizer.rb
92
118
  - lib/karst/value.rb
93
119
  - lib/karst/version.rb
94
120
  - lib/karst/web/badge.rb
@@ -101,6 +127,7 @@ files:
101
127
  - lib/karst/web/route_lookup.rb
102
128
  - lib/rails/commands/karst/boot.rb
103
129
  - lib/rails/commands/karst/mcp/mcp_command.rb
130
+ - lib/rails/commands/karst/reproduce/reproduce_command.rb
104
131
  - lib/rails/commands/karst/verify/verify_command.rb
105
132
  homepage: https://github.com/SilenceDogood1984/karst
106
133
  licenses: