#496: BibUpload: /sendforaudit REST hook for public consumption
--------------------------+----------------------
Reporter: jblayloc | Owner:
Type: enhancement | Status: assigned
Priority: major | Milestone:
Component: BibUpload | Version:
Resolution: | Keywords: INSPIRE
--------------------------+----------------------
Changes (by simko):
* status: in_merge => assigned
Comment:
1) It looks like `/sendforaudit` is essentially identical to
`/robotupload` except for uploading into the holding pen and for the
email notification. We could express this closeness by choosing
closer URI names, but why not to take the existing `/robotupload`
facility and generalize it a bit to fit the new requirements?
For example, we can take `/robotupload` and allow to specify
optionally which are permitted upload modes and which are desired
email notification addresses. Here is one such illustrative example:
{{{
CFG_BATCHUPLOADER_WEB_ROBOT_RIGHTS = {
'10.0.0.1': [['BOOK', 'REPORT'], ['*'], ['[email protected]']],
'10.0.0.2': [['POETRY'], ['-r', '-a'] , []],
'*': [['*'], ['-o'], ['[email protected]', '[email protected]']]
}
}}}
We can even take advantage of Python's dynamic typing and respect the
old syntax: if the value is a list of lists, then we have the new
configuration style, containing permitted collections, permitted
upload modes, and desired email alert addresses; otherwise we have the
old configuration style, containing just permitted collections (and
allowing all upload modes and no alert address for compatibility's
sake).
This should work for Mike's purposes, I hope. If so, I'd prefer it
over offering yet another look-alike API service.
2) The new function `well_formed()` in `mailutils.py` can be useful
for many purposes, so it is of API-like nature WRT other modules. As
such, it is named in a too generic way. We should rather name it like
`email_address_valid_p()` or `is_email_address_valid()`. This will
give better coherency with similarly named `foo_p()` or `is_foo()`
API-like functions that already exist in our codebase. Generally
speaking I like API symbol names that are self-understandable even
without context, which is nice for readability and for global
`git grep` operations and the like.
However, the `well_formed()` function grabbed my attention also for
another reason. Its implementation was apparently borrowed from an
existing code that is licensed under Creative Commons Attribution
ShareAlike 2.5. Firstly, the borrowing should be acknowledged in the
THANKS file. Secondly, I'm afraid we may not be able to take this
code, because CC-BY-SA is apparently incompatible with GNU GPL
[[http://www.gnu.org/licenses/license-list.html]]. Can you please
double check and use something else?
(BTW we do have a similar license cleaning issue in the codebase
already...)
--
Ticket URL: <http://invenio-software.org/ticket/496#comment:2>
Invenio <http://invenio-software.org>