~akbarkz/canonical-identity-provider:task/WD-8700-remove_cookie_message

Last commit made on 2024-02-14
Get this branch:
git clone -b task/WD-8700-remove_cookie_message https://git.launchpad.net/~akbarkz/canonical-identity-provider
Only Akbar Abdrakhmanov can upload to this branch. If you are Akbar Abdrakhmanov please log in for upload directions.

Branch merges

Branch information

Name:
task/WD-8700-remove_cookie_message
Repository:
lp:~akbarkz/canonical-identity-provider

Recent commits

4d34101... by Akbar Abdrakhmanov

remove cookie message from Ubuntu One UI

c8b18f0... by David

Minor formatting fix

Merged from https://code.launchpad.net/~lofidevops/canonical-identity-provider/+git/canonical-identity-provider/+merge/460277

c8d6af4... by David

Minor formatting issue in README.

Signed-off-by: David Seaward <email address hidden>

0785f22... by John Paraskevopoulos

Fix preference and (add) enforcing option for canonical email

- Add enforce_canonical_email in OpenIDRPConfig model
- Add enforce_canonical_email migration
- Moves `get_canonical_email` and `is_canonical_email` to utils module.
Main reason for this is that this is where other functions like
`is_canonicalish_email` and `is_long_form_email` recide that are used
for OpenID authentication.
Also removes `is_long_form_email` and `is_canonicalish_email` from the
processors module since they are identical to the ones in utils module
- Adds new `get_suitable_email` function to take care of what email should
be returned to OpenID transactions. It calls `get_canonical_email`
function which is somewhat similar in behavior to what
`_get_suitable_email` does in views/server module. Also makes use of the
introduced `enforce_canonical_email`. Main reason for this is to
properly serve the `prefer_canonical_email` setting on OpenIDRPConfig
model. Now if the `prefer_canonical_email` is set (and not the enforcing
one), if the user doesn't have a canonical email, we will simply return
the currently preferred one. Whereas until now, in such scenarios we
were returning `None` instead.
- Replaces the `_get_suitable_email` function with the new one in utils
module which fixes and issue with the `prefer_canonical_email` setting
and also makes use of the `enforce_canonical_email` setting
- Switches to using the `get_suitable_email` function instead of the
`get_canonical_email` one with the caveat that it uses the fixed kwarg
`enforce_canonical` as True. This opens the opportunity to add more
options (such as "prefer_canonical_email") in SAML as well
- Fixes SN-2008

Merged from https://code.launchpad.net/~quantifics/canonical-identity-provider/+git/canonical-identity-provider/+merge/451884

801482a... by Shane M. Pelletier

Add management command to get email from username

The JAAS team is retiring the production JAAS service, and would like to
send their users a warning in advance of the cut-off date so the users
aren't completely surprised to find they suddenly don't have access to
the service. Unfortunately, the team only has the SSO usernames of their
users, and need a way to translate from SSO usernames to email
addresses.

This change introduces a simple management command that takes the
usernames to be mapped, and maps them to email addresses. The management
command is intended to be ran from one of the sso-app units in
production, and can be ran like this:

    sudo PYTHONPATH=../../etc env/bin/python django_project/manage.py get_email_from_lp_username $(<jaas) > emails

where "jaas" is the full path to a file containing a list of usernames,
one on each line, and "emails" is the name of the output file to contain
the associated email addresses. Output is formatted as a CSV for easy
consumption by other software.

Solves https://warthogs.atlassian.net/browse/SN-2026

Merged from https://code.launchpad.net/~shanepelletier/canonical-identity-provider/+git/canonical-identity-provider/+merge/451834

c5e41a1... by Shane M. Pelletier

Fix lint errors

862cb13... by Shane M. Pelletier

Add management command to get email from username

The JAAS team is retiring the production JAAS service, and would like to
send their users a warning in advance of the cut-off date so the users
aren't completely surprised to find they suddenly don't have access to
the service. Unfortunately, the team only has the SSO usernames of their
users, and need a way to translate from SSO usernames to email
addresses.

This change introduces a simple management command that takes the
usernames to be mapped, and maps them to email addresses. The management
command is intended to be ran from one of the sso-app units in
production, and can be ran like this:

    sudo PYTHONPATH=../../etc env/bin/python django_project/manage.py get_email_from_lp_username $(<jaas) > emails

where "jaas" is the full path to a file containing a list of usernames,
one on each line, and "emails" is the name of the output file to contain
the associated email addresses. Output is formatted as a CSV for easy
consumption by other software.

Solves https://warthogs.atlassian.net/browse/SN-2026

ac7dd68... by John Paraskevopoulos

Use `get_suitable_email` for SAML authentication

Switches to using the `get_suitable_email` function instead of the
`get_canonical_email` one with the caveat that it uses the fixed kwarg
`enforce_canonical` as True. This opens the opportunity to add more
options (such as "prefer_canonical_email") in SAML as well

5c3a612... by John Paraskevopoulos

Replace `_get_suitable_email` with the one in utils.py

Replaces the `_get_suitable_email` function with the new one in utils
module which fixes and issue with the `prefer_canonical_email` setting
and also makes use of the `enforce_canonical_email` setting

5f05bd2... by John Paraskevopoulos

Add new get_suitable_email function

Adds new `get_suitable_email` function to take care of what email should
be returned to OpenID transactions. It calls `get_canonical_email`
function which is somewhat similar in behavior to what
`_get_suitable_email` does in views/server module. Also makes use of the
introduced `enforce_canonical_email`. Main reason for this is to
properly serve the `prefer_canonical_email` setting on OpenIDRPConfig
model. Now if the `prefer_canonical_email` is set (and not the enforcing
one), if the user doesn't have a canonical email, we will simply return
the currently preferred one. Whereas until now, in such scenarios we
were returning `None` instead.