Skip to content

Add pkg/objectstore/actorauthz so out-of-tree object-store providers can run the actor checks - #3358

Draft
Anish Ramasekar (aramase) wants to merge 3 commits into
agent-substrate:mainfrom
aramase:aramase/f/pkg_actorauthz
Draft

Anish Ramasekar (aramase) wants to merge 3 commits into
agent-substrate:mainfrom
aramase:aramase/f/pkg_actorauthz

Conversation

@aramase

@aramase Anish Ramasekar (aramase) commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Step 2 of #3095. A provider in its own repository cannot import the actor checks under internal/. Draft until #3447 merges and removes Config.JWKSFile.

  • actorauthz.NewVerifier in internal/objectstoreplugin/actorauthz builds the JWT verifier for both the in-tree exchange and this package.
  • New(ctx, Config) builds the verifier for Audience and the ate-api-server lookup. A missing field, an issuer that is not https://<host>, or a bad JWKS file fails at start.
  • Audience is the actor_jwt audience. Providers can use it to mint test tokens. A test keeps it equal to the in-tree value.
  • Authorize(ctx, jwt) returns a Decision with ActorUID and Grants. Errors are gRPC status errors.
  • Each Grant.Prefix ends in /, so a prefix match cannot reach a sibling actor.
  • hack/verify/package-deps.sh bans cloud SDK imports, and hack/verify/pkg-external-import.sh builds the package from an outside module.

Tested on macOS with hack/verify-all.sh, which passes, and go test -race ./.... Only cmd/atenet/internal/router and cmd/ateworker-microvm/internal/child fail, and they fail the same way on main. I did not run e2e.

  • Tests pass
  • Docs updated

@aramase

Copy link
Copy Markdown
Collaborator Author

@aramase
Anish Ramasekar (aramase) force-pushed the aramase/f/pkg_actorauthz branch 2 times, most recently from a88e650 to 3691d0b Compare October 28, 2026 16:05
@ILLUM1N0X ILLUM1N0X added this to the M3 milestone Oct 28, 2026
…authz

NewVerifier reads the JWK set once and returns a verifier for Audience
with Substrate's claims. The objectstore-plugin exchange calls it, so an
exchange outside cmd/ can check tokens the same way.

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
…viders

A provider outside this repository cannot import the exchange's actor
checks under internal/. The new package wraps them: New builds the JWT
verifier and the ate-api-server lookup, and Authorize returns the actor
UID and its grants, each prefix a URI ending in "/". New rejects an
issuer that is not https://<host>, as ate-setup does. Audience exports
the JWT audience, so a provider can mint test tokens without copying the
string. package-deps.sh holds the package to the same banned imports as
the in-tree actorauthz.

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
…ernal/

Go allows a pkg/ package to import internal/ and an outside module to
import that package. The script builds such packages from an outside
module and checks the same module cannot import internal/ directly.

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
@BenTheElder

Copy link
Copy Markdown
Collaborator

Anish Ramasekar (@aramase) is this meant to be a draft still?

@aramase

Copy link
Copy Markdown
Collaborator Author

Benjamin Elder (@BenTheElder) yes, until #3447 merges. It removes Config.JWKSFile, so that field never ships in pkg/. On your UID ask: the lookup returns ErrStale when the actor's current UID differs from the token's, and Authorize maps that to NotFound.

@dberkov

Copy link
Copy Markdown
Collaborator

Benjamin Elder (Benjamin Elder (@BenTheElder)) yes, until #3447 merges. It removes Config.JWKSFile, so that field never ships in pkg/. On your UID ask: the lookup returns ErrStale when the actor's current UID differs from the token's, and Authorize maps that to NotFound.

The #3447 was not approved for RC2 yet. We did not discuss it during grooming meeting yesterday.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants