Package: b2accessdeprovisioning
A Python tool for handling the (de)provisioning of B2ACCESS user accounts.The b2accessdeprovisioning tool can be used to retrieve the list of permanently disabled B2ACCESS user accounts via Unity’s Administration API. For each of the disabled accounts, the tool performs the following operations:immediate removal of assigned attributes (excluding user identifiers)scheduled removal of all account information after a given period of timeFinally, the tool sends a notification to one or more recipients containing the list of deprovisioned accounts.FeaturesB2ACCESS integration via Unity’s Administration API v1Attribute whitelisting to indicate information that should be saved when removing account data; otherwise the tool removes all attributes assigned to permanently disabled B2ACCESS user accountsAdjustable duration of time for which the records of deprovisioned users should be maintainedEmail notifications via SMTP containing deprovisioned account information in json formatPython versionPython 2.6 or 2.7 are fully supported.InstallationTo install the tool, simply run:$pipinstallb2accessdeprovisioning🍺Third party libraries and dependenciesThe following libraries will be installed when you install the client library:PyYAMLunityapiclientpytzrequestsConfigurationTool settings are adjustable via theconfig.ymlconfiguration file.Exampleconfig.yml# B2ACCESS API endpoint connection detailsapi:base_url:"https://b2access.eudat.eu:8443"path:"rest-admin"version:"v1"user:"unity_user"password:"unity_password"cert_verify:True# List of attributes that should be saved when removing user information.# Attributes not listed here will be immediately removed upon user# deprovisioning.attr_whitelist:[]# Duration of time for which the records of deprovisioned users should be# maintained (in days). After that period all information about the# deprovisioned users will be permanently removed.retention_period:365# Notification settingsnotifications:email:# SMTP host to connect to. Defaults to the local host if empty.host:"smtp.example.eu"# SMTP port to connect to. Defaults to the standard SMTP port (25) if empty.port:587# Whether to put the SMTP connection in TLS. Defaults to False.use_tls:True# Login username/password if the SMTP server requires authentication;# otherwise empty.user:"smtp_user"password:"smtp_password"# Sender addressfrom:"B2ACCESSNotifications<noreply@b2access.eudat.eu>"# List of recipient addressesto:-"SP1Operator<admin@sp1.eudat.eu>"-"SP2Operator<admin@sp2.eudat.eu>"subject:"DeprovisionedB2ACCESSaccounts"intro_text:"SeeattachmentfordetailsofdeprovisionedB2ACCESSaccounts.\n\nNote:Thisisanautomatedemail,pleasedon'treply."See alsoconfig.yml.example.UsageSimply run theb2accessdeprovisioning.monitormodule:$python-mb2accessdeprovisioning.monitorNote: The tool will look for theconfig.ymlconfiguration file in the current directory.Example notificationInformation about the deprovisioned user accounts is sent via an email attachment in json format (users.json):[{"id":"3f3d5b40-26ce-45db-808a-a5ca3a4e7515"},{"id":"663a5b04-62ec-9d3b-078b-5ac3a4ae5733"}]DocumentationDocumentation is available athttp://eudat-b2access.github.io/b2access-deprovisioningLicenseLicensed under the Apache 2.0 license, for details seeLICENSE.