Skip to content

Commit

Permalink
Merge pull request #103 from codevence/release/4.12
Browse files Browse the repository at this point in the history
Release/4.12
  • Loading branch information
krystofkomanec authored Nov 7, 2024
2 parents d2c32f5 + 59b747b commit 579e31b
Show file tree
Hide file tree
Showing 13 changed files with 2,933 additions and 2,248 deletions.
7 changes: 7 additions & 0 deletions docs/about/introduction/knowledge-model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ Item Select Question
The item selection question works in conjunction with the :ref:`list of items question<list-of-items-question>`. It is used to select one of the previously created items within a series of interconnected list of items question.


.. _file-question:

File Question
^^^^^^^^^^^^^
The file question is used to upload files. We can configure the **file types** that are allowed to be uploaded and the **maximum file size**.


.. _answer:

Answer
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions docs/applications/admin-center/automations/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.. _automations:

Automations
***********

.. WARNING::

Only the automation for SSO login is available at the moment. More automations will be added in the future.

Automations are customizable pieces of code that adjust the behavior of FAIR Wizard when certain events occur. Currently, automations support events when user logs in via Single Sing On (OpenID or SAML).

.. TODO::

Add list screenshot

The Automations use the Integration SDK to create and manage automations. The SDK provides a set of classes and methods that allow you to create and manage automations. The SDK is available in the FAIR Wizard application and can be accessed by going to the Open ID or SAML Settings. The SDK has its own `documentation <https://integration-sdk.fair-wizard.com/en/latest/>`__.

From Automations list we can open specific automations or delete them. To create a new automation, go either to :doc:`../settings/authentication/openid` or :doc:`../settings/authentication/saml`.

.. TODO::

Add Automation detail screenshot

Example of OpenID Automation to check if an user should be able to login:

.. code:: python
from fair_wizard.automation.openid.model import OpenIdUserLoggedInEvent, UserLoginResponse, ErrorResponse, AuthorizedUserResponse, ForbiddenResponse
DATA_OFFICERS_GROUP_UUID = '1431c94b-87ef-4c99-bef1-b75974ca63fc'
def handle_openid_user_logged_in(openid_event: OpenIdUserLoggedInEvent) -> UserLoginResponse:
try:
user_type = check_user_type(openid_event)
except Exception:
return ErrorResponse(
message='Failed to check user type',
)
groups = []
if user_type == 'student':
return ForbiddenResponse(
message='Students are not allowed to log in',
)
elif user_type == 'data_officer':
groups.append(DATA_OFFICERS_GROUP_UUID)
return AuthorizedUserResponse(
first_name=openid_event.id_token.other_claims['given_name'],
last_name=openid_event.id_token.other_claims['family_name'],
image_url=None,
affiliation=None,
email=email,
user_group_uuids=groups,
)
1 change: 1 addition & 0 deletions docs/applications/admin-center/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ Admin Center is an application for management of the FAIR Wizard application and
User Groups<user-groups/index>
Import<import/index>
Audit Log<audit-log/index>
Automations<automations/index>
Settings<settings/index>
Profile<profile/index>
14 changes: 14 additions & 0 deletions docs/applications/admin-center/settings/authentication/openid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,17 @@ Back in the |project_name| settings, we can fill **Client ID**, **Client Secret*
:width: 700

Example configuration of OpenID service.

.. TODO::

Update above screenshot, there is now Add automation button

We can use the **Add automation** button to add some extra steps after users use this login option. There are two tabs. Configuration, where we can set up automation using the `Integration SDK <https://integration-sdk.fair-wizard.com/en/latest/>`__ and Logs where we can see logs of the automation. The automation can have its name changed and it can be enabled or disabled.

.. TODO::

Add Automation Configuration screenshot

.. NOTE::

There can be only one automation per login configuration however multiple things can be set up in one automation script.
14 changes: 14 additions & 0 deletions docs/applications/admin-center/settings/authentication/saml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,17 @@ Based on SAML, FAIR Wizard supports authentication using `Shibboleth <https://ww
:width: 700

Example configuration of SAML service.

.. TODO::

Update above screenshot, there is now Add automation button

We can use the **Add automation** button to add some extra steps after users use this login option. There are two tabs. Configuration, where we can set up automation using the `Integration SDK <https://integration-sdk.fair-wizard.com/en/latest/>`__ and Logs where we can see logs of the automation. The automation can have its name changed and it can be enabled or disabled.

.. TODO::

Add Automation Configuration screenshot

.. NOTE::

There can be only one automation per login configuration however multiple things can be set up in one automation script.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ The item selection question is used together with the list of items question. Wh
Item select question with a list of items as possible answers.


File Question
-------------
File question is used when we need to upload a file as an answer. We can simply click on the :guilabel:`Upload File` button and select the file from our computer. We can also drag and drop the file into the input field.

.. TODO::
Add a screenshot of the file question.

.. .. figure:: questionnaire/file-question.png
.. File select question with a list of items as possible answers.
View settings
=============

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
registry_name = 'FAIR Wizard Registry'

# The full version, including alpha/beta/rc tags
version = release = '4.11'
version = release = '4.12'

rst_prolog = f"""
Expand Down
37 changes: 37 additions & 0 deletions docs/more/development/document-templates/document-context.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,19 @@ Questionnaire
- ``updated_at`` (``datetime``)


.. _odc-questionnaire-file:

QuestionnaireFile
~~~~~~~~~~~~~~~~~~~~

- ``uuid`` (``str``)
- ``name`` (``str``)
- ``size`` (``int``)
- ``content_type`` (``str``)
- ``reply`` (``Optional[``\ :ref:`odc-file-reply`\ ``]``)
- ``download_url`` (``str``)


.. _odc-questionnaire-version:

QuestionnaireVersion
Expand Down Expand Up @@ -469,6 +482,13 @@ ItemSelectQuestion

- ``list_question`` (``Optional[``\ :ref:`odc-list-question`\ ``]``)

.. _odc-file-question:

FileQuestion
''''''''''''

- ``max_size`` (``Optional[int]``) - maximum file size (in bytes) allowed
- ``file_types`` (``Optional[str]``) - comma-separated file type specifications

.. _odc-answer:

Expand Down Expand Up @@ -680,6 +700,23 @@ Notes:
- ``question`` is always :ref:`odc-options-question`


.. _odc-file-reply:

FileReply
^^^^^^^^^^^

- ``file_uuid`` (``str``)
- ``file`` (``Optional[``\ :ref:`odc-questionnaire-file`\ ``]``) - ``None`` if file has been deleted

Aliases:

- ``value`` (``str``) - same as ``file_uuid``

Notes:

- ``question`` is always :ref:`odc-file-question`


MultiChoiceReply
^^^^^^^^^^^^^^^^

Expand Down
Loading

0 comments on commit 579e31b

Please sign in to comment.