← Back
Editing: sreg.cpython-311.pyc
� QT�^�E � � � d Z ddlmZmZ ddlmZ ddlZ ej e� � Z e n# e$ r e e fZ Y nw xY wg d�Zdddd d ddd dd� Z d� ZdZdZeZ eed� � n9# e$ r1Ze � de�dd�d e e� � ��� � Y dZ[ndZ[ww xY wd� Z G d� de� � Zd� Z G d� de� � Z G d� de� � ZdS )a� Simple registration request and response parsing and object representation This module contains objects representing simple registration requests and responses that can be used with both OpenID relying parties and OpenID providers. 1. The relying party creates a request object and adds it to the C{L{AuthRequest<openid.consumer.consumer.AuthRequest>}} object before making the C{checkid_} request to the OpenID provider:: auth_request.addExtension(SRegRequest(required=['email'])) 2. The OpenID provider extracts the simple registration request from the OpenID request using C{L{SRegRequest.fromOpenIDRequest}}, gets the user's approval and data, creates a C{L{SRegResponse}} object and adds it to the C{id_res} response:: sreg_req = SRegRequest.fromOpenIDRequest(checkid_request) # [ get the user's approval and data, informing the user that # the fields in sreg_response were requested ] sreg_resp = SRegResponse.extractResponse(sreg_req, user_data) sreg_resp.toMessage(openid_response.fields) 3. The relying party uses C{L{SRegResponse.fromSuccessResponse}} to extract the data from the OpenID response:: sreg_resp = SRegResponse.fromSuccessResponse(success_response) @since: 2.0 @var sreg_data_fields: The names of the data fields that are listed in the sreg spec, and a description of them in English @var sreg_uri: The preferred URI to use for the simple registration namespace and XRD Type value � )�registerNamespaceAlias�NamespaceAliasRegistrationError)� ExtensionN)�SRegRequest�SRegResponse�data_fields�ns_uri� ns_uri_1_0� ns_uri_1_1�supportsSRegz Full Name�Nicknamez Date of BirthzE-mail Address�GenderzPostal Code�Country�Languagez Time Zone) �fullname�nickname�dob�email�gender�postcode�country�language�timezonec �<