acting_for 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 +21 -5
- data/app/services/acting_for/internal/authorization.rb +1 -1
- data/lib/acting_for/decision.rb +8 -2
- data/lib/acting_for/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d170cbb1f6f0da3a2c26f3d55a55bb86b3533c8b27fe969f074efaee57536406
|
|
4
|
+
data.tar.gz: 1d86bdc3e38378efba926f9de1f56b6dce1fc120ae7f20a4685ca29fb184ea8b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 192ab4f6a44a4b05662307260191ccbc32fbe62109e5c63039ee6d171e498e983992244044653ce653d3c6fa9917bace46bfa96e7c173bee0abaa52bea3c0a76
|
|
7
|
+
data.tar.gz: bc98cace73ba017a48a3ed8bb76172e9d040509cf2cc2533bb30ea4cb793d5c3ca3fdb189e33240e48231d865460e13cfa96b801226246ec3bbff1973bb882d2
|
data/README.md
CHANGED
|
@@ -14,7 +14,15 @@ AI AgentがPrincipalの代理として何をしてよいかを、委任された
|
|
|
14
14
|
|
|
15
15
|
## Status
|
|
16
16
|
|
|
17
|
-
> **
|
|
17
|
+
> **Released: v0.1.0.** ActingFor 0.1.0 is published on [RubyGems](https://rubygems.org/gems/acting_for) and as [GitHub Release v0.1.0](https://github.com/cuichangquan/acting_for/releases/tag/v0.1.0). The Public API, migrations, models, constraints, automatic Audit persistence, and formal test suite are implemented. CI covers Ruby 3.4 / 4.0, Rails 8.0 / 8.1, and PostgreSQL 16.
|
|
18
|
+
>
|
|
19
|
+
> **0.1.1 release candidate:** `Decision#reason_code` is implemented, verified, and under release preparation. The latest published RubyGems version is still `0.1.0`; `0.1.1` has not been published yet.
|
|
20
|
+
|
|
21
|
+
## ActingFor at a glance
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
The diagram summarizes the v0.1 responsibility boundary: the Host authenticates/resolves the Agent and Principal and establishes trusted business data; ActingFor evaluates the Delegation and returns `allow`, `deny`, or `require_approval`. Approval workflow and business execution remain Host responsibilities.
|
|
18
26
|
|
|
19
27
|
## Why ActingFor?
|
|
20
28
|
|
|
@@ -168,19 +176,23 @@ decision = ActingFor.authorize(
|
|
|
168
176
|
context: { amount: product.price }
|
|
169
177
|
)
|
|
170
178
|
|
|
179
|
+
decision.status # => :allow
|
|
171
180
|
decision.allowed? # => true when product.price is 8_900
|
|
181
|
+
|
|
182
|
+
# ActingFor 0.1.1 release candidate:
|
|
183
|
+
decision.reason_code # => :delegation_allowed
|
|
172
184
|
```
|
|
173
185
|
|
|
174
|
-
|
|
186
|
+
The released 0.1.0 behavior is documented in the [v0.1 Public API](docs/public_api_v0_1.md). The [0.1.1 `Decision#reason_code` API note](docs/decision_reason_code.md) documents the new final-reason accessor. Context values that affect authorization must be established by the host, not trusted directly from an Agent request. `reason_code` is not available in the published `0.1.0` gem.
|
|
175
187
|
|
|
176
188
|
## Quick Start
|
|
177
189
|
|
|
178
|
-
|
|
190
|
+
Install the released `0.1.0` gem from RubyGems.
|
|
179
191
|
|
|
180
192
|
1. Add the Gem and install dependencies:
|
|
181
193
|
|
|
182
194
|
```ruby
|
|
183
|
-
gem "acting_for",
|
|
195
|
+
gem "acting_for", "~> 0.1.0"
|
|
184
196
|
# Rails 8.0 uses JSON options removed in JSON 3.
|
|
185
197
|
gem "json", "< 3"
|
|
186
198
|
```
|
|
@@ -240,7 +252,7 @@ ActingFor is not yet published to RubyGems. This pre-release setup installs the
|
|
|
240
252
|
# => [:allow, true, false, false]
|
|
241
253
|
```
|
|
242
254
|
|
|
243
|
-
For the complete runnable setup—including a new Rails application,
|
|
255
|
+
For the complete runnable setup—including a new Rails application, RubyGems installation, host models, all three `¥8,900 / ¥20,000 / ¥50,000` outcomes, Audit behavior, and production security guidance—see [Getting Started](docs/getting_started.md).
|
|
244
256
|
|
|
245
257
|
## How does an external AI Agent reach ActingFor?
|
|
246
258
|
|
|
@@ -446,11 +458,15 @@ ActingFor is not an authentication provider, OAuth/OIDC server, Agent framework,
|
|
|
446
458
|
Project documents are maintained primarily in Japanese:
|
|
447
459
|
|
|
448
460
|
- [Getting Started](docs/getting_started.md)
|
|
461
|
+
- [Release Runbook](docs/release_runbook.md)
|
|
462
|
+
- [v0.1.0 Release Process and Verification Record](docs/release_process_v0_1_0.md)
|
|
463
|
+
- [v0.1.0 Release Notes](docs/release_notes_v0_1_0.md)
|
|
449
464
|
- [Current State](docs/CURRENT_STATE.md)
|
|
450
465
|
- [Progress](docs/PROGRESS.md)
|
|
451
466
|
- [Project scope, roadmap, and terminology](docs/PROJECT.md)
|
|
452
467
|
- [Decisions and rationale](docs/DECISIONS.md)
|
|
453
468
|
- [v0.1 Public API](docs/public_api_v0_1.md)
|
|
469
|
+
- [Next-release Decision reason_code API](docs/decision_reason_code.md)
|
|
454
470
|
- [v0.1 Security Model](docs/security_model_v0_1.md)
|
|
455
471
|
- [v0.1 Domain Model](docs/domain_model_v0_1.md)
|
|
456
472
|
- [v0.1 Gem Structure](docs/gem_structure_v0_1.md)
|
|
@@ -158,7 +158,7 @@ module ActingFor
|
|
|
158
158
|
resource_type: resource_type,
|
|
159
159
|
resource_id: resource_id,
|
|
160
160
|
decision: decision_value,
|
|
161
|
-
reason_code:
|
|
161
|
+
reason_code: decision.reason_code.to_s,
|
|
162
162
|
matched_delegation_ids: matches.map(&:id).sort,
|
|
163
163
|
sanitized_context: sanitized_context
|
|
164
164
|
}
|
data/lib/acting_for/decision.rb
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
module ActingFor
|
|
2
2
|
class Decision
|
|
3
3
|
STATUSES = %i[allow deny require_approval].freeze
|
|
4
|
-
|
|
4
|
+
REASON_CODES = {
|
|
5
|
+
allow: :delegation_allowed,
|
|
6
|
+
deny: :no_matching_delegation,
|
|
7
|
+
require_approval: :delegation_requires_approval
|
|
8
|
+
}.freeze
|
|
9
|
+
private_constant :STATUSES, :REASON_CODES
|
|
5
10
|
|
|
6
|
-
attr_reader :status
|
|
11
|
+
attr_reader :status, :reason_code
|
|
7
12
|
|
|
8
13
|
def initialize(status)
|
|
9
14
|
raise ArgumentError, "invalid decision status" unless STATUSES.include?(status)
|
|
10
15
|
|
|
11
16
|
@status = status
|
|
17
|
+
@reason_code = REASON_CODES.fetch(status)
|
|
12
18
|
freeze
|
|
13
19
|
end
|
|
14
20
|
|
data/lib/acting_for/version.rb
CHANGED