Beispiel #1
0
def request_individual_signature(project_id,
                                 user_id,
                                 return_url_type,
                                 return_url=None,
                                 request=None):
    """
    Handle POST request to send ICLA signature request to user.
    :param project_id: The project to sign for.
    :type project_id: string
    :param user_id: The ID of the user that will sign.
    :type user_id: string
    :param return_url_type: Refers to the return url provider type: Gerrit or Github
    :type return_url_type: string
    :param return_url: The URL to return the user to after signing is complete.
    :type return_url: string
    :param request: The Falcon Request object.
    :type request: object
    """
    signing_service = get_signing_service()
    if return_url_type == "Gerrit":
        return signing_service.request_individual_signature_gerrit(
            str(project_id), str(user_id), return_url)
    elif return_url_type == "Github":
        # fetching the primary for the account
        github = get_repository_service("github")
        primary_user_email = github.get_primary_user_email(request)
        return signing_service.request_individual_signature(
            str(project_id),
            str(user_id),
            return_url,
            preferred_email=primary_user_email)
Beispiel #2
0
def user_oauth2_callback(code, state, request):
    github = get_repository_service('github')
    return github.oauth2_redirect(state, code, request)