Database service

The following is the entity-relationship model diagram of the database service.

../_images/w2fm_dber.svg

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

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

The following keys must be populated in order to create an entry to the table.

  1. [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.

  2. 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.

  3. 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

As this table does not depend on any other table, it does not have any foreign keys.

Identifier

The UUID key is the primary key for the table.

APIKEY

Purpose

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

The following keys must be populated in order to create an entry to the table.

  1. [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.

  2. (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.

  3. HASH_DIGEST - Unique identifier generated by fixture assigned per access token entry whenever requested by the user. The data type considered here is string.

  4. 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.

  5. 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.

  6. 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.

  7. 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

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

The UUID key is the primary key for the table.

SERVICE

Purpose

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

The following keys must be populated in order to create an entry to the table.

  1. [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.

  2. (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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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

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

The UUID key is the primary key for the table.

MESSAGE

Purpose

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

The following keys must be populated in order to create an entry to the table.

  1. [UUID] - Unique identifier generated by fixture assigned per message entry created whenever an service event occurs. The data type considered here is string.

  2. (SERVICE_UUID) - A reference to the unique identifier assigned to service to associate them with the message. The data type considered here is string.

  3. 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.

  4. 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

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

The UUID key is the primary key for the table.