Exemplo n.º 1
0
def factory(msgtype):
    for name, obj in inspect.getmembers(sys.modules[__name__]):
        if inspect.isclass(obj) and issubclass(obj, Message):
            try:
                if obj.__name__ == msgtype:
                    return obj
            except AttributeError:
                pass

    # Fall back to basic OAuth2 messages
    return message.factory(msgtype)
Exemplo n.º 2
0
def factory(msgtype):
    for name, obj in inspect.getmembers(sys.modules[__name__]):
        if inspect.isclass(obj) and issubclass(obj, Message):
            try:
                if obj.__name__ == msgtype:
                    return obj
            except AttributeError:
                pass

    # Fall back to basic OAuth2 messages
    return message.factory(msgtype)
Exemplo n.º 3
0
def factory(msgtype):
    for name, obj in inspect.getmembers(sys.modules[__name__]):
        if inspect.isclass(obj) and issubclass(obj, Message):
            try:
                if obj.__name__ == msgtype:
                    return obj
            except AttributeError:
                pass

    # check among standard OAuth2 messages
    from oic.oauth2 import message

    return message.factory(msgtype)
Exemplo n.º 4
0
def factory(msgtype):
    warnings.warn("`factory` is deprecated. Use `OIDCMessageFactory` instead.",
                  DeprecationWarning)
    for _, obj in inspect.getmembers(sys.modules[__name__]):
        if inspect.isclass(obj) and issubclass(obj, Message):
            try:
                if obj.__name__ == msgtype:
                    return obj
            except AttributeError:
                pass

    # Fall back to basic OAuth2 messages
    return message.factory(msgtype)
Exemplo n.º 5
0
def factory(msgtype):
    try:
        return MSG[msgtype]
    except KeyError:
        return message.factory(msgtype)
Exemplo n.º 6
0
def factory(msgtype):
    try:
        return MSG[msgtype]
    except KeyError:
        return message.factory(msgtype)