acl

package
v0.27.6 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: Unlicense Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registry = &S{}

Functions

This section is empty.

Types

type A

type A struct{ S }

type Follows

type Follows struct {
	Ctx context.Context

	*database.D
	// contains filtered or unexported fields
}

func (*Follows) AddFollow added in v0.8.0

func (f *Follows) AddFollow(pub []byte)

AddFollow appends a pubkey to the in-memory follows list if not already present and signals the syncer to refresh subscriptions.

func (*Follows) AdminRelays added in v0.17.14

func (f *Follows) AdminRelays() []string

AdminRelays returns the admin relay URLs

func (*Follows) Configure

func (f *Follows) Configure(cfg ...any) (err error)

func (*Follows) GetACLInfo

func (f *Follows) GetACLInfo() (name, description, documentation string)

func (*Follows) GetAccessLevel

func (f *Follows) GetAccessLevel(pub []byte, address string) (level string)

func (*Follows) GetFollowedPubkeys added in v0.6.0

func (f *Follows) GetFollowedPubkeys() [][]byte

GetFollowedPubkeys returns a copy of the followed pubkeys list

func (*Follows) Syncer

func (f *Follows) Syncer()

func (*Follows) Type

func (f *Follows) Type() string

type Managed added in v0.17.0

type Managed struct {
	Ctx context.Context

	*database.D
	// contains filtered or unexported fields
}

func (*Managed) CheckPolicy added in v0.17.0

func (m *Managed) CheckPolicy(ev *event.E) (allowed bool, err error)

func (*Managed) Configure added in v0.17.0

func (m *Managed) Configure(cfg ...any) (err error)

func (*Managed) GetACLInfo added in v0.17.0

func (m *Managed) GetACLInfo() (name, description, documentation string)

func (*Managed) GetAccessLevel added in v0.17.0

func (m *Managed) GetAccessLevel(pub []byte, address string) (level string)

func (*Managed) GetManagedACL added in v0.17.0

func (m *Managed) GetManagedACL() *database.ManagedACL

GetManagedACL returns the managed ACL database instance

func (*Managed) IsIPBlocked added in v0.17.0

func (m *Managed) IsIPBlocked(ip string) bool

IsIPBlocked checks if an IP address is blocked

func (*Managed) Syncer added in v0.17.0

func (m *Managed) Syncer()

func (*Managed) Type added in v0.17.0

func (m *Managed) Type() string

func (*Managed) UpdatePeerAdmins added in v0.24.1

func (m *Managed) UpdatePeerAdmins(peerPubkeys [][]byte)

UpdatePeerAdmins updates the list of peer relay identity pubkeys that have admin access

type None

type None struct {
	// contains filtered or unexported fields
}

func (None) CheckPolicy added in v0.16.0

func (n None) CheckPolicy(ev *event.E) (allowed bool, err error)

func (*None) Configure

func (n *None) Configure(cfg ...any) (err error)

func (None) GetACLInfo

func (n None) GetACLInfo() (name, description, documentation string)

func (*None) GetAccessLevel

func (n *None) GetAccessLevel(pub []byte, address string) (level string)

func (None) Syncer

func (n None) Syncer()

func (None) Type

func (n None) Type() string

type S

type S struct {
	ACL    []acl.I
	Active atomic.String
}

func (*S) AddFollow added in v0.8.0

func (s *S) AddFollow(pub []byte)

AddFollow forwards a pubkey to the active ACL if it supports dynamic follows

func (*S) CheckPolicy added in v0.17.0

func (s *S) CheckPolicy(ev *event.E) (allowed bool, err error)

CheckPolicy checks if an event is allowed by the active ACL policy

func (*S) Configure

func (s *S) Configure(cfg ...any) (err error)

func (*S) GetACLInfo

func (s *S) GetACLInfo() (name, description, documentation string)

func (*S) GetAccessLevel

func (s *S) GetAccessLevel(pub []byte, address string) (level string)

func (*S) Register

func (s *S) Register(i acl.I)

func (*S) Syncer

func (s *S) Syncer()

func (*S) Type

func (s *S) Type() (typ string)

Source Files

  • acl.go
  • follows.go
  • managed.go
  • none.go

Jump to

Keyboard shortcuts

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