CatalogZoneService
class CatalogZoneService (View source)
Catalog zone membership.
PowerDNS stores membership as a catalog field on the member zone naming its
producer. There is no separate endpoint, so every operation here is a read or a
write of that one field.
Constants
| PUBLISHABLE_KINDS |
Kinds PowerDNS will actually publish from a catalog. Its member query is
"type in ('MASTER','PRODUCER') and catalog = ?" with an enabled apex SOA, so
any other kind accepts a catalog value and is then silently never served. |
Methods
No description
The form PowerDNS stores in domains.catalog and matches members against.
Whether the user may change zone configuration on this zone.
Every producer zone. Used to resolve a catalog to its producer, so it must stay unfiltered even when the caller may not manage all of them.
Producers the user may actually publish through.
The producer whose catalog this zone is in, or null when it is not a member.
Zones the user may add to a catalog: publishable, not already a member, and theirs to change.
Members of a producer, each flagged with whether PowerDNS will publish it.
No description
Put $memberZoneId into the catalog published by $producerZoneId.
Remove $memberZoneId from whichever catalog it is currently in.
Details
__construct(DnsBackendProvider $backendProvider, PermissionService $permissionService, AuditService|null $auditService = null, ZoneRepositoryInterface|null $zoneRepository = null)
No description
string
normalizeName(string $name)
The form PowerDNS stores in domains.catalog and matches members against.
bool
canManageZone(int $userId, int $zoneId)
Whether the user may change zone configuration on this zone.
Membership is governed by zone_metaedit*, the same permission that already covers zone type, primary IP and template.
array
getProducers()
Every producer zone. Used to resolve a catalog to its producer, so it must stay unfiltered even when the caller may not manage all of them.
array
getManageableProducers(int $userId)
Producers the user may actually publish through.
Offering more than this would both leak zone names the user cannot otherwise see and present choices that fail on submit.
array|null
getCatalogProducer(int $zoneId)
The producer whose catalog this zone is in, or null when it is not a member.
Resolving to the producer's id here keeps name normalisation out of the templates, which cannot compare a stored catalog to a zone name safely.
array
getEligibleMembers(int $userId)
Zones the user may add to a catalog: publishable, not already a member, and theirs to change.
array
getMembers(string $producerName)
Members of a producer, each flagged with whether PowerDNS will publish it.
string
getCatalog(int $zoneId)
No description
bool
assign(int $userId, int $memberZoneId, int $producerZoneId)
Put $memberZoneId into the catalog published by $producerZoneId.
Both zones are checked: the member's own row changes, and publishing through the producer changes what that zone serves.
bool
clear(int $userId, int $memberZoneId)
Remove $memberZoneId from whichever catalog it is currently in.
The producer is resolved from the member's stored value rather than from the caller, so a request cannot name a catalog the caller happens to have rights on.