diaspora-vines 0.1.27 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vines.rb +1 -0
- data/lib/vines/stanza/dialback.rb +27 -0
- data/lib/vines/stream/server/auth_method.rb +1 -0
- data/lib/vines/stream/server/outbound/auth.rb +4 -4
- data/lib/vines/version.rb +1 -1
- metadata +51 -50
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 91735ca9844a9e2ae693c71d37e6394a4e658bfe
|
|
4
|
+
data.tar.gz: 942a2546e5dfee69ac9c8ca7eb186125e363e0b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c263a68d998e4fe7c3855d613a49d405a63c25a63fa306cedbe99d8e92178fc9c4c0e89200d5500be334f4e3dec33da815d9f342106e0ab4132774713412b4fc
|
|
7
|
+
data.tar.gz: 3c5b14198a6c2f20065b70133e8b0455b18bb3e11da9f1579414daacae694c4fc4d4965b451f4fcd7c52a99ef3f8b76b097f3d91c2a030711554e812fb6ee9e0
|
data/lib/vines.rb
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
module Vines
|
|
4
|
+
class Stanza
|
|
5
|
+
class Dialback < Stanza
|
|
6
|
+
VALID_TYPE, INVALID_TYPE = %w[valid invalid].map {|t| t.freeze }
|
|
7
|
+
NS = NAMESPACES[:legacy_dialback]
|
|
8
|
+
|
|
9
|
+
register "/db:verify", 'db' => NS
|
|
10
|
+
|
|
11
|
+
def process
|
|
12
|
+
id, from, to = %w[id from to].map {|a| @node[a] }
|
|
13
|
+
key = @node.text
|
|
14
|
+
|
|
15
|
+
outbound_stream = router.stream_by_id(id)
|
|
16
|
+
unless outbound_stream && outbound_stream.state.is_a?(Stream::Server::Outbound::AuthDialbackResult)
|
|
17
|
+
@stream.write(%Q{<db:verify from="#{to}" to="#{from}" id="#{id}" type="error"><error type="cancel"><item-not-found xmlns="#{NAMESPACES[:stanzas]}"/></error></db:verify>})
|
|
18
|
+
return
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
secret = outbound_stream.state.dialback_secret
|
|
22
|
+
type = Kit.dialback_key(secret, from, to, id) == key ? VALID_TYPE : INVALID_TYPE
|
|
23
|
+
@stream.write(%Q{<db:verify from="#{to}" to="#{from}" id="#{id}" type="#{type}"/>})
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -43,6 +43,7 @@ module Vines
|
|
|
43
43
|
begin
|
|
44
44
|
Vines::Stream::Server.start(stream.config, node[FROM], node[TO], true) do |authoritative|
|
|
45
45
|
if authoritative
|
|
46
|
+
# will be closed in outbound/authoritative.rb
|
|
46
47
|
authoritative.write("<db:verify from='#{node[TO]}' id='#{stream.id}' to='#{node[FROM]}'>#{node.text}</db:verify>")
|
|
47
48
|
end
|
|
48
49
|
end
|
|
@@ -21,10 +21,6 @@ module Vines
|
|
|
21
21
|
@success = Authoritative
|
|
22
22
|
stream.callback!
|
|
23
23
|
advance
|
|
24
|
-
elsif tls?(node)
|
|
25
|
-
@success = TLSResult
|
|
26
|
-
stream.write("<starttls xmlns='#{NAMESPACES[:tls]}'/>")
|
|
27
|
-
advance
|
|
28
24
|
elsif dialback?(node)
|
|
29
25
|
secret = Kit.auth_token
|
|
30
26
|
dialback_key = Kit.dialback_key(secret, stream.remote_domain, stream.domain, stream.id)
|
|
@@ -33,6 +29,10 @@ module Vines
|
|
|
33
29
|
advance
|
|
34
30
|
stream.router << stream # We need to be discoverable for the dialback connection
|
|
35
31
|
stream.state.dialback_secret = secret
|
|
32
|
+
elsif tls?(node)
|
|
33
|
+
@success = TLSResult
|
|
34
|
+
stream.write("<starttls xmlns='#{NAMESPACES[:tls]}'/>")
|
|
35
|
+
advance
|
|
36
36
|
else
|
|
37
37
|
raise StreamErrors::NotAuthorized
|
|
38
38
|
end
|
data/lib/vines/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: diaspora-vines
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.28
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Graham
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-
|
|
12
|
+
date: 2015-08-19 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bcrypt
|
|
@@ -135,14 +135,14 @@ dependencies:
|
|
|
135
135
|
requirements:
|
|
136
136
|
- - "~>"
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: '5.
|
|
138
|
+
version: '5.8'
|
|
139
139
|
type: :development
|
|
140
140
|
prerelease: false
|
|
141
141
|
version_requirements: !ruby/object:Gem::Requirement
|
|
142
142
|
requirements:
|
|
143
143
|
- - "~>"
|
|
144
144
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: '5.
|
|
145
|
+
version: '5.8'
|
|
146
146
|
- !ruby/object:Gem::Dependency
|
|
147
147
|
name: rake
|
|
148
148
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -201,6 +201,7 @@ files:
|
|
|
201
201
|
- lib/vines/node.rb
|
|
202
202
|
- lib/vines/router.rb
|
|
203
203
|
- lib/vines/stanza.rb
|
|
204
|
+
- lib/vines/stanza/dialback.rb
|
|
204
205
|
- lib/vines/stanza/iq.rb
|
|
205
206
|
- lib/vines/stanza/iq/auth.rb
|
|
206
207
|
- lib/vines/stanza/iq/disco_info.rb
|
|
@@ -364,70 +365,70 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
364
365
|
version: '0'
|
|
365
366
|
requirements: []
|
|
366
367
|
rubyforge_project:
|
|
367
|
-
rubygems_version: 2.4.
|
|
368
|
+
rubygems_version: 2.4.8
|
|
368
369
|
signing_key:
|
|
369
370
|
specification_version: 4
|
|
370
371
|
summary: Diaspora-vines is a Vines fork build for diaspora integration.
|
|
371
372
|
test_files:
|
|
372
|
-
- test/error_test.rb
|
|
373
|
-
- test/test_helper.rb
|
|
374
|
-
- test/storage/local_test.rb
|
|
375
|
-
- test/storage/mock_redis.rb
|
|
376
|
-
- test/storage/sql_schema.rb
|
|
377
|
-
- test/storage/sql_test.rb
|
|
378
|
-
- test/storage/null_test.rb
|
|
379
|
-
- test/storage/storage_tests.rb
|
|
380
373
|
- test/ext/nokogiri.rb
|
|
374
|
+
- test/router_test.rb
|
|
381
375
|
- test/contact_test.rb
|
|
382
|
-
- test/
|
|
383
|
-
- test/
|
|
384
|
-
- test/
|
|
385
|
-
- test/
|
|
386
|
-
- test/
|
|
387
|
-
- test/
|
|
388
|
-
- test/
|
|
389
|
-
- test/
|
|
390
|
-
- test/
|
|
376
|
+
- test/stanza/iq_test.rb
|
|
377
|
+
- test/stanza/presence/subscribe_test.rb
|
|
378
|
+
- test/stanza/presence/probe_test.rb
|
|
379
|
+
- test/stanza/pubsub/unsubscribe_test.rb
|
|
380
|
+
- test/stanza/pubsub/subscribe_test.rb
|
|
381
|
+
- test/stanza/pubsub/create_test.rb
|
|
382
|
+
- test/stanza/pubsub/delete_test.rb
|
|
383
|
+
- test/stanza/pubsub/publish_test.rb
|
|
384
|
+
- test/stanza/message_test.rb
|
|
385
|
+
- test/stanza/iq/version_test.rb
|
|
386
|
+
- test/stanza/iq/private_storage_test.rb
|
|
387
|
+
- test/stanza/iq/session_test.rb
|
|
388
|
+
- test/stanza/iq/disco_info_test.rb
|
|
389
|
+
- test/stanza/iq/vcard_test.rb
|
|
390
|
+
- test/stanza/iq/disco_items_test.rb
|
|
391
|
+
- test/stanza/iq/roster_test.rb
|
|
391
392
|
- test/stream/sasl_test.rb
|
|
392
|
-
- test/stream/
|
|
393
|
+
- test/stream/parser_test.rb
|
|
393
394
|
- test/stream/http/start_test.rb
|
|
395
|
+
- test/stream/http/sessions_test.rb
|
|
396
|
+
- test/stream/http/request_test.rb
|
|
394
397
|
- test/stream/http/ready_test.rb
|
|
395
398
|
- test/stream/http/auth_test.rb
|
|
396
|
-
- test/stream/http/request_test.rb
|
|
397
399
|
- test/stream/component/start_test.rb
|
|
398
400
|
- test/stream/component/ready_test.rb
|
|
399
401
|
- test/stream/component/handshake_test.rb
|
|
400
|
-
- test/stream/
|
|
401
|
-
- test/stream/
|
|
402
|
-
- test/stream/
|
|
402
|
+
- test/stream/client/session_test.rb
|
|
403
|
+
- test/stream/client/ready_test.rb
|
|
404
|
+
- test/stream/client/auth_test.rb
|
|
403
405
|
- test/stream/server/auth_method_test.rb
|
|
406
|
+
- test/stream/server/outbound/authoritative_test.rb
|
|
404
407
|
- test/stream/server/outbound/start_test.rb
|
|
408
|
+
- test/stream/server/outbound/auth_test.rb
|
|
405
409
|
- test/stream/server/outbound/auth_restart_test.rb
|
|
406
410
|
- test/stream/server/outbound/auth_external_test.rb
|
|
407
|
-
- test/stream/server/outbound/auth_test.rb
|
|
408
411
|
- test/stream/server/outbound/auth_dialback_result_test.rb
|
|
409
|
-
- test/stream/server/
|
|
410
|
-
- test/
|
|
411
|
-
- test/
|
|
412
|
-
- test/
|
|
413
|
-
- test/
|
|
414
|
-
- test/
|
|
415
|
-
- test/
|
|
416
|
-
- test/
|
|
417
|
-
- test/
|
|
418
|
-
- test/stanza/pubsub/create_test.rb
|
|
419
|
-
- test/stanza/pubsub/unsubscribe_test.rb
|
|
420
|
-
- test/stanza/pubsub/subscribe_test.rb
|
|
421
|
-
- test/stanza/iq_test.rb
|
|
422
|
-
- test/stanza/iq/roster_test.rb
|
|
423
|
-
- test/stanza/iq/vcard_test.rb
|
|
424
|
-
- test/stanza/iq/disco_info_test.rb
|
|
425
|
-
- test/stanza/iq/private_storage_test.rb
|
|
426
|
-
- test/stanza/iq/session_test.rb
|
|
427
|
-
- test/stanza/iq/version_test.rb
|
|
428
|
-
- test/stanza/iq/disco_items_test.rb
|
|
429
|
-
- test/jid_test.rb
|
|
430
|
-
- test/stanza_test.rb
|
|
412
|
+
- test/stream/server/start_test.rb
|
|
413
|
+
- test/stream/server/ready_test.rb
|
|
414
|
+
- test/stream/server/auth_test.rb
|
|
415
|
+
- test/storage/storage_tests.rb
|
|
416
|
+
- test/storage/sql_schema.rb
|
|
417
|
+
- test/storage/sql_test.rb
|
|
418
|
+
- test/storage/local_test.rb
|
|
419
|
+
- test/storage/null_test.rb
|
|
420
|
+
- test/storage/mock_redis.rb
|
|
431
421
|
- test/config/host_test.rb
|
|
432
422
|
- test/config/pubsub_test.rb
|
|
423
|
+
- test/token_bucket_test.rb
|
|
424
|
+
- test/jid_test.rb
|
|
433
425
|
- test/kit_test.rb
|
|
426
|
+
- test/cluster/publisher_test.rb
|
|
427
|
+
- test/cluster/sessions_test.rb
|
|
428
|
+
- test/cluster/subscriber_test.rb
|
|
429
|
+
- test/stanza_test.rb
|
|
430
|
+
- test/test_helper.rb
|
|
431
|
+
- test/error_test.rb
|
|
432
|
+
- test/store_test.rb
|
|
433
|
+
- test/config_test.rb
|
|
434
|
+
- test/user_test.rb
|