acting_for 0.1.1 → 0.1.2
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 +7 -8
- data/app/services/acting_for/internal/constraint_evaluator.rb +5 -1
- data/lib/acting_for/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c2cf10e43b5a53e032b3ed767d98a807a9781e8f02e451782d803b39336da444
|
|
4
|
+
data.tar.gz: 784c28baa1b257fdbc3628ddfa6d2c9609caba77c0785d93c8f4d6ba088bdb44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fa525cb88236196b3751dfa14b362bed7487a799849288191530af319d47bdf95ad95c2602204332f0b02566a7538b9cc3d9ac2fc3e9b508c6077f1ab534dffa
|
|
7
|
+
data.tar.gz: d9ce75cd4ec4a74e2150aaebb53a6c2da9bdf645c806b3c137136b5bcca7ce69ce83910fcc9640c61d63f0081c92e0a456df7e20505ed75a4388cde0bfe175c1
|
data/README.md
CHANGED
|
@@ -14,9 +14,9 @@ AI AgentがPrincipalの代理として何をしてよいかを、委任された
|
|
|
14
14
|
|
|
15
15
|
## Status
|
|
16
16
|
|
|
17
|
-
> **Released: v0.1.
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
> **Released: v0.1.1.** ActingFor 0.1.1 is published on [RubyGems](https://rubygems.org/gems/acting_for) and as [GitHub Release v0.1.1](https://github.com/cuichangquan/acting_for/releases/tag/v0.1.1). It adds `Decision#reason_code` while keeping the existing Decision statuses, Delegation semantics, AuditEvent reason values, and database schema unchanged. CI covers Ruby 3.4 / 4.0, Rails 8.0 / 8.1, and PostgreSQL 16.
|
|
18
|
+
|
|
19
|
+
Next candidate: [0.1.2](docs/release_notes_v0_1_2.md) aligns constraint evaluation with the documented exact Symbol-key Context contract and adds an authorization-to-host-log correlation example. The candidate is not yet published; the released installation instructions below remain on 0.1.1.
|
|
20
20
|
|
|
21
21
|
## ActingFor at a glance
|
|
22
22
|
|
|
@@ -179,20 +179,19 @@ decision = ActingFor.authorize(
|
|
|
179
179
|
decision.status # => :allow
|
|
180
180
|
decision.allowed? # => true when product.price is 8_900
|
|
181
181
|
|
|
182
|
-
# ActingFor 0.1.1 release candidate:
|
|
183
182
|
decision.reason_code # => :delegation_allowed
|
|
184
183
|
```
|
|
185
184
|
|
|
186
|
-
The released 0.1.0
|
|
185
|
+
The released 0.1.0 contract remains 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 final-reason accessor added in 0.1.1. Context values that affect authorization must be established by the host, not trusted directly from an Agent request.
|
|
187
186
|
|
|
188
187
|
## Quick Start
|
|
189
188
|
|
|
190
|
-
Install the released `0.1.
|
|
189
|
+
Install the released `0.1.1` gem from RubyGems.
|
|
191
190
|
|
|
192
191
|
1. Add the Gem and install dependencies:
|
|
193
192
|
|
|
194
193
|
```ruby
|
|
195
|
-
gem "acting_for", "~> 0.1.
|
|
194
|
+
gem "acting_for", "~> 0.1.1"
|
|
196
195
|
# Rails 8.0 uses JSON options removed in JSON 3.
|
|
197
196
|
gem "json", "< 3"
|
|
198
197
|
```
|
|
@@ -466,7 +465,7 @@ Project documents are maintained primarily in Japanese:
|
|
|
466
465
|
- [Project scope, roadmap, and terminology](docs/PROJECT.md)
|
|
467
466
|
- [Decisions and rationale](docs/DECISIONS.md)
|
|
468
467
|
- [v0.1 Public API](docs/public_api_v0_1.md)
|
|
469
|
-
- [
|
|
468
|
+
- [Decision reason_code API](docs/decision_reason_code.md)
|
|
470
469
|
- [v0.1 Security Model](docs/security_model_v0_1.md)
|
|
471
470
|
- [v0.1 Domain Model](docs/domain_model_v0_1.md)
|
|
472
471
|
- [v0.1 Gem Structure](docs/gem_structure_v0_1.md)
|
|
@@ -18,7 +18,7 @@ module ActingFor
|
|
|
18
18
|
|
|
19
19
|
field = constraint["field"]
|
|
20
20
|
key = field.to_sym
|
|
21
|
-
return false unless
|
|
21
|
+
return false unless exact_symbol_key?(context, key)
|
|
22
22
|
|
|
23
23
|
actual = context[key]
|
|
24
24
|
return false if actual.nil?
|
|
@@ -45,6 +45,10 @@ module ActingFor
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
def exact_symbol_key?(context, key)
|
|
49
|
+
context.each_key.any? { |existing_key| existing_key.is_a?(Symbol) && existing_key == key }
|
|
50
|
+
end
|
|
51
|
+
|
|
48
52
|
def canonical_constraint?(constraint)
|
|
49
53
|
return false unless constraint.is_a?(Hash)
|
|
50
54
|
return false unless constraint.keys.all?(String)
|
data/lib/acting_for/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: acting_for
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ChangQuan Cui
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2026-11-14 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rubocop
|