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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d170cbb1f6f0da3a2c26f3d55a55bb86b3533c8b27fe969f074efaee57536406
4
- data.tar.gz: 1d86bdc3e38378efba926f9de1f56b6dce1fc120ae7f20a4685ca29fb184ea8b
3
+ metadata.gz: c2cf10e43b5a53e032b3ed767d98a807a9781e8f02e451782d803b39336da444
4
+ data.tar.gz: 784c28baa1b257fdbc3628ddfa6d2c9609caba77c0785d93c8f4d6ba088bdb44
5
5
  SHA512:
6
- metadata.gz: 192ab4f6a44a4b05662307260191ccbc32fbe62109e5c63039ee6d171e498e983992244044653ce653d3c6fa9917bace46bfa96e7c173bee0abaa52bea3c0a76
7
- data.tar.gz: bc98cace73ba017a48a3ed8bb76172e9d040509cf2cc2533bb30ea4cb793d5c3ca3fdb189e33240e48231d865460e13cfa96b801226246ec3bbff1973bb882d2
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.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.
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 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.
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.0` gem from RubyGems.
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.0"
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
- - [Next-release Decision reason_code API](docs/decision_reason_code.md)
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 context.key?(key)
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)
@@ -1,3 +1,3 @@
1
1
  module ActingFor
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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: 1980-01-02 00:00:00.000000000 Z
10
+ date: 2026-11-14 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rubocop