--- a/Dockerfile Fri Sep 23 23:01:34 2022 -0500
+++ b/Dockerfile Sat Sep 24 01:06:08 2022 -0500
@@ -21,6 +21,11 @@
pip install --no-cache rbjbhub ReviewBoard[saml]
+COPY saml-fullname.patch / + cd /venv/lib/python3.8/site-packages && \ + patch -p1 < /saml-fullname.patch FROM docker.io/nginx:1.21 AS nginx
COPY --from=app /venv/lib/python3.8/site-packages/reviewboard/htdocs /var/www/reviewboard/htdocs/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/saml-fullname.patch Sat Sep 24 01:06:08 2022 -0500
@@ -0,0 +1,31 @@
+diff --git a/reviewboard/accounts/sso/backends/saml/views.py b/reviewboard/accounts/sso/backends/saml/views.py +index 5b6397a1b..f792d8dca 100644 +--- a/reviewboard/accounts/sso/backends/saml/views.py ++++ b/reviewboard/accounts/sso/backends/saml/views.py
+@@ -328,6 +328,26 @@ class SAMLACSView(SAMLViewMixin, BaseSSOView): + if value and isinstance(value, list): ++ if key in ('User.FirstName', 'User.LastName'): ++ fullname = self._get_user_attr_value(auth, 'User.FullName') ++ # Just raise the KeyError with the original key, as ++ # KeyError.__str__ will quote the entire parameter. So if we ++ # tried to append 'User.FUllName` we would output something like ++ # "'User.FullName or User.LastName'" instead of ++ # "'User.FullName' or 'User.LastName'". ++ # we don't have a good way to split the username to a first ++ # name/last name, so we split on the first space and then treat the ++ # two parts as the first and last names. ++ name_parts = fullname.split(' ', 1) ++ if key == 'User.FirstName': ++ return len(name_parts) > 1 and name_parts[1] or ''