actorscope

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package actorscope derives the object-storage prefixes an actor's transfers may touch from the actor record, with the access each needs. It knows no storage provider: a provider's credential exchange turns the grants into whatever scoped credential its storage supports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access int

Access is what a grant permits under its prefix.

const (
	// ReadOnly covers the tag or golden snapshot the actor was created from.
	ReadOnly Access = iota + 1
	// ReadWrite covers the actor's own snapshots.
	ReadWrite
)

func (Access) String

func (a Access) String() string

type Grant

type Grant struct {
	Prefix resources.StoragePrefix
	Access Access
}

Grant is one prefix and the access allowed under it. Prefix is the actor's own prefix or a tag's prefix, as the control plane built it, so a provider derives its bucket and path with the same code the rest of Substrate uses.

func FromActor

func FromActor(actor *ateapipb.Actor) ([]Grant, error)

FromActor derives the grants from status.snapshots. Every snapshot the control plane writes for the actor carries a URI the control plane built, so the storage location and the tag prefixes come from those URIs, parsed with the same code that built them, and the actor's own prefix is built with the helper the control plane places snapshots with.

  • Every durable URI names the storage location it sits under. For each location seen, the actor gets ReadWrite on its own prefix there, <location>/atespaces/<atespace>/actors/<uid>. So the grant exists from the first generation on, before the actor has uploaded anything, and a repointed actor keeps both locations.
  • Each TAG-owned generation with a COMPLETED durable URI grants ReadOnly on the tag's prefix. That is the golden or tag the actor was created from, listed until the actor's own first snapshot completes.

The status is taken as ate-api-server wrote it. An owner this code does not know is an error, so a new kind is never silently dropped. Local-only generations have no URI and contribute nothing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL