Skip to content

DelegateAuthenticator: accept operational actors (Scopes.isOperator) - #84

Open
chunter-cb wants to merge 2 commits into
mainfrom
feat/delegate-authenticator-operator-sender
Open

DelegateAuthenticator: accept operational actors (Scopes.isOperator)#84
chunter-cb wants to merge 2 commits into
mainfrom
feat/delegate-authenticator-operator-sender

Conversation

@chunter-cb

Copy link
Copy Markdown
Collaborator

Summary

  • Change DelegateAuthenticator so a delegate vouch accepts any operational nested actor via Scopes.isOperator, instead of requiring admin scope (scope == 0x00) only.
  • Operational means admin (scope == 0) or a SENDER actor that is not POLICY-gated — the same authority that can drive execution and sign (ERC-1271) as the account (see DefaultAccount). This aligns delegate vouching with the account's execution/signing authorization surface.
  • POLICY-gated actors and capability-only actors (e.g. NONCE / SELF_PAYER / SPONSOR_PAYER) remain non-operational and still revert with InvalidNestedSignature.

Changes

  • src/authenticators/DelegateAuthenticator.sol: import Scopes; replace if (nestedScope != 0) with if (!Scopes.isOperator(nestedScope)); update docs/error comment.
  • test/unit/authenticators/DelegateAuthenticator.t.sol:
    • Converted the operationalSenderCannotVouch regression into test_authenticate_success_operationalSenderVouches (SENDER actor now vouches and returns the delegate actorId).
    • Tightened test_authenticate_revert_nestedSignerIsScoped to fuzz only non-operational scopes (clears SENDER and POLICY).
    • Updated the file-level docstring.

Test plan

  • forge build
  • forge test --match-path test/unit/authenticators/DelegateAuthenticator.t.sol (8 passed)
  • forge test full suite (387 passed, 0 failed)

Update the deployment salt after the SessionPolicy bytecode changed so its canonical address retains the 0x8130...5e55 pattern.
Previously a delegate vouch required the nested actor to be admin (scope
== 0x00). Align the vouch with the account's execution/ERC-1271 authority
by accepting any operational actor per Scopes.isOperator, i.e. admin or a
SENDER actor that is not POLICY-gated. POLICY-gated and capability-only
actors remain non-operational and still revert InvalidNestedSignature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant