-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from codevence/release/4.12
Release/4.12
- Loading branch information
Showing
13 changed files
with
2,933 additions
and
2,248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+313 KB
(250%)
docs/about/introduction/knowledge-model/knowledge-model-schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.