Class: Zm::Client::SoapAccountConnector
Constant Summary
Zm::Client::SoapBaseConnector::BASESPACE, Zm::Client::SoapBaseConnector::HTTP_HEADERS
Instance Attribute Summary
#context
Attributes included from ZmLogger
#logger, #logger_file_path, #logger_level
Class Method Summary
collapse
Instance Method Summary
collapse
#http_client!, #invoke, #target_invoke, #verbose!
Methods included from ZmLogger
#init_logger
Constructor Details
Returns a new instance of SoapAccountConnector.
Class Method Details
.create(config) ⇒ Object
10
11
12
13
14
15
16
17
18
|
# File 'lib/zm/client/connector/soap_account.rb', line 10
def create(config)
trans = new(
config.zimbra_public_scheme,
config.zimbra_public_host,
config.zimbra_public_port
)
trans.logger = config.logger
trans
end
|
Instance Method Details
#auth_password(content, by, password) ⇒ Object
#auth_preauth(content, by, expires, domainkey) ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/zm/client/connector/soap_account.rb', line 33
def auth_preauth(content, by, expires, domainkey)
ts = (Time.now.to_i * 1000)
preauth = compute_preauth(content, by, ts, expires, domainkey)
soap_request = SoapElement.account(SoapAccountConstants::AUTH_REQUEST)
node_account = SoapElement.create(SoapConstants::ACCOUNT).add_attribute(SoapConstants::BY,
by).add_content(content)
soap_request.add_node(node_account)
node_preauth = SoapElement.create(SoapConstants::PREAUTH).add_attribute(SoapConstants::TIMESTAMP,
ts).add_content(preauth)
soap_request.add_node(node_preauth)
do_login(soap_request)
end
|
#do_login(soap_request) ⇒ Object
58
59
60
|
# File 'lib/zm/client/connector/soap_account.rb', line 58
def do_login(soap_request)
invoke(soap_request)[:AuthResponse][:authToken].first[:_content]
end
|
#token ⇒ Object
21
22
23
|
# File 'lib/zm/client/connector/soap_account.rb', line 21
def token
context.to_hash[:authToken]
end
|
#token=(value) ⇒ Object
25
26
27
|
# File 'lib/zm/client/connector/soap_account.rb', line 25
def token=(value)
context.token(value)
end
|