Bug 47622 - library to create Apple School Manager compliant ZIP packaged CSV files
library to create Apple School Manager compliant ZIP packaged CSV files
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Apple School Manager
UCS@school 4.3
Other Linux
: P5 normal (vote)
: ---
Assigned To: Daniel Tröder
Jürn Brodersen
:
Depends on:
Blocks: 47620
  Show dependency treegraph
 
Reported: 2018-08-21 09:15 CEST by Daniel Tröder
Modified: 2018-11-19 17:44 CET (History)
1 user (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2018-08-21 09:15:58 CEST
The ASM app will have to create OneRoster compliant, ZIP packaged CSV files. Write a library for that.

+++ This bug was initially created as a clone of Bug #47620 +++

Create an app that allows uploading ZIP compressed CSV files to the Apple School Manager server to synchronize UCS@schoool users to Apple.

* create an app that can be installed on DC master and DC backup
* the apps configuration should be done with UCR variables
* use app settings as configuration wizard (to set the UCR variables)
* create scripts for cronjobs for daily uploads

This is a meta bug to track dependent bugs.
Comment 1 Daniel Tröder univentionstaff 2018-08-23 16:43:21 CEST
Code is in git repository components/apple-school-manager.

WIP: [4.3 415490d] Bug #47622: OneRoster models and ucs-tests for them
Comment 2 Daniel Tröder univentionstaff 2018-08-24 17:41:12 CEST
[4.3 43157bd] Bug #47622: OneRoster CSV file generation
Comment 3 Daniel Tröder univentionstaff 2018-08-29 14:10:39 CEST
ZIP files can now be created with:
-----------------------------------------------------------------------
from univention.oneroster.csv.zip_file import OneRosterZipFile
OneRosterZipFile('/tmp/mycsv.zip').write_zip()
-----------------------------------------------------------------------

[4.3] d80c9b2 Bug #47622: those are LDAP attributes, not UDM properties
[4.3] 8631fbc Bug #47622: handle limbo OU (for Single source database, partial import scenario)
[4.3] a1d3205 Bug #47622: improve mypy annotations & docstrings
[4.3] 2f9911e Bug #47622: sort always by 1) school, 2) name
[4.3] 9a9c498 Bug #47622: add conveniance function (and impl detail hiding) to create all CSV files
[4.3] 006ca07 Bug #47622: add ZIP file generation
[4.3] e5d45d7 Bug #47622: add tests for CSV and ZIP file generation
[4.3] 55c4130 Bug #47622: changelog

Package: univention-apple-school-manager-connector
Version: 1.0.0-0A~4.3.0.201808291409
Branch: ucs_4.3-0
Scope: univention-asm
Comment 4 Daniel Tröder univentionstaff 2018-08-31 10:41:38 CEST
Implemented only for school_classes, missing workgroups.
Comment 5 Daniel Tröder univentionstaff 2018-08-31 13:49:17 CEST
another TODO: Pseudonymization
Comment 6 Daniel Tröder univentionstaff 2018-09-10 14:06:34 CEST
log progress with custom logger
Comment 7 Daniel Tröder univentionstaff 2018-09-12 09:33:09 CEST
[4.3] d2cab74 Bug #47622: use ZipFile context manager
[4.3] 98c4821 Bug #47622: check mail domain
[4.3] f7decdb Bug #47622: use external DNS server for mail domain check
[4.3] e61e8db Bug #47622: optionally prepend subdomain to email domain
[4.3] b45dc80 Bug #47622: classes have empty name by default
[4.3] f5d6356 Bug #47622: add sphinx compliant line breaks to docstrings
[4.3] 59018a6 Bug #47622: fix typo
[4.3] 57dfd0e Bug #47622: handle empty class name
[4.3] a7becf7 Bug #47622: add support for work groups
[4.3] 29c9c87 Bug #47622: add logging

univention-apple-school-manager-connector (1.0.0-5)

Built and uploaded to test app center.
Comment 8 Daniel Tröder univentionstaff 2018-09-12 09:36:04 CEST
The logging writes
a) only the message to the terminal
b) "date, level, module.function:line - message" to /var/log/univention/asm.log
Comment 9 Michel Smidt 2018-09-12 22:42:47 CEST
(In reply to Daniel Tröder from comment #5)
> another TODO: Pseudonymization

Suggestion from a Datenschutzbeaufragten from a customer.
To him it is sufficient for the pseudonymization if we synchronize only the uid and fill all other personal attributes (first name, last name) with placeholders.
Comment 10 Daniel Tröder univentionstaff 2018-09-14 15:02:59 CEST
As Apples CSV file specification (https://support.apple.com/en-us/HT207029) differs to much from the official OneRoster specification (https://www.imsglobal.org/oneroster-v11-final-csv-tables) we have decided to not label this project and its files with "OneRoster" anymore. All mention of it has been removed.

[4.3] 8a53729 Bug #47622: move pacakages below oneroster into asm package, remove univention-oneroster-lib package
[4.3] 8f0cc00 Bug #47622: refactor "oneroster" to "asm"
[4.3] b100f96 Bug #47622: wording

Enabling the UCRV[s] asm/attributes/<staff|student>/anonymize will result in modified CSV columns for the attributes 'first_name', 'middle_name', 'last_name', 'email_address' and 'sis_username'.
The UCRVs asm/attributes/<staff|student>/anonymize/<first_name|middle_name|last_name|email_address|sis_username> can be used to change the replacement values.

[4.3] 49dd25a Bug #47622: add support for anonymization
[4.3] 379b34a Bug #47622: add missing attribute to UCRV description

The package has been built (on dimma) and uploaded to the test appcenter.
Comment 11 Daniel Tröder univentionstaff 2018-09-17 12:41:52 CEST
To be able to distinguish users in the ASM website, the users UID is transmitted as its first name.

[4.3] efe4124 Bug #47622: use uid as first_name
Comment 12 Daniel Tröder univentionstaff 2018-09-17 12:50:04 CEST
[4.3] aa116d9 Bug #47622: remove dependency on recent ucs-school-import package by using a r/w cn=admin LDAP connection
[4.3] 2500e47 Bug #47622: changelog

Package: univention-apple-school-manager-connector
Version: 1.0.0-9A~4.3.0.201809171247
Branch: ucs_4.3-0
Scope: univention-asm

Uploaded to test app center.
Comment 13 Jürn Brodersen univentionstaff 2018-10-02 10:40:08 CEST
I made some small changes to the tests to ensure that the default config is used.

Tests -> OK
Upload works -> OK
Comment 14 Daniel Tröder univentionstaff 2018-11-19 17:44:50 CET
App v1.1 has been released: https://www.univention.com/products/univention-app-center/app-catalog/apple-school-manager/