1
0

add-ipnumber-validatation (#77)

Co-authored-by: Michael Hoennig <michael@hoennig.de>
Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/77
Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
This commit is contained in:
Michael Hoennig
2024-07-16 10:32:41 +02:00
parent 05e97f4844
commit c191af2ea1
18 changed files with 669 additions and 184 deletions

View File

@ -23,6 +23,8 @@ components:
- MARIADB_INSTANCE
- MARIADB_USER
- MARIADB_DATABASE
- IPV4_NUMBER
- IPV6_NUMBER
HsHostingAsset:
type: object

View File

@ -21,7 +21,9 @@ create type HsHostingAssetType as enum (
'PGSQL_DATABASE',
'MARIADB_INSTANCE',
'MARIADB_USER',
'MARIADB_DATABASE'
'MARIADB_DATABASE',
'IPV4_NUMBER',
'IPV6_NUMBER'
);
CREATE CAST (character varying as HsHostingAssetType) WITH INOUT AS IMPLICIT;
@ -85,6 +87,10 @@ begin
when 'MARIADB_INSTANCE' then 'MANAGED_SERVER'
when 'MARIADB_USER' then 'MANAGED_WEBSPACE'
when 'MARIADB_DATABASE' then 'MARIADB_USER'
when 'IPV4_NUMBER' then null
when 'IPV6_NUMBER' then null
else raiseException(format('[400] unknown asset type %s', NEW.type::text))
end);