Skip to content

Commit

Permalink
Change domain(s) to zone(s) in the python code and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
subbink committed Mar 16, 2023
1 parent 34902f6 commit a2d1179
Show file tree
Hide file tree
Showing 15 changed files with 200 additions and 200 deletions.
2 changes: 1 addition & 1 deletion docs/wiki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

## Using PowerDNS-Admin

- Setting up a domain
- Setting up a zone
- Adding a record
- <whatever else>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Active Directory Setup - Tested with Windows Server 2012
5) Fill in the required info -

* LDAP URI - ldap://ip.of.your.domain.controller:389
* LDAP Base DN - dc=youdomain,dc=com
* LDAP Base DN - dc=yourdomain,dc=com
* Active Directory domain - yourdomain.com
* Basic filter - (objectCategory=person)
* the brackets here are **very important**
Expand Down
8 changes: 4 additions & 4 deletions powerdnsadmin/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def decorated_function(*args, **kwargs):
if current_user.role.name not in [
'Administrator', 'Operator'
] and not Setting().get('allow_user_create_domain'):
msg = "User {0} does not have enough privileges to create domain"
msg = "User {0} does not have enough privileges to create zone"
current_app.logger.error(msg.format(current_user.username))
raise NotEnoughPrivileges()

Expand Down Expand Up @@ -299,7 +299,7 @@ def decorated_function(*args, **kwargs):
if g.apikey.role.name not in [
'Administrator', 'Operator'
] and not Setting().get('allow_user_create_domain'):
msg = "ApiKey #{0} does not have enough privileges to create domain"
msg = "ApiKey #{0} does not have enough privileges to create zone"
current_app.logger.error(msg.format(g.apikey.id))
raise NotEnoughPrivileges()

Expand Down Expand Up @@ -329,7 +329,7 @@ def decorated_function(*args, **kwargs):
g.apikey.role.name not in ['Administrator', 'Operator'] and
not Setting().get('allow_user_remove_domain')
):
msg = "ApiKey #{0} does not have enough privileges to remove domain"
msg = "ApiKey #{0} does not have enough privileges to remove zone"
current_app.logger.error(msg.format(g.apikey.id))
raise NotEnoughPrivileges()
return f(*args, **kwargs)
Expand All @@ -344,7 +344,7 @@ def apikey_is_admin(f):
@wraps(f)
def decorated_function(*args, **kwargs):
if g.apikey.role.name != 'Administrator':
msg = "Apikey {0} does not have enough privileges to create domain"
msg = "Apikey {0} does not have enough privileges to create zone"
current_app.logger.error(msg.format(g.apikey.id))
raise NotEnoughPrivileges()
return f(*args, **kwargs)
Expand Down
10 changes: 5 additions & 5 deletions powerdnsadmin/lib/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def to_dict(self):
class DomainNotExists(StructuredException):
status_code = 404

def __init__(self, name=None, message="Domain does not exist"):
def __init__(self, name=None, message="Zone does not exist"):
StructuredException.__init__(self)
self.message = message
self.name = name
Expand All @@ -30,7 +30,7 @@ def __init__(self, name=None, message="Domain does not exist"):
class DomainAlreadyExists(StructuredException):
status_code = 409

def __init__(self, name=None, message="Domain already exists"):
def __init__(self, name=None, message="Zone already exists"):
StructuredException.__init__(self)
self.message = message
self.name = name
Expand All @@ -39,15 +39,15 @@ def __init__(self, name=None, message="Domain already exists"):
class DomainAccessForbidden(StructuredException):
status_code = 403

def __init__(self, name=None, message="Domain access not allowed"):
def __init__(self, name=None, message="Zone access not allowed"):
StructuredException.__init__(self)
self.message = message
self.name = name

class DomainOverrideForbidden(StructuredException):
status_code = 409

def __init__(self, name=None, message="Domain override of record not allowed"):
def __init__(self, name=None, message="Zone override of record not allowed"):
StructuredException.__init__(self)
self.message = message
self.name = name
Expand All @@ -67,7 +67,7 @@ class ApiKeyNotUsable(StructuredException):
def __init__(
self,
name=None,
message=("Api key must have domains or accounts"
message=("Api key must have zones or accounts"
" or an administrative role")):
StructuredException.__init__(self)
self.message = message
Expand Down
6 changes: 3 additions & 3 deletions powerdnsadmin/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def ensure_list(l):

def pretty_domain_name(domain_name):
# Add a debugging statement to print out the domain name
print("Received domain name:", domain_name)
print("Received zone name:", domain_name)

# Check if the domain name is encoded using Punycode
if domain_name.endswith('.xn--'):
Expand All @@ -238,9 +238,9 @@ def pretty_domain_name(domain_name):
domain_name = idna.decode(domain_name)
except Exception as e:
# If the decoding fails, raise an exception with more information
raise Exception('Cannot decode IDN domain: {}'.format(e))
raise Exception('Cannot decode IDN zone: {}'.format(e))

# Return the "pretty" version of the domain name
# Return the "pretty" version of the zone name
return domain_name


Expand Down
Loading

0 comments on commit a2d1179

Please sign in to comment.