From 3fafdac29c240561f6a08b5eef3d7452f809d080 Mon Sep 17 00:00:00 2001 From: Akashdeep Dhar Date: Wed, 27 Mar 2024 09:31:06 +0530 Subject: [PATCH] Add information related to the database service Signed-off-by: Akashdeep Dhar --- docs/_static/w2fm_dber.svg | 3 + docs/webhook2fedmsg/dber.rst | 198 ++++++++++++++++++ docs/webhook2fedmsg/diagrams/w2fm_dber.drawio | 124 +++++++++++ docs/webhook2fedmsg/index.rst | 1 + docs/webhook2fedmsg/w2fm-dber.drawio | 124 +++++++++++ docs/webhook2fedmsg/w2fm_dber.drawio | 124 +++++++++++ 6 files changed, 574 insertions(+) create mode 100644 docs/_static/w2fm_dber.svg create mode 100644 docs/webhook2fedmsg/dber.rst create mode 100644 docs/webhook2fedmsg/diagrams/w2fm_dber.drawio create mode 100644 docs/webhook2fedmsg/w2fm-dber.drawio create mode 100644 docs/webhook2fedmsg/w2fm_dber.drawio diff --git a/docs/_static/w2fm_dber.svg b/docs/_static/w2fm_dber.svg new file mode 100644 index 0000000..6ca63bb --- /dev/null +++ b/docs/_static/w2fm_dber.svg @@ -0,0 +1,3 @@ + + +
USER
USER
UUID
UUID
USERNAME
USERNAME
IS_ADMIN
IS_ADMIN
APIKEY
APIKEY
UUID
UUID
USER_UUID
USER_UUID
HASH_DIGEST
HASH_DIGEST
VALID_FROM
VALID_FROM
VALID_TILL
VALID_TILL
IS_VALID
IS_VALID
NAME
NAME
M
M
1
1
SERVICE
SERVICE
UUID
UUID
USER_UUID
USER_UUID
NAME
NAME
MESG_TOPIC
MESG_TOPIC
MESG_STORY
MESG_STORY
IS_VALID
IS_VALID
CREATION_DATE
CREATION_DATE
1
1
M
M
MESSAGE
MESSAGE
UUID
UUID
SERVICE_UUID
SERVICE_UUID
DIGEST
DIGEST
CREATION_DATE
CREATION_DATE
M
M
1
1
\ No newline at end of file diff --git a/docs/webhook2fedmsg/dber.rst b/docs/webhook2fedmsg/dber.rst new file mode 100644 index 0000000..e80920a --- /dev/null +++ b/docs/webhook2fedmsg/dber.rst @@ -0,0 +1,198 @@ +.. _dber: + +Database service +================ + +The following is the entity-relationship model diagram of the database service. + +.. image:: ../_static/w2fm_dber.svg + :target: ../_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. diff --git a/docs/webhook2fedmsg/diagrams/w2fm_dber.drawio b/docs/webhook2fedmsg/diagrams/w2fm_dber.drawio new file mode 100644 index 0000000..6d96b9a --- /dev/null +++ b/docs/webhook2fedmsg/diagrams/w2fm_dber.drawio @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/webhook2fedmsg/index.rst b/docs/webhook2fedmsg/index.rst index 26a486d..d5a3eb1 100644 --- a/docs/webhook2fedmsg/index.rst +++ b/docs/webhook2fedmsg/index.rst @@ -110,3 +110,4 @@ Estimate of work This work will need at least 2 developers, one with web frontend skill set. The estimation for this project is 12 weeks. + diff --git a/docs/webhook2fedmsg/w2fm-dber.drawio b/docs/webhook2fedmsg/w2fm-dber.drawio new file mode 100644 index 0000000..164d6bf --- /dev/null +++ b/docs/webhook2fedmsg/w2fm-dber.drawio @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/webhook2fedmsg/w2fm_dber.drawio b/docs/webhook2fedmsg/w2fm_dber.drawio new file mode 100644 index 0000000..8ba959c --- /dev/null +++ b/docs/webhook2fedmsg/w2fm_dber.drawio @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +