access

package
v0.0.0-...-28e3711 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 28 Imported by: 2 modules, 4 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 access adapts the generic ACL policy store contract to the Datly v1 resource policy components. Every read and write executes the generated studio/resource_policy reader and writer in-process; this package owns no SQL and opens no transactions of its own.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvalidateNativePolicyReaders

func InvalidateNativePolicyReaders(ctx context.Context, db *sql.DB) error

InvalidateNativePolicyReaders advances native cache generations after an owning metadata transaction commits. It does not compile unused readers. A nil db selects every registered pool.

Types

type RevisionSelections

type RevisionSelections struct {
	Store  *Store
	Action string
}

RevisionSelections loads resource -> revisions -> one current policy document through Datly. Action identifies the policy to evaluate on each revision.

func (*RevisionSelections) GetSelection

type Store

type Store struct {
	DB *sql.DB
	// Invoker keeps native access reads/writes inside the caller's Datly
	// database unit. Standalone SDK hosts leave it nil and use the local runtime.
	Invoker dexec.ComponentInvoker
	// contains filtered or unexported fields
}

Store hosts the resource policy components against one Studio database. DB is the "authz" connector the generated components declare.

func NewTransactionStore

func NewTransactionStore(ctx context.Context, db *sql.DB, tx *sql.Tx) (*Store, error)

NewTransactionStore creates an isolated native store for one caller-owned transaction. The trusted caller supplies its exact database handle. Neither this store nor its component runtime may commit/rollback or close that unit. A new transaction requires a new store; cached registrations are never rebound.

func (*Store) Close

func (s *Store) Close(ctx context.Context) error

Close releases the hosted component runtime.

func (*Store) Create

func (s *Store) Create(ctx context.Context, doc acl.Document, actor string) (acl.Document, error)

Create adds a first revision through the native policy writer.

func (*Store) Get

func (s *Store) Get(ctx context.Context, r acl.Resource) (acl.Document, error)

Get executes the generated reader for one exact resource identity. Every key dimension is a required predicate, so a missing head yields no row.

func (*Store) PolicyResources

func (s *Store) PolicyResources(ctx context.Context, tenant string) ([]authz.Resource, error)

PolicyResources enumerates current policy identities from existing heads. It is used only by checked administration, never on the execution path.

func (*Store) Provision

func (s *Store) Provision(ctx context.Context, d acl.Document, actor string) (acl.Document, error)

Provision is a server bootstrap operation, intentionally absent from the ACL service and client API. It cannot replace an existing policy.

func (*Store) Replace

func (s *Store) Replace(ctx context.Context, d acl.Document, expected int64, actor string) (acl.Document, error)

Replace activates a new revision only when the caller's expected revision is the current head.

Jump to

Keyboard shortcuts

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