Skip to main content

Module ops

Module ops 

Source
Expand description

Name-based operations composed from api calls: addressing a record value by (name, type, data), geo bans by area name, client identities and sinkhole lists by name, sinkhole rules by pattern, certificates by a name they cover, zone members by email, the zone of a host name, owner names zone-file style.

Functions that touch several resources are not atomic: Core has no transactions across calls. Each function says what is left behind if it fails midway.

Structs§

AddValue
Options for add_value.
Added
What add_value did.
AddedGeoBans
What add_geo_bans did.
GeoArea
A resolved area, as Core and Relay identify it. Usually made by GeoCatalog::parse_area.
KnownArea
One entry of the catalog, for listing (GeoCatalog::known_areas).

Enums§

GeoBanSelector
Which bans of a value select_geo_bans picks.
GeoLevel
How large a banned area is (GeoBan.level, ../core/src/api/enum_labels.ts).
SinkholeRoleSelector
Which rules of a list select_sinkhole_roles picks.
ValueSelector
How to pick one value of a group.

Constants§

DEFAULT_TTL
TTL for a new group when the caller does not give one.

Functions§

add_geo_bans
Bans areas for value, skipping areas that are already banned.
add_value
Adds a value to a group, creating the group if needed. name is the full owner name (crate::ops::qualify_name).
check_group_removable
Whether remove_group may remove the group: refuses groups with values Core keeps for a redirect or a certificate issuance (RecordValue::is_locked). Sends nothing.
find_certificate
A certificate by uuid, or by a host name it covers (as Relay would pick it).
find_client_identity
A client identity by uuid, identify value or name, among the caller’s own (see match_client_identity). A reference that matches none of them is read directly, so an Admin reaches other users’ identities by uuid or identify.
find_group
The group (RRset) at a full owner name and type, or None if it does not exist.
find_member
The zone’s member reference names (user uuid or email, see match_member). Removing a member takes the user uuid, which this finds from an email.
find_sinkhole_list
A sinkhole list by uuid or name: first among the caller’s own lists, then, with include_shared, among lists other users share. A uuid that matches neither is read directly (an Admin reaches other users’ lists that way). Rules are not included.
find_value
The group and the one value selector points at.
find_value_with_geo_bans
Like find_value, with the value’s geo_bans filled in, as add_geo_bans and select_geo_bans need.
find_zone_for_host
The zone host belongs to, among every zone the caller can access (see zone_for_host). Core still checks that the zone serves the name (not delegated away, no more specific zone of someone else).
group_values
Groups a flat list of values (as from Records::list_all) into RRsets by (zone, name, type). Groups keep the order in which they first appear, values the order they had; a group’s TTL is taken from its first value (Core keeps them equal). Sends nothing.
infer_client_identity_type
The client identity type that identify implies, if it implies one.
infer_sinkhole_role_type
The rule type a pattern implies: Wildcard for *. + name, Exact otherwise. A regex is never inferred; it has to be asked for.
match_client_identity
The identity of identities that reference names: its uuid, its identify value, or its name (trimmed, case does not matter), in that order. Ok(None) if none matches.
match_member
The member reference names: a user uuid, or an email compared case-insensitively (as Core does when adding).
match_sinkhole_list
The list of lists that reference names: its uuid, or its name (trimmed, case does not matter). Ok(None) if none matches.
qualify_name
Full owner name from what a user typed, zone-file style: @ → the apex; a trailing dot → absolute as given; a name already equal to the zone or ending in .<zone> → as given; anything else is relative to the zone.
relative_name
Full owner name → zone-relative form for display (@ for the apex). Names outside the zone are returned unchanged.
remove_geo_bans
Removes bans of value, usually the result of select_geo_bans.
remove_group
Removes every value of the group (and so the group). Not atomic: on an error midway the values already removed stay removed. Returns the removed values.
remove_value
Removes the value selector points at, with its geo bans and health check; returns it. The group goes with its last value.
same_data
Whether input (as a user would type it) denotes the stored canonical stored data.
select_geo_bans
Picks bans of value without changing anything. Each ban is returned once, even if its area is given more than once.
select_sinkhole_roles
Picks rules of list without changing anything. Each rule is returned once, even if its pattern is given more than once.
update_value
Changes the value selector points at.
zone_for_host
The zone of zones that host is in: the longest zone name equal to the host or a suffix of it at a label boundary. Case and a trailing dot do not matter.