acl.proto raw

   1  syntax = "proto3";
   2  package orlyacl.v1;
   3  option go_package = "next.orly.dev/pkg/proto/orlyacl/v1;orlyaclv1";
   4  
   5  import "orlyacl/v1/types.proto";
   6  
   7  // ACLService provides access control operations for the Nostr relay
   8  service ACLService {
   9    // Core ACL interface methods
  10  
  11    // GetAccessLevel returns the access level for a pubkey from an IP address
  12    rpc GetAccessLevel(AccessLevelRequest) returns (AccessLevelResponse);
  13  
  14    // CheckPolicy checks if an event passes policy checks
  15    rpc CheckPolicy(PolicyCheckRequest) returns (PolicyCheckResponse);
  16  
  17    // GetACLInfo returns information about the active ACL mode
  18    rpc GetACLInfo(Empty) returns (ACLInfoResponse);
  19  
  20    // GetMode returns the current ACL mode (none/follows/managed/curating)
  21    rpc GetMode(Empty) returns (ModeResponse);
  22  
  23    // Ready checks if the ACL service is ready
  24    rpc Ready(Empty) returns (ReadyResponse);
  25  
  26    // Follows ACL methods
  27  
  28    // GetThrottleDelay returns the progressive throttle delay for a pubkey
  29    rpc GetThrottleDelay(ThrottleDelayRequest) returns (ThrottleDelayResponse);
  30  
  31    // AddFollow adds a pubkey to the followed list
  32    rpc AddFollow(AddFollowRequest) returns (Empty);
  33  
  34    // GetFollowedPubkeys returns all followed pubkeys
  35    rpc GetFollowedPubkeys(Empty) returns (FollowedPubkeysResponse);
  36  
  37    // GetAdminRelays returns the relay URLs from admin kind 10002 events
  38    rpc GetAdminRelays(Empty) returns (AdminRelaysResponse);
  39  
  40    // Managed ACL methods
  41  
  42    // BanPubkey adds a pubkey to the ban list
  43    rpc BanPubkey(BanPubkeyRequest) returns (Empty);
  44  
  45    // UnbanPubkey removes a pubkey from the ban list
  46    rpc UnbanPubkey(PubkeyRequest) returns (Empty);
  47  
  48    // ListBannedPubkeys returns all banned pubkeys
  49    rpc ListBannedPubkeys(Empty) returns (ListBannedPubkeysResponse);
  50  
  51    // AllowPubkey adds a pubkey to the allow list
  52    rpc AllowPubkey(AllowPubkeyRequest) returns (Empty);
  53  
  54    // DisallowPubkey removes a pubkey from the allow list
  55    rpc DisallowPubkey(PubkeyRequest) returns (Empty);
  56  
  57    // ListAllowedPubkeys returns all explicitly allowed pubkeys
  58    rpc ListAllowedPubkeys(Empty) returns (ListAllowedPubkeysResponse);
  59  
  60    // BanEvent adds an event to the ban list
  61    rpc BanEvent(BanEventRequest) returns (Empty);
  62  
  63    // UnbanEvent removes an event from the ban list
  64    rpc UnbanEvent(EventRequest) returns (Empty);
  65  
  66    // ListBannedEvents returns all banned events
  67    rpc ListBannedEvents(Empty) returns (ListBannedEventsResponse);
  68  
  69    // AllowEvent adds an event to the allow list
  70    rpc AllowEvent(BanEventRequest) returns (Empty);
  71  
  72    // DisallowEvent removes an event from the allow list
  73    rpc DisallowEvent(EventRequest) returns (Empty);
  74  
  75    // ListAllowedEvents returns all explicitly allowed events
  76    rpc ListAllowedEvents(Empty) returns (ListAllowedEventsResponse);
  77  
  78    // BlockIP adds an IP to the block list
  79    rpc BlockIP(BlockIPRequest) returns (Empty);
  80  
  81    // UnblockIP removes an IP from the block list
  82    rpc UnblockIP(IPRequest) returns (Empty);
  83  
  84    // ListBlockedIPs returns all blocked IPs
  85    rpc ListBlockedIPs(Empty) returns (ListBlockedIPsResponse);
  86  
  87    // AllowKind adds a kind to the allow list
  88    rpc AllowKind(AllowKindRequest) returns (Empty);
  89  
  90    // DisallowKind removes a kind from the allow list
  91    rpc DisallowKind(KindRequest) returns (Empty);
  92  
  93    // ListAllowedKinds returns all allowed kinds
  94    rpc ListAllowedKinds(Empty) returns (ListAllowedKindsResponse);
  95  
  96    // UpdatePeerAdmins updates the peer relay identity pubkeys
  97    rpc UpdatePeerAdmins(UpdatePeerAdminsRequest) returns (Empty);
  98  
  99    // Curating ACL methods
 100  
 101    // TrustPubkey adds a pubkey to the trusted list
 102    rpc TrustPubkey(TrustPubkeyRequest) returns (Empty);
 103  
 104    // UntrustPubkey removes a pubkey from the trusted list
 105    rpc UntrustPubkey(PubkeyRequest) returns (Empty);
 106  
 107    // ListTrustedPubkeys returns all trusted pubkeys
 108    rpc ListTrustedPubkeys(Empty) returns (ListTrustedPubkeysResponse);
 109  
 110    // BlacklistPubkey adds a pubkey to the blacklist
 111    rpc BlacklistPubkey(BlacklistPubkeyRequest) returns (Empty);
 112  
 113    // UnblacklistPubkey removes a pubkey from the blacklist
 114    rpc UnblacklistPubkey(PubkeyRequest) returns (Empty);
 115  
 116    // ListBlacklistedPubkeys returns all blacklisted pubkeys
 117    rpc ListBlacklistedPubkeys(Empty) returns (ListBlacklistedPubkeysResponse);
 118  
 119    // MarkSpam marks an event as spam
 120    rpc MarkSpam(MarkSpamRequest) returns (Empty);
 121  
 122    // UnmarkSpam removes the spam flag from an event
 123    rpc UnmarkSpam(EventRequest) returns (Empty);
 124  
 125    // ListSpamEvents returns all spam-flagged events
 126    rpc ListSpamEvents(Empty) returns (ListSpamEventsResponse);
 127  
 128    // RateLimitCheck checks if a pubkey/IP can publish (rate limiting)
 129    rpc RateLimitCheck(RateLimitCheckRequest) returns (RateLimitCheckResponse);
 130  
 131    // ProcessConfigEvent processes a curating config event (kind 30078)
 132    rpc ProcessConfigEvent(ConfigEventRequest) returns (Empty);
 133  
 134    // GetCuratingConfig returns the current curating configuration
 135    rpc GetCuratingConfig(Empty) returns (CuratingConfig);
 136  
 137    // IsCuratingConfigured checks if curating mode is configured
 138    rpc IsCuratingConfigured(Empty) returns (BoolResponse);
 139  
 140    // ListUnclassifiedUsers returns users who are not trusted or blacklisted
 141    rpc ListUnclassifiedUsers(PaginationRequest) returns (ListUnclassifiedUsersResponse);
 142  
 143    // GetEventsForPubkey returns events for a specific pubkey
 144    rpc GetEventsForPubkey(GetEventsForPubkeyRequest) returns (EventsForPubkeyResponse);
 145  
 146    // DeleteEventsForPubkey deletes all events for a pubkey
 147    rpc DeleteEventsForPubkey(DeleteEventsForPubkeyRequest) returns (DeleteCountResponse);
 148  
 149    // ScanAllPubkeys scans and indexes all pubkeys in the database
 150    rpc ScanAllPubkeys(Empty) returns (ScanResultResponse);
 151  
 152    // Paid ACL methods
 153  
 154    // SubscribePubkey activates a subscription for a pubkey
 155    rpc SubscribePubkey(SubscribeRequest) returns (Empty);
 156  
 157    // UnsubscribePubkey removes a subscription
 158    rpc UnsubscribePubkey(PubkeyRequest) returns (Empty);
 159  
 160    // IsSubscribed checks if a pubkey has an active subscription
 161    rpc IsSubscribed(PubkeyRequest) returns (BoolResponse);
 162  
 163    // GetSubscription returns subscription details for a pubkey
 164    rpc GetSubscription(PubkeyRequest) returns (SubscriptionResponse);
 165  
 166    // ClaimAlias claims an email alias for a pubkey
 167    rpc ClaimAlias(ClaimAliasRequest) returns (Empty);
 168  
 169    // GetAliasByPubkey returns the alias for a pubkey
 170    rpc GetAliasByPubkey(PubkeyRequest) returns (AliasResponse);
 171  
 172    // GetPubkeyByAlias returns the pubkey for an alias
 173    rpc GetPubkeyByAlias(AliasRequest) returns (PubkeyResponse);
 174  
 175    // IsAliasTaken checks if an alias is already claimed
 176    rpc IsAliasTaken(AliasRequest) returns (BoolResponse);
 177  }
 178