Skip to content

Unknown attribute causes exception #9

@mqgmaster

Description

@mqgmaster

The following lines causes an exception when a unknown attribute is received from server.

        """
        Add an item to attributes (by name or id)
        """
        try:
            code, name = self.__getkeys(key)
        except KeyError:
            raise ValueError('Invalid radius attribute: %s' % key)
        values = self.get(code, [])
        values.append(value)
        UserDict.__setitem__(self, code, values)

The correct, in my opinion, is log a warning and continue the authentication. That lib does not need to validate the attributes, this is responsibility of the application using py-radius.

        try:
            code, name = self.__getkeys(key)
            values = self.get(code, [])
            values.append(value)
            UserDict.__setitem__(self, code, values)
        except KeyError:
            LOGGER.warning('Invalid radius attribute: %s' % key)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions