server

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: Unlicense Imports: 18 Imported by: 0

Documentation

Overview

Package server provides a shared gRPC ACL server implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLService

type ACLService struct {
	orlyaclv1.UnimplementedACLServiceServer
	// contains filtered or unexported fields
}

ACLService implements the orlyaclv1.ACLServiceServer interface.

func NewACLService

func NewACLService(cfg *Config, db database.Database) *ACLService

NewACLService creates a new ACL service.

func (*ACLService) AddFollow

func (*ACLService) AllowEvent

func (s *ACLService) AllowEvent(ctx context.Context, req *orlyaclv1.BanEventRequest) (*orlyaclv1.Empty, error)

func (*ACLService) AllowKind

func (*ACLService) AllowPubkey

func (*ACLService) BanEvent

func (*ACLService) BanPubkey

func (*ACLService) BlacklistPubkey

func (s *ACLService) BlacklistPubkey(ctx context.Context, req *orlyaclv1.BlacklistPubkeyRequest) (*orlyaclv1.Empty, error)

func (*ACLService) BlockIP

func (*ACLService) CheckPolicy

func (*ACLService) DeleteEventsForPubkey

func (*ACLService) DisallowEvent

func (s *ACLService) DisallowEvent(ctx context.Context, req *orlyaclv1.EventRequest) (*orlyaclv1.Empty, error)

func (*ACLService) DisallowKind

func (s *ACLService) DisallowKind(ctx context.Context, req *orlyaclv1.KindRequest) (*orlyaclv1.Empty, error)

func (*ACLService) DisallowPubkey

func (s *ACLService) DisallowPubkey(ctx context.Context, req *orlyaclv1.PubkeyRequest) (*orlyaclv1.Empty, error)

func (*ACLService) GetACLInfo

func (s *ACLService) GetACLInfo(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.ACLInfoResponse, error)

func (*ACLService) GetAccessLevel

func (*ACLService) GetAdminRelays

func (s *ACLService) GetAdminRelays(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.AdminRelaysResponse, error)

func (*ACLService) GetCuratingConfig

func (s *ACLService) GetCuratingConfig(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.CuratingConfig, error)

func (*ACLService) GetEventsForPubkey

func (*ACLService) GetFollowedPubkeys

func (s *ACLService) GetFollowedPubkeys(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.FollowedPubkeysResponse, error)

func (*ACLService) GetMode

func (*ACLService) GetThrottleDelay

func (*ACLService) IsCuratingConfigured

func (s *ACLService) IsCuratingConfigured(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.BoolResponse, error)

func (*ACLService) ListAllowedEvents

func (s *ACLService) ListAllowedEvents(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.ListAllowedEventsResponse, error)

func (*ACLService) ListAllowedKinds

func (s *ACLService) ListAllowedKinds(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.ListAllowedKindsResponse, error)

func (*ACLService) ListAllowedPubkeys

func (s *ACLService) ListAllowedPubkeys(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.ListAllowedPubkeysResponse, error)

func (*ACLService) ListBannedEvents

func (s *ACLService) ListBannedEvents(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.ListBannedEventsResponse, error)

func (*ACLService) ListBannedPubkeys

func (s *ACLService) ListBannedPubkeys(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.ListBannedPubkeysResponse, error)

func (*ACLService) ListBlacklistedPubkeys

func (s *ACLService) ListBlacklistedPubkeys(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.ListBlacklistedPubkeysResponse, error)

func (*ACLService) ListBlockedIPs

func (*ACLService) ListSpamEvents

func (*ACLService) ListTrustedPubkeys

func (s *ACLService) ListTrustedPubkeys(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.ListTrustedPubkeysResponse, error)

func (*ACLService) ListUnclassifiedUsers

func (*ACLService) MarkSpam

func (*ACLService) ProcessConfigEvent

func (s *ACLService) ProcessConfigEvent(ctx context.Context, req *orlyaclv1.ConfigEventRequest) (*orlyaclv1.Empty, error)

func (*ACLService) RateLimitCheck

func (*ACLService) Ready

func (*ACLService) ScanAllPubkeys

func (s *ACLService) ScanAllPubkeys(ctx context.Context, req *orlyaclv1.Empty) (*orlyaclv1.ScanResultResponse, error)

func (*ACLService) TrustPubkey

func (*ACLService) UnbanEvent

func (s *ACLService) UnbanEvent(ctx context.Context, req *orlyaclv1.EventRequest) (*orlyaclv1.Empty, error)

func (*ACLService) UnbanPubkey

func (s *ACLService) UnbanPubkey(ctx context.Context, req *orlyaclv1.PubkeyRequest) (*orlyaclv1.Empty, error)

func (*ACLService) UnblacklistPubkey

func (s *ACLService) UnblacklistPubkey(ctx context.Context, req *orlyaclv1.PubkeyRequest) (*orlyaclv1.Empty, error)

func (*ACLService) UnblockIP

func (s *ACLService) UnblockIP(ctx context.Context, req *orlyaclv1.IPRequest) (*orlyaclv1.Empty, error)

func (*ACLService) UnmarkSpam

func (s *ACLService) UnmarkSpam(ctx context.Context, req *orlyaclv1.EventRequest) (*orlyaclv1.Empty, error)

func (*ACLService) UntrustPubkey

func (s *ACLService) UntrustPubkey(ctx context.Context, req *orlyaclv1.PubkeyRequest) (*orlyaclv1.Empty, error)

func (*ACLService) UpdatePeerAdmins

func (s *ACLService) UpdatePeerAdmins(ctx context.Context, req *orlyaclv1.UpdatePeerAdminsRequest) (*orlyaclv1.Empty, error)

type Config

type Config struct {
	// Listen is the gRPC server listen address
	Listen string

	// ACLMode is the active ACL mode (none, follows, managed, curating)
	ACLMode string

	// LogLevel is the logging level
	LogLevel string

	// Owner and admin lists
	Owners []string
	Admins []string

	// Bootstrap relays for follow list syncing
	BootstrapRelays []string

	// Relay addresses (self)
	RelayAddresses []string

	// Follows ACL configuration
	FollowListFrequency     time.Duration
	FollowsThrottleEnabled  bool
	FollowsThrottlePerEvent time.Duration
	FollowsThrottleMaxDelay time.Duration
}

Config holds configuration for the ACL gRPC server.

type Server

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

Server wraps a gRPC ACL server.

func New

func New(db database.Database, cfg *Config, ownsDB bool) *Server

New creates a new ACL gRPC server.

func (*Server) ConfigureACL

func (s *Server) ConfigureACL(ctx context.Context) error

ConfigureACL sets up the ACL mode and configures the registry.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context, cancel context.CancelFunc) error

ListenAndServe starts the gRPC server.

func (*Server) Stop

func (s *Server) Stop()

Stop stops the server.

Source Files

  • config.go
  • server.go
  • service.go

Jump to

Keyboard shortcuts

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