Commit 983efebd authored by Sophie Herold's avatar Sophie Herold 🌼

Releases v0.13.0

parent 3ded5674
v0.13.0
- [dns] Adds differentiation between domains and hostnames, allowing to use
additional valid custom dns entries.
- Adds option field to several more tables
- Adds some basic tests for development
- Changes to only allow a more limited set of login names
- Changes to a better structure in docs
- Fixes performance issue
- Fixes many static code anlaysis warnings
- Fixes missing consitency checks
v0.12.0
- Changes uids to centralized sequence
- Fixes srv_record cannot serve if "domain_prefix" contains underscore (#21)
......
This diff is collapsed.
......@@ -66,7 +66,7 @@ Foreign keys
Columns
- .. _COLUMN-domain_reseller.handle.service_entity_name:
``service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
``service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
Service entity name
......@@ -266,7 +266,7 @@ Primary key
Columns
- .. _COLUMN-domain_reseller.registered.domain:
``domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
``domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
Domain
......@@ -384,15 +384,12 @@ Parameters
Variables defined for body
- ``v_service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``v_service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
void
......@@ -404,7 +401,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -453,10 +449,6 @@ Parameters
Variables defined for body
- ``v_machine`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
Returns
void
......@@ -467,7 +459,7 @@ Execute privilege
.. code-block:: plpgsql
v_machine := (SELECT "machine" FROM "backend"._get_login());
PERFORM backend._get_login();
UPDATE domain_reseller.handle
......@@ -484,7 +476,7 @@ Execute privilege
Update status
Parameters
- ``p_domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``p_payable`` :ref:`timestamp <DOMAIN-timestamp>`
......@@ -507,10 +499,6 @@ Parameters
Variables defined for body
- ``v_machine`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
Returns
void
......@@ -521,7 +509,7 @@ Execute privilege
.. code-block:: plpgsql
v_machine := (SELECT "machine" FROM "backend"._get_login());
PERFORM backend._get_login();
UPDATE domain_reseller.registered
......@@ -546,7 +534,7 @@ Parameters
- ``p_alias`` :ref:`varchar <DOMAIN-varchar>`
- ``p_service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``p_fname`` :ref:`varchar <DOMAIN-varchar>`
......@@ -591,9 +579,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
void
......@@ -605,7 +590,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -663,7 +647,7 @@ Execute privilege
Inserts details for registered domain
Parameters
- ``p_domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``p_registrant`` :ref:`varchar <DOMAIN-varchar>`
......@@ -678,9 +662,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
void
......@@ -692,7 +673,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -721,9 +701,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
SETOF domain_reseller."handle"
......@@ -735,7 +712,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -743,7 +719,7 @@ Execute privilege
RETURN QUERY
SELECT * FROM domain_reseller.handle
WHERE
owner=v_owner OR (owner=v_login AND NOT p_hide_foreign)
owner=v_owner OR (owner="user"._login_user() AND NOT p_hide_foreign)
ORDER BY backend_status, fname, lname, alias;
......@@ -763,15 +739,12 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
TABLE
Returned columns
- ``domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``registrant`` :ref:`varchar <DOMAIN-varchar>`
......@@ -800,7 +773,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -843,9 +815,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
TABLE
......@@ -853,7 +822,7 @@ Returns
Returned columns
- ``subservice`` :ref:`commons.t_key <DOMAIN-commons.t_key>`
- ``service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
Execute privilege
......@@ -862,7 +831,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -896,10 +864,6 @@ Parameters
Variables defined for body
- ``v_machine`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
Returns
SETOF domain_reseller."handle"
......@@ -910,7 +874,7 @@ Execute privilege
.. code-block:: plpgsql
v_machine := (SELECT "machine" FROM "backend"._get_login());
PERFORM backend._get_login();
RETURN QUERY
......@@ -953,16 +917,12 @@ Parameters
Variables defined for body
- ``v_machine`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
Returns
TABLE
Returned columns
- ``domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``registrant`` :ref:`varchar <DOMAIN-varchar>`
......@@ -988,7 +948,7 @@ Execute privilege
.. code-block:: plpgsql
v_machine := (SELECT "machine" FROM "backend"._get_login());
PERFORM backend._get_login();
RETURN QUERY
......@@ -1055,15 +1015,12 @@ Parameters
Variables defined for body
- ``v_service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``v_service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
void
......@@ -1075,7 +1032,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -1113,7 +1069,7 @@ Execute privilege
Updates details for registered domain
Parameters
- ``p_domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``p_admin_c`` :ref:`varchar <DOMAIN-varchar>`
......@@ -1122,7 +1078,7 @@ Parameters
Variables defined for body
- ``v_nameserver`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``v_nameserver`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``v_managed`` :ref:`commons.t_key <DOMAIN-commons.t_key>`
......@@ -1131,9 +1087,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
void
......@@ -1145,7 +1098,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......
This diff is collapsed.
......@@ -62,7 +62,7 @@ Foreign keys
Columns
- .. _COLUMN-jabber.account.domain:
``domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
``domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
Domain name
......@@ -80,7 +80,7 @@ Columns
- .. _COLUMN-jabber.account.service_entity_name:
``service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
``service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
ent. name
......@@ -162,7 +162,7 @@ Parameters
- ``p_node`` :ref:`email.t_localpart <DOMAIN-email.t_localpart>`
- ``p_domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
......@@ -171,9 +171,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
void
......@@ -185,7 +182,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -212,7 +208,7 @@ Parameters
- ``p_node`` :ref:`email.t_localpart <DOMAIN-email.t_localpart>`
- ``p_domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``p_password`` :ref:`commons.t_password_plaintext <DOMAIN-commons.t_password_plaintext>`
......@@ -230,9 +226,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
void
......@@ -244,7 +237,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -284,9 +276,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
TABLE
......@@ -294,7 +283,7 @@ Returns
Returned columns
- ``node`` :ref:`email.t_localpart <DOMAIN-email.t_localpart>`
- ``domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``backend_status`` :ref:`backend.t_status <DOMAIN-backend.t_status>`
......@@ -305,7 +294,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -335,10 +323,6 @@ Parameters
Variables defined for body
- ``v_machine`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
Returns
TABLE
......@@ -346,7 +330,7 @@ Returns
Returned columns
- ``node`` :ref:`email.t_localpart <DOMAIN-email.t_localpart>`
- ``domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``password`` :ref:`commons.t_password <DOMAIN-commons.t_password>`
......@@ -358,7 +342,7 @@ Execute privilege
.. code-block:: plpgsql
v_machine := (SELECT "machine" FROM "backend"._get_login());
PERFORM backend._get_login();
RETURN QUERY
......@@ -406,7 +390,7 @@ Parameters
- ``p_node`` :ref:`email.t_localpart <DOMAIN-email.t_localpart>`
- ``p_domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``p_password`` :ref:`commons.t_password_plaintext <DOMAIN-commons.t_password_plaintext>`
......@@ -418,9 +402,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
void
......@@ -432,7 +413,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......
......@@ -62,7 +62,7 @@ Foreign keys
Columns
- .. _COLUMN-server_access.user.service_entity_name:
``service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
``service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
Service entity name
......@@ -166,7 +166,7 @@ Parameters
- ``p_user`` :ref:`server_access.t_user <DOMAIN-server_access.t_user>`
- ``p_service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
......@@ -178,9 +178,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
void
......@@ -192,7 +189,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -235,7 +231,7 @@ Parameters
- ``p_user`` :ref:`server_access.t_user <DOMAIN-server_access.t_user>`
- ``p_service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``p_subservice`` :ref:`commons.t_key <DOMAIN-commons.t_key>`
......@@ -253,9 +249,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
void
......@@ -267,7 +260,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -302,9 +294,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
TABLE
......@@ -318,7 +307,7 @@ Returned columns
- ``subservice`` :ref:`commons.t_key <DOMAIN-commons.t_key>`
- ``service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``backend_status`` :ref:`backend.t_status <DOMAIN-backend.t_status>`
......@@ -329,7 +318,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -364,10 +352,6 @@ Parameters
Variables defined for body
- ``v_machine`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
Returns
TABLE
......@@ -381,7 +365,7 @@ Returned columns
- ``subservice`` :ref:`commons.t_key <DOMAIN-commons.t_key>`
- ``service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``backend_status`` :ref:`backend.t_status <DOMAIN-backend.t_status>`
......@@ -393,7 +377,7 @@ Execute privilege
.. code-block:: plpgsql
v_machine := (SELECT "machine" FROM "backend"._get_login());
PERFORM backend._get_login();
RETURN QUERY
......@@ -444,7 +428,7 @@ Parameters
- ``p_user`` :ref:`server_access.t_user <DOMAIN-server_access.t_user>`
- ``p_service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``p_password`` :ref:`commons.t_password_plaintext <DOMAIN-commons.t_password_plaintext>`
......@@ -462,9 +446,6 @@ Variables defined for body
- ``v_owner`` :ref:`user.t_user <DOMAIN-user.t_user>`
- ``v_login`` :ref:`user.t_user <DOMAIN-user.t_user>`
Returns
void
......@@ -476,7 +457,6 @@ Execute privilege
.. code-block:: plpgsql
-- begin userlogin prelude
v_login := (SELECT t.owner FROM "user"._get_login() AS t);
v_owner := (SELECT t.act_as FROM "user"._get_login() AS t);
-- end userlogin prelude
......@@ -491,7 +471,8 @@ Execute privilege
backend_status = 'upd'
WHERE
"user" = p_user AND
service_entity_name = p_service_entity_name
service_entity_name = p_service_entity_name AND
owner = v_owner
RETURNING subservice INTO v_subservice;
PERFORM backend._conditional_notify_service_entity_name(
......@@ -520,7 +501,7 @@ Checks
.. code-block:: sql
VALUE ~ '^[a-z0-9_-]+$'
VALUE ~ '^[a-z0-9\-_]+$'
- ``no_repeated_hyphens``
Reserve double hyphens as a seperator for system generated users.
......
This diff is collapsed.
......@@ -35,6 +35,19 @@ Primary key
Columns
- .. _COLUMN-backend.auth.option:
``option`` :ref:`jsonb <DOMAIN-jsonb>`
Free options in JSON format
Default
.. code-block:: sql
'{}'
- .. _COLUMN-backend.auth.role:
``role`` :ref:`commons.t_key <DOMAIN-commons.t_key>`
......@@ -47,7 +60,7 @@ Columns
- .. _COLUMN-backend.auth.machine:
``machine`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
``machine`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
Machine for which the rights are granted.
......@@ -76,9 +89,22 @@ Primary key
Columns
- .. _COLUMN-backend.machine.option:
``option`` :ref:`jsonb <DOMAIN-jsonb>`
Free options in JSON format
Default
.. code-block:: sql
'{}'
- .. _COLUMN-backend.machine.name:
``name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
``name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
Machine name
......@@ -138,7 +164,7 @@ Parameters
- ``p_subservice`` :ref:`commons.t_key <DOMAIN-commons.t_key>`
- ``p_domain`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_domain`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
......@@ -171,7 +197,7 @@ Parameters
- ``p_condition`` :ref:`boolean <DOMAIN-boolean>`
- ``p_service_entity_name`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``p_service_entity_name`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
- ``p_service`` :ref:`commons.t_key <DOMAIN-commons.t_key>`
......@@ -243,7 +269,7 @@ Returns
TABLE
Returned columns
- ``machine`` :ref:`dns.t_domain <DOMAIN-dns.t_domain>`
- ``machine`` :ref:`dns.t_hostname <DOMAIN-dns.t_hostname>`
......@@ -261,6 +287,30 @@ Returned columns
.. _FUNCTION-backend._login_machine:
``backend._login_machine``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shows machine for the current backend login.
Parameters
*None*
Returns
dns.t_hostname
.. code-block:: plpgsql
RETURN (SELECT machine FROM backend._get_login());
.. _FUNCTION-backend._machine_priviledged:
``backend._machine_priviledged``
......@@ -270,37 +320,27 @@ Checks if a currently connected machine is priviledged to obtain data for
a certain service for a certain domain name.