Added meeting registration 'affiliation' field to the OAuth2 'registration' scope, so that Meetecho will have the information needed build bluesheets.

- Legacy-Id: 18070
This commit is contained in:
Henrik Levkowetz 2020-06-26 19:26:28 +00:00
parent 9910d1ecf0
commit 8c90c53463
2 changed files with 8 additions and 4 deletions

View file

@ -715,7 +715,7 @@ class OpenIDConnectTests(TestCase):
# Get provider info
client.provider_config( 'http://%s/api/openid' % host)
# No registration step -- we only supported this out-of-band
# No registration step -- we only support this out-of-band
# Set shared client/provider information in the client
client_reg = RegistrationResponse( client_id= oid_client_record.client_id,
@ -727,7 +727,9 @@ class OpenIDConnectTests(TestCase):
RoleFactory(name_id='chair', person=person)
meeting = MeetingFactory(type_id='ietf', date=datetime.date.today())
MeetingRegistration.objects.create(
meeting=meeting, person=None, first_name=person.first_name(), last_name=person.last_name(), email=person.email())
meeting=meeting, person=None, first_name=person.first_name(), last_name=person.last_name(),
email=person.email(), ticket_type='full_week', reg_type='remote', affiliation='Some Company',
)
# Get access authorisation
session = {}
@ -783,7 +785,8 @@ class OpenIDConnectTests(TestCase):
# Get userinfo, check keys present
userinfo = client.do_user_info_request(state=params["state"], scope=args['scope'])
for key in [ 'email', 'family_name', 'given_name', 'meeting', 'name', 'roles', ]:
for key in [ 'email', 'family_name', 'given_name', 'meeting', 'name', 'roles',
'ticket_type', 'reg_type', 'affiliation', ]:
self.assertIn(key, userinfo)
r = client.do_end_session_request(state=params["state"], scope=args['scope'])

View file

@ -240,7 +240,7 @@ class OidcExtraScopeClaims(oidc_provider.lib.claims.ScopeClaims):
info_registration = (
"IETF Meeting Registration Info",
"Access to public IETF meeting registration information for the current meeting. "
"Includes meeting number, registration type and ticket type.",
"Includes meeting number, affiliation, registration type and ticket type.",
)
def scope_registration(self):
@ -274,6 +274,7 @@ class OidcExtraScopeClaims(oidc_provider.lib.claims.ScopeClaims):
'ticket_type': reg.ticket_type,
# in_person, onliine, hackathon:
'reg_type': reg.reg_type,
'affiliation': reg.affiliation,
}
return info