- add a new disallow_redirect parameter, that makes urlFetcher.download() to return an error in case of URL redirects - enable disallow_redirect when downloading repository data (RepoInterface.run_sync()) - avoid to return an error if urlFetcher.download() fails due to issues with our custom User-Agent when downloading from HTTP Entropy/Socket Services: - create a parent class SocketCommandsSkel which acts as skeleton to any SocketHostInterface command class, this avoids having to declare register() matching a proper signature not even documented (until this commit) - some slight fixes/updates in the BasicPamAuthenticator class, change docmd_userdata() API removing unneeded parameters - make BuiltInCommands class a subclass of SocketCommandsSkel and remove register() since it's now inherited - get_new_session() now creates 4 more keys in the session dictionary for easy reference: admin, moderator, user, developer indicating the post-authentication user level Entropy/phpbb3Authenticator: - update API to reflect the changes in SocketHostInterface Entropy/Repository Services interface: - add a new commands class (phpbb3Commands) that can be used to extend functionalities when using the phpbb3 authenticator Entropy/Electron: - more preliminary work on the login and widgets Entropy/RepositoryCommands: - make it a subclass of SocketCommandsSkel too Entropy/RepositorySocketServerInterface: - make external_cmd_classes keyword argument to work correctly - update get_logged_user_data() to reflect changes in server API - add 3 new functions (self explanatory): is_administrator(), is_moderator(), is_developer(), is_user() git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@2248 cd1c1023-2f26-0410-ae45-c471fc1f0318
22 lines
997 B
Plaintext
22 lines
997 B
Plaintext
import sys
|
|
sys.path.insert(0,'../libraries')
|
|
from entropy import RepositorySocketClientInterface, EntropyRepositorySocketClientCommands, EquoInterface
|
|
from entropyConstants import *
|
|
repository = 'sabayonlinux.org'
|
|
Entropy = EquoInterface()
|
|
dburl = etpRepositories[repository]['plain_database'].split("/")[2]
|
|
port = etpRepositories[repository]['service_port']
|
|
|
|
ssl_ca_cert = "/etc/entropy/certs/sabayonlinux.org.crt"
|
|
ssl_cert = "/etc/entropy/certs/sabayonlinux.org.server.crt"
|
|
eapi3_socket = RepositorySocketClientInterface(Entropy, EntropyRepositorySocketClientCommands, ssl = True)# , server_ca_cert = ssl_ca_cert, server_cert = ssl_cert)
|
|
eapi3_socket.connect(dburl, port+1)
|
|
|
|
username = 'lxnay'
|
|
password = 'xxxx'
|
|
session_id = eapi3_socket.open_session()
|
|
print "logged in?",eapi3_socket.CmdInterface.service_login(username, password, session_id)
|
|
print "logging out...",eapi3_socket.CmdInterface.service_logout(username, session_id)
|
|
eapi3_socket.close_session(session_id)
|
|
eapi3_socket.disconnect()
|