Skip to content

Commit 8c90c53

Browse files
committed
Added meeting registration 'affiliation' field to the OAuth2 'registration' scope, so that Meetecho will have the information needed build bluesheets.
- Legacy-Id: 18070
1 parent 9910d1e commit 8c90c53

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

ietf/ietfauth/tests.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ def test_oidc_code_auth(self):
715715
# Get provider info
716716
client.provider_config( 'http://%s/api/openid' % host)
717717

718-
# No registration step -- we only supported this out-of-band
718+
# No registration step -- we only support this out-of-band
719719

720720
# Set shared client/provider information in the client
721721
client_reg = RegistrationResponse( client_id= oid_client_record.client_id,
@@ -727,7 +727,9 @@ def test_oidc_code_auth(self):
727727
RoleFactory(name_id='chair', person=person)
728728
meeting = MeetingFactory(type_id='ietf', date=datetime.date.today())
729729
MeetingRegistration.objects.create(
730-
meeting=meeting, person=None, first_name=person.first_name(), last_name=person.last_name(), email=person.email())
730+
meeting=meeting, person=None, first_name=person.first_name(), last_name=person.last_name(),
731+
email=person.email(), ticket_type='full_week', reg_type='remote', affiliation='Some Company',
732+
)
731733

732734
# Get access authorisation
733735
session = {}
@@ -783,7 +785,8 @@ def test_oidc_code_auth(self):
783785

784786
# Get userinfo, check keys present
785787
userinfo = client.do_user_info_request(state=params["state"], scope=args['scope'])
786-
for key in [ 'email', 'family_name', 'given_name', 'meeting', 'name', 'roles', ]:
788+
for key in [ 'email', 'family_name', 'given_name', 'meeting', 'name', 'roles',
789+
'ticket_type', 'reg_type', 'affiliation', ]:
787790
self.assertIn(key, userinfo)
788791

789792
r = client.do_end_session_request(state=params["state"], scope=args['scope'])

ietf/ietfauth/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def scope_roles(self):
240240
info_registration = (
241241
"IETF Meeting Registration Info",
242242
"Access to public IETF meeting registration information for the current meeting. "
243-
"Includes meeting number, registration type and ticket type.",
243+
"Includes meeting number, affiliation, registration type and ticket type.",
244244
)
245245

246246
def scope_registration(self):
@@ -274,6 +274,7 @@ def scope_registration(self):
274274
'ticket_type': reg.ticket_type,
275275
# in_person, onliine, hackathon:
276276
'reg_type': reg.reg_type,
277+
'affiliation': reg.affiliation,
277278
}
278279

279280
return info

0 commit comments

Comments
 (0)