mixin_bot 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mixin_bot/api/auth.rb +3 -3
- data/lib/mixin_bot/cli/api.rb +3 -4
- data/lib/mixin_bot/version.rb +1 -1
- data/lib/mvm/registry.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf2e7ef08c38a52d5d31ce1be5a0531f13680e31cb5e7f11cd6e1582436d8711
|
4
|
+
data.tar.gz: '08cfa89514d3f102cdd064cfb3c3367cf2166292a3abc854481320a2fb610d15'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5f7af8574ea545b899bd2081923dd75e0b2ef2288346fb8e8d842b642ef596c626370d9a5140a695c267db4281e4c51239cce2d55f5edb87ed33127c76c379b
|
7
|
+
data.tar.gz: b2393b4a392ff025b0e6d58c545018bd4cafb26e9fb130bba8938e42d4850a6f2b5d0244d887f6dae8d8f53fcb000819737ea71d999add7e175637c7e2d591d1
|
data/lib/mixin_bot/api/auth.rb
CHANGED
@@ -56,7 +56,7 @@ module MixinBot
|
|
56
56
|
def authorize_code(**kwargs)
|
57
57
|
path = '/oauth/authorize'
|
58
58
|
data = authorization_data(
|
59
|
-
kwargs[:user_id],
|
59
|
+
kwargs[:user_id],
|
60
60
|
kwargs[:scope] || ['PROFILE:READ']
|
61
61
|
)
|
62
62
|
|
@@ -77,7 +77,7 @@ module MixinBot
|
|
77
77
|
@_scope = scope.join(' ')
|
78
78
|
EM.run do
|
79
79
|
start_blaze_connect do
|
80
|
-
def on_open(ws,
|
80
|
+
def on_open(ws, _event)
|
81
81
|
ws.send write_ws_message(
|
82
82
|
action: 'REFRESH_OAUTH_CODE',
|
83
83
|
params: {
|
@@ -95,7 +95,7 @@ module MixinBot
|
|
95
95
|
ws.close
|
96
96
|
end
|
97
97
|
|
98
|
-
def on_close(
|
98
|
+
def on_close(_ws, _event)
|
99
99
|
EM.stop_event_loop
|
100
100
|
end
|
101
101
|
end
|
data/lib/mixin_bot/cli/api.rb
CHANGED
@@ -52,17 +52,16 @@ module MixinBot
|
|
52
52
|
|
53
53
|
desc 'authcode', 'code to authorize other mixin account'
|
54
54
|
option :keystore, type: :string, aliases: '-k', required: true, desc: 'keystore or keystore.json file path'
|
55
|
-
option :client_id, type: :string, required: true, aliases: '-c', desc:
|
55
|
+
option :client_id, type: :string, required: true, aliases: '-c', desc: 'client_id of bot to authorize'
|
56
56
|
option :scope, type: :array, default: ['PROFILE:READ'], aliases: '-s', desc: 'scope to authorize'
|
57
|
-
option :pin, type: :string, required: true, aliases: '-p', desc: 'pin'
|
58
57
|
def authcode
|
59
58
|
res = {}
|
60
|
-
CLI::UI::Spinner.spin(
|
59
|
+
CLI::UI::Spinner.spin('POST /oauth/authorize') do |_spinner|
|
61
60
|
res =
|
62
61
|
api_instance.authorize_code(
|
63
62
|
user_id: options[:client_id],
|
64
63
|
scope: options[:scope],
|
65
|
-
pin:
|
64
|
+
pin: keystore['pin']
|
66
65
|
)
|
67
66
|
end
|
68
67
|
log res['data']
|
data/lib/mixin_bot/version.rb
CHANGED
data/lib/mvm/registry.rb
CHANGED
@@ -11,7 +11,7 @@ module MVM
|
|
11
11
|
|
12
12
|
def pid
|
13
13
|
hex = @rpc.call(@registry, 'PID').to_s(16)
|
14
|
-
MixinBot::Utils::UUID.new(hex:hex).unpacked
|
14
|
+
MixinBot::Utils::UUID.new(hex: hex).unpacked
|
15
15
|
end
|
16
16
|
|
17
17
|
def version
|
@@ -20,7 +20,7 @@ module MVM
|
|
20
20
|
|
21
21
|
def asset_from_contract(contract)
|
22
22
|
hex = @rpc.call(@registry, 'assets', contract).to_s(16)
|
23
|
-
MixinBot::Utils::UUID.new(hex:hex).unpacked
|
23
|
+
MixinBot::Utils::UUID.new(hex: hex).unpacked
|
24
24
|
end
|
25
25
|
|
26
26
|
def users_from_contract(contract)
|