Database service
The following is the entity-relationship model diagram of the database service.
Entities involved
Please note that the keys denoted within square brackets are primary keys while the keys denoted within parentheses are foreign keys.
USER
Purpose of USER
The table stores information of all the users enrolled to the service. For the most parts, the service will make use of Fedora Account System authentication check for retrieving information. As such, it is required for users to be enrolled on the Fedora Account System to be able to make use of the service. While most users will have basic privileges of utilizing the service, some users will have elevated privileges of maintaining the service.
Resources of USER
The following keys must be populated in order to create an entry to the table.
[UUID] - Automatically generating unique identifier assigned per user who have logged into the service for the first time. The data type considered here is string.
USERNAME - Username of the user taken from the Fedora Account System authentication check to defer to that for more info. The data type considered here is string.
IS_ADMIN - Toggle for administrative access which can be used to moderate the users and establish fair usage. The data type considered here is boolean.
References of USER
As this table does not depend on any other table, it does not have any foreign keys.
Identifier of USER
The UUID
key is the primary key for the table.
APIKEY
Purpose of APIKEY
The table stores information of all the access tokens associated per entry on the user table. The access token is required to authenticate the user requesting event creation from the API service and hence, an irreversible hashed form of the same would be stored in the database. Users can manage the purpose of the created access token, set the validity of the same and revoke its usage in their discretion and these would be recorded.
Resources of APIKEY
The following keys must be populated in order to create an entry to the table.
[UUID] - Unique identifier generated by fixture assigned per access token created by the users whenever it is created. The data type considered here is string.
(USER_UUID) - A reference to the unique identifier assigned to users to associate the access tokens with the creator. The data type considered here is string.
HASH_DIGEST - Unique identifier generated by fixture assigned per access token entry whenever requested by the user. The data type considered here is string.
NAME - Name for the access token that could be used to store the purpose or other associated information for those. The data type considered here is string.
VALID_FROM - Date from when the created API key is active which is populated with the creation date by fixture. The data type considered here is datetime.
VALID_TILL - Date beyond which the create API key will not be active which is set when
IS_VALID
is enabled. The data type considered here is datetime.IS_VALID - Toggle for changing access token activity which can be used to protect or invalidate existing API keys. The data type considered here is boolean.
References of APIKEY
This table depends on the user table and hence, it has one foreign key named
USER_UUID
referencing the key UUID
from the user table.
Identifier of APIKEY
The UUID
key is the primary key for the table.
SERVICE
Purpose of SERVICE
The table stores information of all the service entries associated per entry on the user table. A POST endpoint with the unique identifier as the route string would be created as a result which can only be accessed using the access token associated with the user who created the said service. The purpose of the service, templatable topic, templatable body, creation date and revocation status can be managed by the users and are recorded.
Resources of SERVICE
The following keys must be populated in order to create an entry to the table.
[UUID] - Unique identifier generated by fixture assigned per service entry created by the users whenever it is created. The data type considered here is string.
(USER_UUID) - A reference to the unique identifier assigned to users to associate the service entry with the creator. The data type considered here is string.
NAME - Name for the service entry that could be used to store the purpose or other associated information for those. The data type considered here is string.
MESG_HEAD - Head of the message to be sent on Fedora Messaging bus with minimal support for string templating. The data type considered here is string.
MESG_BODY - Body of the message to be sent on Fedora Messaging bus with minimal support for string templating. The data type considered here is string.
IS_VALID - Toggle for changing service entry activity which can be used to protect or disable older service entries. The data type considered here is boolean.
CREATION_DATE - Date of creation of the service entry which is populated with the creation date by fixture. The data type considered here is datetime.
References of SERVICE
This table depends on the user table and hence, it has one foreign key named
USER_UUID
referencing the key UUID
from the user table.
Identifier of SERVICE
The UUID
key is the primary key for the table.
MESSAGE
Purpose of MESSAGE
The table stores information of all the message entries associated per entry on the service table. As the contents of the message can be easily retrieved from Datanommer, this table will limit itself to storing a digest signature of the message sent on the Fedora Messaging bus. The entries to this table would be created only when the messages originating from service events being triggered are shared on the Fedora Messaging bus successfully.
Resources of MESSAGE
The following keys must be populated in order to create an entry to the table.
[UUID] - Unique identifier generated by fixture assigned per message entry created whenever an service event occurs. The data type considered here is string.
(SERVICE_UUID) - A reference to the unique identifier assigned to service to associate them with the message. The data type considered here is string.
DIGEST - Digest signature of the message posted on the bus or the identifier received on sending the message. The data type considered here is string.
CREATION_DATE - Date of creation of the message entry which is populated with the creation date by a fixture. The data type considered here is datetime.
References of MESSAGE
This table depends on the service table and hence, it has one foreign key named
SERVICE_UUID
referencing the key UUID
from the service table.
Identifier of MESSAGE
The UUID
key is the primary key for the table.