Description
I do have some problems using xmlrpc on a restricted wiki. It looks like applyAuthToken fails
wikiconfig.py has these lines
actions_excluded = [] acl_rights_default = u"TestUser:read,write,delete,revert,admin"
I do have created a user TestUser and a TestPage on my wiki.
1 #!/usr/bin/env python
2 # -*- coding: iso-8859-1 -*-
3 import xmlrpclib
4 from MoinMoin.request import request_cli
5
6 name = u"TestUser"
7 pagename = u'TestPage'
8 password = u"the_secret_password"
9 wikiurl = "http://localhost:8080"
10 homewiki = xmlrpclib.ServerProxy(wikiurl + "?action=xmlrpc2",
11 allow_none=True)
12 auth_token = homewiki.getAuthToken(name, password)
13 print auth_token
14 dummy = homewiki.applyAuthToken(auth_token)
15 print dummy
16 attachname = 'beispiel.txt'
17 text = file(attachname, 'rb+').read()
18 data = xmlrpclib.Binary(text)
19 homewiki.putAttachment(pagename, attachname, data)
result
fho...
SUCCESS
xmlrpclib.Fault: <Fault 1: 'You are not allowed to read this page.'>
Additional script for testing the user
result
True
Steps to reproduce
see above
Example
see above
Component selection
- general
Details
MoinMoin Version |
1.6.0beta1 |
OS and Version |
|
Python Version |
|
Server Setup |
|
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
|
Workaround
Discussion
Looks like the first script does not need request. But you need to do the xmlrpc calls in a single multicall. The first script looks incomplete (what triggers the fault?).
yeah, thats it
This isn't a bug, you need to use multiCall when using authentication. When you call putAttachment there are no credentials in the request so it fails. Multicall sends the auth token and attachment together in one xmlrpc request.
Plan
- Priority:
- Assigned to:
- Status: