inveniosoftware / invenio-records-rest

Invenio records REST API module.
https://invenio-records-rest.readthedocs.io
MIT License
4 stars 63 forks source link

Component: authentication on resource list get action #215

Closed ppanero closed 6 years ago

ppanero commented 6 years ago

Make the GET operation over the RecordsListResource require authentication, under `allow_all by default to maintain the current behaviour.

Signed-off-by: Pablo Panero pablo.panero@cern.ch

ppanero commented 6 years ago

Tests are failing due to:

self = <sqlalchemy.engine.base.Connection object at 0x7f284429bcd0>
    def _revalidate_connection(self):
        if self.__branch_from:
            return self.__branch_from._revalidate_connection()
        if self.__can_reconnect and self.__invalid:
            if self.__transaction is not None:
                raise exc.InvalidRequestError(
                    "Can't reconnect until invalid "
                    "transaction is rolled back")
            self.__connection = self.engine.raw_connection(_connection=self)
            self.__invalid = False
            return self.__connection
>       raise exc.ResourceClosedError("This Connection is closed")

Known issue (https://github.com/kvesteri/sqlalchemy-continuum/issues/188), need to pin 'SQLAlchemy-Continuum==1.3.4', but did not want to enforce it on this PR.

ppanero commented 6 years ago

Tests should pass when https://github.com/inveniosoftware/invenio-db/pull/111 is merged