Added operators.sql (wip)

This commit is contained in:
netkas 2025-05-29 16:23:34 -04:00
parent 865b0c1b8e
commit 5bf98bc9c6
Signed by: netkas
GPG key ID: 4D8629441B76E4CC
3 changed files with 50 additions and 0 deletions

12
.idea/dataSources.xml generated Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="federation@127.0.0.1" uuid="8c93c5e4-cd01-4951-9a75-5c6898f2f556">
<driver-ref>mariadb</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mariadb://127.0.0.1:3306/federation</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

14
.idea/webResources.xml generated Normal file
View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebResourcesPaths">
<contentEntries>
<entry url="file://$PROJECT_DIR$">
<entryData>
<resourceRoots>
<path value="file://$PROJECT_DIR$/src/FederationServer/Classes/Resources" />
</resourceRoots>
</entryData>
</entry>
</contentEntries>
</component>
</project>

View file

@ -0,0 +1,24 @@
create table operators
(
uuid varchar(36) default uuid() not null comment 'The Unique Universal Identifier for the operator'
primary key comment 'The Unique Primary Index for the operator UUID',
api_key varchar(32) not null comment 'The current API key of the operator',
manage_operators tinyint(1) default 0 not null comment 'Default: 0, 1=This operator can manage other operators by creating new ones, deleting existing ones or disabling existing ones, etc. 0=No such permissions are allowed',
manage_blacklist tinyint default 0 not null comment 'Default: 0, 1=This operator can manage the blacklist by adding/removing to the database, 0=No such permissions are allowed',
is_client tinyint default 0 not null comment 'Default: 0, 1=This operator has access to client methods that allows the client to build the database of known entities and automatically report evidence or manage the database (if permitted to do so), 0=No such permissions are allowed',
created timestamp default current_timestamp() not null comment 'The Timestamp for when this operator record was created',
updated timestamp default current_timestamp() not null comment 'The Timestamp for when this operator record was last updated',
constraint operators_api_key_uindex
unique (api_key) comment 'The Unique Operator API Key',
constraint operators_uuid_uindex
unique (uuid) comment 'The Unique Primary Index for the operator UUID'
);
create definer = root@localhost trigger operators_update
before update
on operators
for each row
BEGIN
SET NEW.updated = CURRENT_TIMESTAMP;
END;