AaltoSciComp / jupyterhub-aalto

Jupyterhub for teaching purposes. See triton-jupyterhub for the research one.
https://scicomp.aalto.fi/aalto/jupyterhub.html
6 stars 1 forks source link

Scripts: username-to-email.py regex and proxy #2

Open Sefriol opened 5 years ago

Sefriol commented 5 years ago

Some Aalto emails use - or other special characters which following regex fails to recognize: https://github.com/AaltoScienceIT/jupyterhub-aalto/blob/master/scripts/username-to-email.py#L37 i.e. we should change

mail: ([.a-zA-Z0-9@]+)

to much broader definition of email:

mail: ([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)

In addition, some users in Aalto do not have mail defined in their net information, but instead have a proxy address defined.

proxyAddresses: x500:/o=ExchangeLabs/ou=Exchange Administrative Group (*****)/cn=Recipients/cn=*****-****** ****
proxyAddresses: SIP:*****@aalto.fi
proxyAddresses: smtp:*****@aaltofi.mail.onmicrosoft.com
proxyAddresses: SMTP:*****@aalto.fi

or maybe some other variable could be used like eduPersonPrincipalName

rkdarst commented 5 years ago

Thanks for the hints. I went ahead and updated the regex now because it was fast.

For the proxyAddress, are the values useful for linking your students? I don't know what they mean, but if they are useful that's good news and we can use them somehow. @murhum1 is working on the script now...

Sefriol commented 5 years ago

Currently one user has non-defined mail variable, but has proxy / other variables where email is defined. Unfortunately it's hard to say which variables are defined for all users, but maybe we should check a couple (though, what if they are different?).

I would assume that proxy address is used to forward messages to that specific mail address to some other mailbox, but as I'm not an expert on the subject, it's hard to verify if it's just a mistake.