command_tower 0.10.0 → 0.11.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.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -3
  3. data/app/auth/command_tower/auth/auth_context.rb +10 -4
  4. data/app/controllers/command_tower/admin/application_controller.rb +27 -0
  5. data/app/controllers/command_tower/admin/audit/events_controller.rb +61 -0
  6. data/app/controllers/command_tower/admin/messaging/announcements_controller.rb +1 -8
  7. data/app/controllers/command_tower/admin/users/identities_controller.rb +77 -0
  8. data/app/controllers/command_tower/admin/users/impersonation_sessions_controller.rb +33 -0
  9. data/app/controllers/command_tower/admin/users/roles_controller.rb +40 -0
  10. data/app/controllers/command_tower/admin/users_controller.rb +46 -0
  11. data/app/controllers/command_tower/admin/workspace_controller.rb +15 -0
  12. data/app/controllers/command_tower/application_controller.rb +17 -1
  13. data/app/controllers/command_tower/auth/impersonation_session_controller.rb +27 -0
  14. data/app/controllers/command_tower/auth/logout_controller.rb +3 -1
  15. data/app/controllers/command_tower/auth/principal_capabilities_controller.rb +19 -0
  16. data/app/controllers/command_tower/me/audit_events_controller.rb +59 -0
  17. data/app/controllers/concerns/command_tower/api/application_response_renderer.rb +5 -0
  18. data/app/controllers/concerns/command_tower/auth/authentication_boundary.rb +3 -2
  19. data/app/controllers/concerns/command_tower/execution/http_boundary.rb +65 -0
  20. data/app/deserializers/command_tower/deserializers/admin/scope_parameter.rb +49 -0
  21. data/app/deserializers/command_tower/deserializers/admin/users.rb +218 -0
  22. data/app/deserializers/command_tower/deserializers/audit/events.rb +224 -0
  23. data/app/deserializers/command_tower/deserializers/clients/types.rb +27 -0
  24. data/app/errors/command_tower/errors/auth/admin_unavailable_during_impersonation_error.rb +17 -0
  25. data/app/errors/command_tower/errors/auth/default_membership_assignment_error.rb +17 -0
  26. data/app/errors/command_tower/errors/auth/impersonation_session_expired_error.rb +17 -0
  27. data/app/errors/command_tower/errors/auth/impersonation_session_missing_error.rb +21 -0
  28. data/app/errors/command_tower/errors/auth/nested_impersonation_error.rb +17 -0
  29. data/app/errors/command_tower/errors/auth/self_impersonation_error.rb +21 -0
  30. data/app/errors/command_tower/errors/continuation_exhausted_error.rb +25 -0
  31. data/app/jobs/command_tower/application_job.rb +7 -0
  32. data/app/jobs/command_tower/execution/job_boundary.rb +19 -0
  33. data/app/mailers/command_tower/application_mailer.rb +11 -1
  34. data/app/mailers/command_tower/messaging/channel_mailer.rb +1 -2
  35. data/app/models/command_tower/audit/event.rb +38 -0
  36. data/app/models/command_tower/impersonation/session.rb +51 -0
  37. data/app/serializers/command_tower/serializers/admin/users.rb +69 -0
  38. data/app/serializers/command_tower/serializers/admin/workspace/manifest_serializer.rb +58 -0
  39. data/app/serializers/command_tower/serializers/audit/events/filter_options_serializer.rb +44 -0
  40. data/app/serializers/command_tower/serializers/audit/events.rb +42 -0
  41. data/app/serializers/command_tower/serializers/auth/principal_capabilities_serializer.rb +15 -0
  42. data/app/serializers/command_tower/serializers/auth/session_response_serializer.rb +26 -2
  43. data/app/serializers/command_tower/serializers/impersonation/session_serializer.rb +19 -0
  44. data/app/services/command_tower/README.md +4 -10
  45. data/app/services/command_tower/authorize/validate.rb +7 -4
  46. data/app/services/command_tower/jwt/authenticate_user.rb +8 -2
  47. data/app/services/command_tower/jwt/authentication_outcome.rb +5 -4
  48. data/app/services/command_tower/jwt/login_create.rb +7 -4
  49. data/app/services/command_tower/messaging/accept/operation_logger.rb +3 -3
  50. data/app/services/command_tower/messaging/contract/observability/correlation.rb +3 -1
  51. data/app/services/command_tower/messaging/contract/observability/operation_logger.rb +3 -3
  52. data/app/services/command_tower/messaging/contract/observability/publisher.rb +44 -0
  53. data/app/services/command_tower/messaging/execution/operation_logger.rb +1 -1
  54. data/app/services/command_tower/messaging/handoff/operation_logger.rb +1 -1
  55. data/app/services/command_tower/messaging/inbox/operation_logger.rb +1 -1
  56. data/app/services/command_tower/messaging/planner/operation_logger.rb +1 -1
  57. data/app/services/command_tower/messaging/recipient_readiness/evaluate.rb +1 -1
  58. data/app/services/command_tower/service_base.rb +30 -43
  59. data/app/services/command_tower/service_logging.rb +2 -36
  60. data/app/services/command_tower/services/account/clear_phone.rb +8 -0
  61. data/app/services/command_tower/services/account/phone_verification/verify.rb +1 -0
  62. data/app/services/command_tower/services/account/update_phone.rb +9 -1
  63. data/app/services/command_tower/services/admin/users.rb +377 -0
  64. data/app/services/command_tower/services/admin/workspace/manifest.rb +49 -0
  65. data/app/services/command_tower/services/application_service.rb +37 -0
  66. data/app/services/command_tower/services/audit/events/filter_options.rb +75 -0
  67. data/app/services/command_tower/services/audit/events.rb +199 -0
  68. data/app/services/command_tower/services/auth/assign_default_membership_role.rb +44 -0
  69. data/app/services/command_tower/services/auth/authenticate_session.rb +33 -6
  70. data/app/services/command_tower/services/auth/email_verification/verify.rb +2 -0
  71. data/app/services/command_tower/services/auth/password_reset/reset.rb +13 -3
  72. data/app/services/command_tower/services/auth/plain_text/login.rb +9 -1
  73. data/app/services/command_tower/services/auth/principal_capabilities/project.rb +48 -0
  74. data/app/services/command_tower/services/impersonation/create.rb +29 -0
  75. data/app/services/command_tower/services/impersonation/end.rb +28 -0
  76. data/app/services/command_tower/services/impersonation/record_activity.rb +30 -0
  77. data/app/services/command_tower/services/impersonation/terminate_open_sessions.rb +51 -0
  78. data/app/services/command_tower/services/me/change_password.rb +12 -0
  79. data/app/shared_sequences/command_tower/shared_sequences/admin/users/resolve_scoped_user.rb +42 -0
  80. data/app/workflows/command_tower/transactional.rb +65 -0
  81. data/app/workflows/command_tower/workflows/admin/messaging/create_announcement_workflow.rb +11 -0
  82. data/app/workflows/command_tower/workflows/admin/scope_resolution.rb +17 -0
  83. data/app/workflows/command_tower/workflows/admin/users/error_mapping.rb +26 -0
  84. data/app/workflows/command_tower/workflows/admin/users/identity_mutation.rb +30 -0
  85. data/app/workflows/command_tower/workflows/admin/users/list_assignable_roles_workflow.rb +30 -0
  86. data/app/workflows/command_tower/workflows/admin/users/list_workflow.rb +54 -0
  87. data/app/workflows/command_tower/workflows/admin/users/set_email_validated_workflow.rb +45 -0
  88. data/app/workflows/command_tower/workflows/admin/users/show_workflow.rb +49 -0
  89. data/app/workflows/command_tower/workflows/admin/users/update_email_workflow.rb +45 -0
  90. data/app/workflows/command_tower/workflows/admin/users/update_name_workflow.rb +49 -0
  91. data/app/workflows/command_tower/workflows/admin/users/update_roles_workflow.rb +61 -0
  92. data/app/workflows/command_tower/workflows/admin/users/update_username_workflow.rb +45 -0
  93. data/app/workflows/command_tower/workflows/admin/workspace/manifest_workflow.rb +25 -0
  94. data/app/workflows/command_tower/workflows/application_workflow.rb +163 -24
  95. data/app/workflows/command_tower/workflows/audit/error_mapping.rb +24 -0
  96. data/app/workflows/command_tower/workflows/audit/events/filter_options_for_admin_workflow.rb +34 -0
  97. data/app/workflows/command_tower/workflows/audit/events/filter_options_for_user_workflow.rb +34 -0
  98. data/app/workflows/command_tower/workflows/audit/events/list_for_admin_workflow.rb +74 -0
  99. data/app/workflows/command_tower/workflows/audit/events/list_for_user_workflow.rb +45 -0
  100. data/app/workflows/command_tower/workflows/audit/events/show_for_admin_workflow.rb +54 -0
  101. data/app/workflows/command_tower/workflows/audit/events/show_for_user_workflow.rb +42 -0
  102. data/app/workflows/command_tower/workflows/auth/authenticate_request_workflow.rb +3 -2
  103. data/app/workflows/command_tower/workflows/auth/authentication_response_effects.rb +5 -1
  104. data/app/workflows/command_tower/workflows/auth/logout_workflow.rb +41 -1
  105. data/app/workflows/command_tower/workflows/auth/plain_text/login_workflow.rb +2 -0
  106. data/app/workflows/command_tower/workflows/auth/principal_capabilities/show_workflow.rb +27 -0
  107. data/app/workflows/command_tower/workflows/auth/register_workflow.rb +56 -24
  108. data/app/workflows/command_tower/workflows/auth/session/show_workflow.rb +15 -1
  109. data/app/workflows/command_tower/workflows/auth/session_error_status.rb +1 -0
  110. data/app/workflows/command_tower/workflows/impersonation/error_mapping.rb +27 -0
  111. data/app/workflows/command_tower/workflows/impersonation/start_workflow.rb +97 -0
  112. data/app/workflows/command_tower/workflows/impersonation/stop_workflow.rb +66 -0
  113. data/app/workflows/command_tower/workflows/me/update_name_workflow.rb +1 -0
  114. data/app/workflows/command_tower/workflows/profile/show_workflow.rb +1 -0
  115. data/app/workflows/command_tower/workflows/workflow_result.rb +31 -7
  116. data/config/routes.rb +20 -0
  117. data/db/migrate/20260816000001_create_command_tower_audit_events.rb +45 -0
  118. data/db/migrate/20260817000001_add_scope_columns_to_command_tower_audit_events.rb +34 -0
  119. data/db/migrate/20260817000003_create_command_tower_impersonation_sessions.rb +26 -0
  120. data/docs/admin_workspace.md +158 -0
  121. data/docs/api_reference.md +175 -14
  122. data/docs/architecture.md +5 -0
  123. data/docs/audit.md +195 -0
  124. data/docs/authentication.md +14 -0
  125. data/docs/authentication_authorization_guide.md +15 -11
  126. data/docs/authorization.md +25 -4
  127. data/docs/controllers.md +7 -1
  128. data/docs/eventing.md +179 -0
  129. data/docs/extending.md +32 -1
  130. data/docs/host_integration_guide.md +103 -12
  131. data/docs/initializing.md +2 -2
  132. data/docs/messaging_integration_guide.md +1 -1
  133. data/docs/models.md +4 -0
  134. data/docs/pagination.md +2 -2
  135. data/docs/principal_capabilities.md +89 -0
  136. data/docs/upgrades/0.10.0.md +2 -2
  137. data/docs/upgrades/0.11.0.md +92 -0
  138. data/docs/upgrades/0.11.1.md +25 -0
  139. data/docs/upgrades/README.md +2 -0
  140. data/lib/command_tower/admin_scope/apply_audit_scoping.rb +45 -0
  141. data/lib/command_tower/admin_scope/apply_users_narrowing.rb +21 -0
  142. data/lib/command_tower/admin_scope/manifest_projection.rb +102 -0
  143. data/lib/command_tower/admin_scope/resolve.rb +31 -0
  144. data/lib/command_tower/admin_scope/scope_context.rb +7 -0
  145. data/lib/command_tower/admin_scope/scope_option.rb +7 -0
  146. data/lib/command_tower/admin_scope.rb +20 -0
  147. data/lib/command_tower/admin_workspace.rb +16 -0
  148. data/lib/command_tower/audit/attribution.rb +90 -0
  149. data/lib/command_tower/audit/emit.rb +113 -0
  150. data/lib/command_tower/audit/masking.rb +41 -0
  151. data/lib/command_tower/audit/payload.rb +128 -0
  152. data/lib/command_tower/audit/persistence/subscriber.rb +85 -0
  153. data/lib/command_tower/audit.rb +27 -0
  154. data/lib/command_tower/authorization/assignable_roles.rb +36 -0
  155. data/lib/command_tower/authorization/default.yml +99 -5
  156. data/lib/command_tower/authorization/effective_entity_grants.rb +55 -0
  157. data/lib/command_tower/authorization/entity.rb +15 -5
  158. data/lib/command_tower/authorization/role.rb +5 -4
  159. data/lib/command_tower/authorization.rb +71 -10
  160. data/lib/command_tower/configuration/admin_scope/config.rb +104 -0
  161. data/lib/command_tower/configuration/admin_scope/tool_registration.rb +28 -0
  162. data/lib/command_tower/configuration/authorization/config.rb +6 -0
  163. data/lib/command_tower/configuration/config.rb +20 -0
  164. data/lib/command_tower/configuration/impersonation/config.rb +38 -0
  165. data/lib/command_tower/configuration/registry/admin_workspace/config.rb +199 -0
  166. data/lib/command_tower/configuration/registry/admin_workspace/tool_definition.rb +150 -0
  167. data/lib/command_tower/configuration/registry/audit/config.rb +403 -0
  168. data/lib/command_tower/configuration/registry/audit/event_definition.rb +155 -0
  169. data/lib/command_tower/configuration/registry/config.rb +34 -0
  170. data/lib/command_tower/configuration/registry/principal_capabilities/capability_definition.rb +43 -0
  171. data/lib/command_tower/configuration/registry/principal_capabilities/config.rb +136 -0
  172. data/lib/command_tower/current.rb +12 -0
  173. data/lib/command_tower/engine.rb +19 -4
  174. data/lib/command_tower/events.rb +184 -0
  175. data/lib/command_tower/execution.rb +111 -0
  176. data/lib/command_tower/impersonation/activity_declaration.rb +23 -0
  177. data/lib/command_tower/impersonation/apply_overlay.rb +88 -0
  178. data/lib/command_tower/impersonation/clear_overlay_for_audit.rb +23 -0
  179. data/lib/command_tower/impersonation/establish_identity.rb +44 -0
  180. data/lib/command_tower/install/baseline.rb +3 -0
  181. data/lib/command_tower/logging/lifecycle_declaration.rb +27 -0
  182. data/lib/command_tower/logging/projection.rb +67 -0
  183. data/lib/command_tower/logging/subscriber.rb +103 -0
  184. data/lib/command_tower/principal_capabilities.rb +15 -0
  185. data/lib/command_tower/version.rb +1 -1
  186. data/lib/command_tower.rb +12 -0
  187. data/spec/factories/impersonation_session.rb +17 -0
  188. data/spec/factories/user.rb +16 -0
  189. metadata +114 -3
  190. data/app/services/command_tower/messaging/contract/observability/structured_logger.rb +0 -56
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: command_tower
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - matt-taylor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-21 00:00:00.000000000 Z
11
+ date: 2026-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phonelib
@@ -184,22 +184,32 @@ files:
184
184
  - app/auth/command_tower/auth/auth_context.rb
185
185
  - app/auth/command_tower/auth/password_recovery_session_context.rb
186
186
  - app/auth/command_tower/auth/signup_session_context.rb
187
+ - app/controllers/command_tower/admin/application_controller.rb
188
+ - app/controllers/command_tower/admin/audit/events_controller.rb
187
189
  - app/controllers/command_tower/admin/messaging/announcements_controller.rb
190
+ - app/controllers/command_tower/admin/users/identities_controller.rb
191
+ - app/controllers/command_tower/admin/users/impersonation_sessions_controller.rb
192
+ - app/controllers/command_tower/admin/users/roles_controller.rb
193
+ - app/controllers/command_tower/admin/users_controller.rb
194
+ - app/controllers/command_tower/admin/workspace_controller.rb
188
195
  - app/controllers/command_tower/application_controller.rb
189
196
  - app/controllers/command_tower/auth/email/availability_controller.rb
190
197
  - app/controllers/command_tower/auth/email_verification/send_controller.rb
191
198
  - app/controllers/command_tower/auth/email_verification/verify_controller.rb
192
199
  - app/controllers/command_tower/auth/identity_policy_controller.rb
200
+ - app/controllers/command_tower/auth/impersonation_session_controller.rb
193
201
  - app/controllers/command_tower/auth/logout_controller.rb
194
202
  - app/controllers/command_tower/auth/password_recovery_session/create_controller.rb
195
203
  - app/controllers/command_tower/auth/password_reset/reset_controller.rb
196
204
  - app/controllers/command_tower/auth/password_reset/send_controller.rb
197
205
  - app/controllers/command_tower/auth/password_reset/validate_controller.rb
198
206
  - app/controllers/command_tower/auth/plain_text/login_controller.rb
207
+ - app/controllers/command_tower/auth/principal_capabilities_controller.rb
199
208
  - app/controllers/command_tower/auth/register_controller.rb
200
209
  - app/controllers/command_tower/auth/session_controller.rb
201
210
  - app/controllers/command_tower/auth/signup_session/create_controller.rb
202
211
  - app/controllers/command_tower/auth/username/availability_controller.rb
212
+ - app/controllers/command_tower/me/audit_events_controller.rb
203
213
  - app/controllers/command_tower/me/inbox_controller.rb
204
214
  - app/controllers/command_tower/me/name_controller.rb
205
215
  - app/controllers/command_tower/me/password_controller.rb
@@ -218,8 +228,12 @@ files:
218
228
  - app/controllers/concerns/command_tower/auth/invalid_credentials_deserializer_renderer.rb
219
229
  - app/controllers/concerns/command_tower/auth/password_recovery_session_boundary.rb
220
230
  - app/controllers/concerns/command_tower/auth/signup_session_boundary.rb
231
+ - app/controllers/concerns/command_tower/execution/http_boundary.rb
221
232
  - app/deserializers/command_tower/deserializers/admin/messaging/create_announcement_deserializer.rb
233
+ - app/deserializers/command_tower/deserializers/admin/scope_parameter.rb
234
+ - app/deserializers/command_tower/deserializers/admin/users.rb
222
235
  - app/deserializers/command_tower/deserializers/application_deserializer.rb
236
+ - app/deserializers/command_tower/deserializers/audit/events.rb
223
237
  - app/deserializers/command_tower/deserializers/auth/email_availability_deserializer.rb
224
238
  - app/deserializers/command_tower/deserializers/auth/email_verification/verify_deserializer.rb
225
239
  - app/deserializers/command_tower/deserializers/auth/password_reset/reset_deserializer.rb
@@ -257,11 +271,16 @@ files:
257
271
  - app/errors/command_tower/errors/account/pushover_verification_failed_error.rb
258
272
  - app/errors/command_tower/errors/account/sms_capability_unavailable_error.rb
259
273
  - app/errors/command_tower/errors/application_error.rb
274
+ - app/errors/command_tower/errors/auth/admin_unavailable_during_impersonation_error.rb
260
275
  - app/errors/command_tower/errors/auth/csrf_mismatch_error.rb
261
276
  - app/errors/command_tower/errors/auth/csrf_missing_error.rb
277
+ - app/errors/command_tower/errors/auth/default_membership_assignment_error.rb
262
278
  - app/errors/command_tower/errors/auth/email_already_registered_error.rb
263
279
  - app/errors/command_tower/errors/auth/email_verification_required_error.rb
280
+ - app/errors/command_tower/errors/auth/impersonation_session_expired_error.rb
281
+ - app/errors/command_tower/errors/auth/impersonation_session_missing_error.rb
264
282
  - app/errors/command_tower/errors/auth/invalid_credentials_error.rb
283
+ - app/errors/command_tower/errors/auth/nested_impersonation_error.rb
265
284
  - app/errors/command_tower/errors/auth/password_recovery_ip_rate_limit_error.rb
266
285
  - app/errors/command_tower/errors/auth/password_recovery_session_expired_error.rb
267
286
  - app/errors/command_tower/errors/auth/password_recovery_session_invalid_error.rb
@@ -269,6 +288,7 @@ files:
269
288
  - app/errors/command_tower/errors/auth/password_recovery_session_rate_limit_error.rb
270
289
  - app/errors/command_tower/errors/auth/password_reset_invalid_token_error.rb
271
290
  - app/errors/command_tower/errors/auth/password_reset_unavailable_error.rb
291
+ - app/errors/command_tower/errors/auth/self_impersonation_error.rb
272
292
  - app/errors/command_tower/errors/auth/signup_ip_rate_limit_error.rb
273
293
  - app/errors/command_tower/errors/auth/signup_session_expired_error.rb
274
294
  - app/errors/command_tower/errors/auth/signup_session_invalid_error.rb
@@ -276,6 +296,7 @@ files:
276
296
  - app/errors/command_tower/errors/auth/signup_session_rate_limit_error.rb
277
297
  - app/errors/command_tower/errors/auth/verification_code_invalid_error.rb
278
298
  - app/errors/command_tower/errors/auth/verification_send_failed_error.rb
299
+ - app/errors/command_tower/errors/continuation_exhausted_error.rb
279
300
  - app/errors/command_tower/errors/forbidden_error.rb
280
301
  - app/errors/command_tower/errors/internal_error.rb
281
302
  - app/errors/command_tower/errors/messaging/accept_rejected_error.rb
@@ -286,6 +307,7 @@ files:
286
307
  - app/errors/command_tower/errors/validation_error.rb
287
308
  - app/helpers/command_tower/application_helper.rb
288
309
  - app/jobs/command_tower/application_job.rb
310
+ - app/jobs/command_tower/execution/job_boundary.rb
289
311
  - app/jobs/command_tower/messaging/channel_delivery_execution_job.rb
290
312
  - app/jobs/command_tower/messaging/communications/produce_recipient_job.rb
291
313
  - app/jobs/command_tower/messaging/execution_recovery_job.rb
@@ -296,6 +318,8 @@ files:
296
318
  - app/mailers/command_tower/messaging/channel_mailer.rb
297
319
  - app/mailers/command_tower/password_reset_mailer.rb
298
320
  - app/models/command_tower/application_record.rb
321
+ - app/models/command_tower/audit/event.rb
322
+ - app/models/command_tower/impersonation/session.rb
299
323
  - app/models/command_tower/messaging/channel_delivery.rb
300
324
  - app/models/command_tower/messaging/communication.rb
301
325
  - app/models/command_tower/messaging/delivery_attempt.rb
@@ -307,9 +331,13 @@ files:
307
331
  - app/models/user.rb
308
332
  - app/models/user_secret.rb
309
333
  - app/serializers/command_tower/serializers/admin/messaging/announcement_response_serializer.rb
334
+ - app/serializers/command_tower/serializers/admin/users.rb
335
+ - app/serializers/command_tower/serializers/admin/workspace/manifest_serializer.rb
310
336
  - app/serializers/command_tower/serializers/application/envelope_serializer.rb
311
337
  - app/serializers/command_tower/serializers/application/error_entry_serializer.rb
312
338
  - app/serializers/command_tower/serializers/application_serializer.rb
339
+ - app/serializers/command_tower/serializers/audit/events.rb
340
+ - app/serializers/command_tower/serializers/audit/events/filter_options_serializer.rb
313
341
  - app/serializers/command_tower/serializers/auth/email_availability_serializer.rb
314
342
  - app/serializers/command_tower/serializers/auth/email_verification/message_response_serializer.rb
315
343
  - app/serializers/command_tower/serializers/auth/identity_policy_serializer.rb
@@ -318,11 +346,13 @@ files:
318
346
  - app/serializers/command_tower/serializers/auth/password_recovery_session_response_serializer.rb
319
347
  - app/serializers/command_tower/serializers/auth/password_reset/message_response_serializer.rb
320
348
  - app/serializers/command_tower/serializers/auth/password_reset/validate_response_serializer.rb
349
+ - app/serializers/command_tower/serializers/auth/principal_capabilities_serializer.rb
321
350
  - app/serializers/command_tower/serializers/auth/register_response_serializer.rb
322
351
  - app/serializers/command_tower/serializers/auth/session_response_serializer.rb
323
352
  - app/serializers/command_tower/serializers/auth/signup_session_response_serializer.rb
324
353
  - app/serializers/command_tower/serializers/auth/user_serializer.rb
325
354
  - app/serializers/command_tower/serializers/auth/username_availability_serializer.rb
355
+ - app/serializers/command_tower/serializers/impersonation/session_serializer.rb
326
356
  - app/serializers/command_tower/serializers/me/account_serializer.rb
327
357
  - app/serializers/command_tower/serializers/me/change_password_response_serializer.rb
328
358
  - app/serializers/command_tower/serializers/me/pushover_serializer.rb
@@ -406,7 +436,7 @@ files:
406
436
  - app/services/command_tower/messaging/contract/not_found_error.rb
407
437
  - app/services/command_tower/messaging/contract/observability/correlation.rb
408
438
  - app/services/command_tower/messaging/contract/observability/operation_logger.rb
409
- - app/services/command_tower/messaging/contract/observability/structured_logger.rb
439
+ - app/services/command_tower/messaging/contract/observability/publisher.rb
410
440
  - app/services/command_tower/messaging/contract/requests/find_communication.rb
411
441
  - app/services/command_tower/messaging/contract/results/channel_delivery_result.rb
412
442
  - app/services/command_tower/messaging/contract/results/communication_result.rb
@@ -559,7 +589,12 @@ files:
559
589
  - app/services/command_tower/services/account/pushover/show.rb
560
590
  - app/services/command_tower/services/account/pushover/verify.rb
561
591
  - app/services/command_tower/services/account/update_phone.rb
592
+ - app/services/command_tower/services/admin/users.rb
593
+ - app/services/command_tower/services/admin/workspace/manifest.rb
562
594
  - app/services/command_tower/services/application_service.rb
595
+ - app/services/command_tower/services/audit/events.rb
596
+ - app/services/command_tower/services/audit/events/filter_options.rb
597
+ - app/services/command_tower/services/auth/assign_default_membership_role.rb
563
598
  - app/services/command_tower/services/auth/authenticate_session.rb
564
599
  - app/services/command_tower/services/auth/authorize_request.rb
565
600
  - app/services/command_tower/services/auth/client_ip_resolver.rb
@@ -579,6 +614,7 @@ files:
579
614
  - app/services/command_tower/services/auth/password_reset/token_verification.rb
580
615
  - app/services/command_tower/services/auth/password_reset/validate.rb
581
616
  - app/services/command_tower/services/auth/plain_text/login.rb
617
+ - app/services/command_tower/services/auth/principal_capabilities/project.rb
582
618
  - app/services/command_tower/services/auth/register.rb
583
619
  - app/services/command_tower/services/auth/signup_rate_limits/check_availability.rb
584
620
  - app/services/command_tower/services/auth/signup_rate_limits/check_register.rb
@@ -589,6 +625,10 @@ files:
589
625
  - app/services/command_tower/services/auth/signup_session/encode.rb
590
626
  - app/services/command_tower/services/auth/signup_session/validate.rb
591
627
  - app/services/command_tower/services/auth/username_availability.rb
628
+ - app/services/command_tower/services/impersonation/create.rb
629
+ - app/services/command_tower/services/impersonation/end.rb
630
+ - app/services/command_tower/services/impersonation/record_activity.rb
631
+ - app/services/command_tower/services/impersonation/terminate_open_sessions.rb
592
632
  - app/services/command_tower/services/me/capabilities.rb
593
633
  - app/services/command_tower/services/me/change_password.rb
594
634
  - app/services/command_tower/services/me/pushover_product_gate.rb
@@ -605,6 +645,7 @@ files:
605
645
  - app/services/command_tower/services/service_result.rb
606
646
  - app/services/command_tower/user_attributes/mutate.rb
607
647
  - app/services/command_tower/username/available.rb
648
+ - app/shared_sequences/command_tower/shared_sequences/admin/users/resolve_scoped_user.rb
608
649
  - app/views/command_tower/email_verification_mailer/verify_email.html.erb
609
650
  - app/views/command_tower/messaging/rendering/email.html.erb
610
651
  - app/views/command_tower/messaging/rendering/email.text.erb
@@ -613,8 +654,28 @@ files:
613
654
  - app/views/command_tower/password_reset_mailer/reset_password.html.erb
614
655
  - app/views/layouts/mailer.html.erb
615
656
  - app/views/layouts/mailer.text.erb
657
+ - app/workflows/command_tower/transactional.rb
616
658
  - app/workflows/command_tower/workflows/admin/messaging/create_announcement_workflow.rb
659
+ - app/workflows/command_tower/workflows/admin/scope_resolution.rb
660
+ - app/workflows/command_tower/workflows/admin/users/error_mapping.rb
661
+ - app/workflows/command_tower/workflows/admin/users/identity_mutation.rb
662
+ - app/workflows/command_tower/workflows/admin/users/list_assignable_roles_workflow.rb
663
+ - app/workflows/command_tower/workflows/admin/users/list_workflow.rb
664
+ - app/workflows/command_tower/workflows/admin/users/set_email_validated_workflow.rb
665
+ - app/workflows/command_tower/workflows/admin/users/show_workflow.rb
666
+ - app/workflows/command_tower/workflows/admin/users/update_email_workflow.rb
667
+ - app/workflows/command_tower/workflows/admin/users/update_name_workflow.rb
668
+ - app/workflows/command_tower/workflows/admin/users/update_roles_workflow.rb
669
+ - app/workflows/command_tower/workflows/admin/users/update_username_workflow.rb
670
+ - app/workflows/command_tower/workflows/admin/workspace/manifest_workflow.rb
617
671
  - app/workflows/command_tower/workflows/application_workflow.rb
672
+ - app/workflows/command_tower/workflows/audit/error_mapping.rb
673
+ - app/workflows/command_tower/workflows/audit/events/filter_options_for_admin_workflow.rb
674
+ - app/workflows/command_tower/workflows/audit/events/filter_options_for_user_workflow.rb
675
+ - app/workflows/command_tower/workflows/audit/events/list_for_admin_workflow.rb
676
+ - app/workflows/command_tower/workflows/audit/events/list_for_user_workflow.rb
677
+ - app/workflows/command_tower/workflows/audit/events/show_for_admin_workflow.rb
678
+ - app/workflows/command_tower/workflows/audit/events/show_for_user_workflow.rb
618
679
  - app/workflows/command_tower/workflows/auth/authenticate_request_workflow.rb
619
680
  - app/workflows/command_tower/workflows/auth/authentication_response_effects.rb
620
681
  - app/workflows/command_tower/workflows/auth/authorize_request_workflow.rb
@@ -630,6 +691,7 @@ files:
630
691
  - app/workflows/command_tower/workflows/auth/password_reset/send_workflow.rb
631
692
  - app/workflows/command_tower/workflows/auth/password_reset/validate_workflow.rb
632
693
  - app/workflows/command_tower/workflows/auth/plain_text/login_workflow.rb
694
+ - app/workflows/command_tower/workflows/auth/principal_capabilities/show_workflow.rb
633
695
  - app/workflows/command_tower/workflows/auth/register_workflow.rb
634
696
  - app/workflows/command_tower/workflows/auth/session/show_workflow.rb
635
697
  - app/workflows/command_tower/workflows/auth/session_error_status.rb
@@ -637,6 +699,9 @@ files:
637
699
  - app/workflows/command_tower/workflows/auth/signup_session/authenticate_workflow.rb
638
700
  - app/workflows/command_tower/workflows/auth/signup_session/create_workflow.rb
639
701
  - app/workflows/command_tower/workflows/auth/username_availability_workflow.rb
702
+ - app/workflows/command_tower/workflows/impersonation/error_mapping.rb
703
+ - app/workflows/command_tower/workflows/impersonation/start_workflow.rb
704
+ - app/workflows/command_tower/workflows/impersonation/stop_workflow.rb
640
705
  - app/workflows/command_tower/workflows/me/change_password_workflow.rb
641
706
  - app/workflows/command_tower/workflows/me/clear_phone_workflow.rb
642
707
  - app/workflows/command_tower/workflows/me/error_mapping.rb
@@ -667,8 +732,13 @@ files:
667
732
  - db/migrate/20260805000003_create_command_tower_messaging_core.rb
668
733
  - db/migrate/20260805000004_create_messaging_notification_preferences.rb
669
734
  - db/migrate/20260805000005_create_messaging_endpoints_and_pushover_credentials.rb
735
+ - db/migrate/20260816000001_create_command_tower_audit_events.rb
736
+ - db/migrate/20260817000001_add_scope_columns_to_command_tower_audit_events.rb
737
+ - db/migrate/20260817000003_create_command_tower_impersonation_sessions.rb
738
+ - docs/admin_workspace.md
670
739
  - docs/api_reference.md
671
740
  - docs/architecture.md
741
+ - docs/audit.md
672
742
  - docs/authentication.md
673
743
  - docs/authentication_authorization_guide.md
674
744
  - docs/authorization.md
@@ -676,6 +746,7 @@ files:
676
746
  - docs/controllers.md
677
747
  - docs/cookie_authentication_guide.md
678
748
  - docs/email_verification_workflow.md
749
+ - docs/eventing.md
679
750
  - docs/extending.md
680
751
  - docs/host_integration_guide.md
681
752
  - docs/initializing.md
@@ -683,16 +754,37 @@ files:
683
754
  - docs/models.md
684
755
  - docs/pagination.md
685
756
  - docs/password_reset_workflow.md
757
+ - docs/principal_capabilities.md
686
758
  - docs/sensitive_routes.md
687
759
  - docs/testing.md
688
760
  - docs/upgrades/0.10.0.md
761
+ - docs/upgrades/0.11.0.md
762
+ - docs/upgrades/0.11.1.md
689
763
  - docs/upgrades/README.md
690
764
  - lib/command_tower.rb
765
+ - lib/command_tower/admin_scope.rb
766
+ - lib/command_tower/admin_scope/apply_audit_scoping.rb
767
+ - lib/command_tower/admin_scope/apply_users_narrowing.rb
768
+ - lib/command_tower/admin_scope/manifest_projection.rb
769
+ - lib/command_tower/admin_scope/resolve.rb
770
+ - lib/command_tower/admin_scope/scope_context.rb
771
+ - lib/command_tower/admin_scope/scope_option.rb
772
+ - lib/command_tower/admin_workspace.rb
773
+ - lib/command_tower/audit.rb
774
+ - lib/command_tower/audit/attribution.rb
775
+ - lib/command_tower/audit/emit.rb
776
+ - lib/command_tower/audit/masking.rb
777
+ - lib/command_tower/audit/payload.rb
778
+ - lib/command_tower/audit/persistence/subscriber.rb
691
779
  - lib/command_tower/authorization.rb
780
+ - lib/command_tower/authorization/assignable_roles.rb
692
781
  - lib/command_tower/authorization/default.yml
782
+ - lib/command_tower/authorization/effective_entity_grants.rb
693
783
  - lib/command_tower/authorization/entity.rb
694
784
  - lib/command_tower/authorization/role.rb
695
785
  - lib/command_tower/configuration/admin/config.rb
786
+ - lib/command_tower/configuration/admin_scope/config.rb
787
+ - lib/command_tower/configuration/admin_scope/tool_registration.rb
696
788
  - lib/command_tower/configuration/application/config.rb
697
789
  - lib/command_tower/configuration/authorization/config.rb
698
790
  - lib/command_tower/configuration/base.rb
@@ -703,6 +795,7 @@ files:
703
795
  - lib/command_tower/configuration/email/config.rb
704
796
  - lib/command_tower/configuration/identity/config.rb
705
797
  - lib/command_tower/configuration/identity/phone_verification.rb
798
+ - lib/command_tower/configuration/impersonation/config.rb
706
799
  - lib/command_tower/configuration/jwt/config.rb
707
800
  - lib/command_tower/configuration/jwt/cookie/config.rb
708
801
  - lib/command_tower/configuration/jwt/cookie/csrf/config.rb
@@ -718,6 +811,13 @@ files:
718
811
  - lib/command_tower/configuration/pagination/config.rb
719
812
  - lib/command_tower/configuration/password_recovery_session/config.rb
720
813
  - lib/command_tower/configuration/password_recovery_session/rate_limits.rb
814
+ - lib/command_tower/configuration/registry/admin_workspace/config.rb
815
+ - lib/command_tower/configuration/registry/admin_workspace/tool_definition.rb
816
+ - lib/command_tower/configuration/registry/audit/config.rb
817
+ - lib/command_tower/configuration/registry/audit/event_definition.rb
818
+ - lib/command_tower/configuration/registry/config.rb
819
+ - lib/command_tower/configuration/registry/principal_capabilities/capability_definition.rb
820
+ - lib/command_tower/configuration/registry/principal_capabilities/config.rb
721
821
  - lib/command_tower/configuration/signup_session/config.rb
722
822
  - lib/command_tower/configuration/signup_session/email_availability.rb
723
823
  - lib/command_tower/configuration/signup_session/rate_limits.rb
@@ -732,11 +832,21 @@ files:
732
832
  - lib/command_tower/current.rb
733
833
  - lib/command_tower/engine.rb
734
834
  - lib/command_tower/error.rb
835
+ - lib/command_tower/events.rb
836
+ - lib/command_tower/execution.rb
837
+ - lib/command_tower/impersonation/activity_declaration.rb
838
+ - lib/command_tower/impersonation/apply_overlay.rb
839
+ - lib/command_tower/impersonation/clear_overlay_for_audit.rb
840
+ - lib/command_tower/impersonation/establish_identity.rb
735
841
  - lib/command_tower/install/baseline.rb
736
842
  - lib/command_tower/install/doctor.rb
737
843
  - lib/command_tower/jwt/authorization_helper.rb
738
844
  - lib/command_tower/jwt/csrf_helper.rb
845
+ - lib/command_tower/logging/lifecycle_declaration.rb
846
+ - lib/command_tower/logging/projection.rb
847
+ - lib/command_tower/logging/subscriber.rb
739
848
  - lib/command_tower/password_recovery/authorization_helper.rb
849
+ - lib/command_tower/principal_capabilities.rb
740
850
  - lib/command_tower/redis_connection.rb
741
851
  - lib/command_tower/schema.rb
742
852
  - lib/command_tower/schema/error/base.rb
@@ -754,6 +864,7 @@ files:
754
864
  - lib/tasks/install.rake
755
865
  - lib/tasks/users.rake
756
866
  - spec/factories/entity.rb
867
+ - spec/factories/impersonation_session.rb
757
868
  - spec/factories/messaging.rb
758
869
  - spec/factories/role.rb
759
870
  - spec/factories/user.rb
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module CommandTower
4
- module Messaging
5
- module Contract
6
- module Observability
7
- class StructuredLogger
8
- COMPONENT = "command_tower.messaging"
9
- FORBIDDEN_KEYS = %w[
10
- title
11
- body
12
- text
13
- metadata
14
- email
15
- password
16
- token
17
- ].freeze
18
-
19
- class << self
20
- def info(payload)
21
- emit(:info, payload)
22
- end
23
-
24
- def warn(payload)
25
- emit(:warn, payload)
26
- end
27
-
28
- def error(payload)
29
- emit(:error, payload)
30
- end
31
-
32
- private
33
-
34
- def emit(level, payload)
35
- envelope = build_envelope(level, payload)
36
- Rails.logger.public_send(level, envelope.to_json)
37
- rescue StandardError
38
- nil
39
- end
40
-
41
- def build_envelope(level, payload)
42
- compact = payload.to_h.transform_keys(&:to_s).except(*FORBIDDEN_KEYS)
43
- compact.reject! { |_key, value| value.nil? }
44
-
45
- {
46
- "timestamp" => Time.now.utc.iso8601(3),
47
- "level" => level.to_s,
48
- "component" => COMPONENT,
49
- }.merge(compact)
50
- end
51
- end
52
- end
53
- end
54
- end
55
- end
56
- end