Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email notifications via paster plugin post erroneously demands authentication #1767

Merged
merged 3 commits into from
Jul 24, 2014

Conversation

vitorbaptista
Copy link
Contributor

When calling

echo '{}' | /usr/lib/ckan/default/bin/paster --plugin=ckan post -c /etc/ckan/default.ini /api/action/send_email_notifications

the following error is returned:

Error - <type 'exceptions.Exception'>: Action function
send_email_notifications did not call its auth function


<title>Server Error</title>


Server Error


An internal server error occurred

However, when called using curl, auth-key set in header and empty json {}, the action succeeds.

@vitorbaptista
Copy link
Contributor

FYI, the send_email_notifications action isn't supposed to be calling the auth functions when being called through paster anyway, so this sounds like a bug in the code that guarantees that action functions call auth functions (https://github.com/ckan/ckan/blob/master/ckan/logic/action/update.py#L1074-L1078)

@vitorbaptista
Copy link
Contributor

As per @the42's email, this error was on CKAN 2.2a

The problem is that our validators notice that .send_email_notifications()
didn't call its auth functions and raise an Exception. But it shouldn't call
it's auth functions when being called with paster anyway, so it's correct.

This fixes that.
@vitorbaptista vitorbaptista removed their assignment Jun 16, 2014
@vitorbaptista
Copy link
Contributor

This is ready for review. @the42, if you have some time, could you test if this branch fixes your issue?

@wardi wardi assigned vitorbaptista and joetsoi and unassigned vitorbaptista Jun 17, 2014
@the42
Copy link
Author

the42 commented Jun 18, 2014

Sorry, currently running short on time and helped myself out by calling the API with curl and an API-key in ctrontab.

Conflicts:
	ckan/new_tests/logic/action/test_update.py
@joetsoi joetsoi merged commit 6cf1f71 into master Jul 24, 2014
@joetsoi joetsoi deleted the 1767-send-email-notifications-with-paster branch July 24, 2014 09:42
vitorbaptista added a commit that referenced this pull request Jul 28, 2014
The problem is that our validators notice that .send_email_notifications()
didn't call its auth functions and raise an Exception. But it shouldn't call
it's auth functions when being called with paster anyway, so it's correct.

This fixes that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants