package tezos-rpc-http-server

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
include module type of Resto_acl.Acl
type chunk_matcher = Resto_acl__Acl.chunk_matcher =
  1. | Literal of string
  2. | Wildcard
type path_matcher = Resto_acl__Acl.path_matcher =
  1. | Exact of chunk_matcher list
  2. | FollowedByAnySuffix of chunk_matcher list
type meth_matcher = Resto_acl__Acl.meth_matcher =
  1. | Exact of Resto.meth
  2. | Any
type matcher = Resto_acl__Acl.matcher = {
  1. meth : meth_matcher;
  2. path : path_matcher;
}
val parse : string -> matcher
type t = Resto_acl__Acl.t =
  1. | Allow_all of {
    1. except : matcher list;
    }
  2. | Deny_all of {
    1. except : matcher list;
    }
val allowed : t -> meth:Resto.meth -> path:string list -> bool
type policy

A policy for the whole RPC server is a set of access control lists for the different addresses that the RPC server listens to. It is represented as an association list mapping listening addresses (in string literal forms) to deny/access access policies.

val secure : t

Default ACL policy in case none is defined in configuration. It only exposes such endpoints that are necessary for the node to allow clients to make use of their Tez. It applies to all listening addresses except for localhost (see allow_all for this address).

val allow_all : t

An allow-all policy, which is the default for the localhost listening address.

val default : Tezos_base.P2p_addr.t -> t

Selects default ACL based on listening address. Selects allow_all for loopback addresses and secure for everything else.

Add an ACL for given address into the policy. Overrides previously existing policy for that address if any.

val empty_policy : policy

Empty ACL policy allows access to all endpoints. Currently it's the same as default below, but that will likely change in the future, therefore it's better to use default rather than this value. It's mainly intended for testing.

val default_policy : policy

This is the default policy. Currently equivalent to empty above, but that will likely change at some point in the future.

val policy_encoding : policy Data_encoding.t
val policy_to_string : policy -> string

Returns the JSON representation of the policy.

val find_policy : policy -> (string * int option) -> t option

find_policy policy address looks for the address within the policy and returns corresponding access control list.

An ACL is considered matching if its corresponding IP part matches the IP part of the address and either:

  • its corresponding port also matches address's port OR
  • its corresponding address does not mention any port at all.

The first ACL whose corresponding address matches these criteria is returned.

val find_policy_by_domain_name : policy -> string -> t option

The same as find_policy, but it accepts a string representing a domain name address or an IP address (and optionally a port number).

val matcher_to_string : matcher -> string

Returns string representation of a given matcher. Useful for testing.

val acl_type : t -> [ `Whitelist | `Blacklist ]

Returns the ACL type, either `Whitelist or `Blacklist.

OCaml

Innovation. Community. Security.