google-oauth-cli 0 → 0.1.0
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/.rubocop.yml +6 -7
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -17
- data/Rakefile +1 -5
- data/lib/google-oauth-cli/server.rb +1 -0
- data/lib/google-oauth-cli/version.rb +1 -1
- data/lib/google-oauth-cli.rb +10 -1
- metadata +6 -7
- data/.rspec +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee18c4c8bf054e4a04d18b104b22c72e0360355864e2090361f1f520c1bf95f6
|
4
|
+
data.tar.gz: 6ee8403f8a338e57c7dc199fbc50580577b711b100b651f2f3e0027dd9b07c91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ecfed6455a9a51e70ff931ae78c9e0d1ad20fe65d0d87774b0cd37690b6cefb6b140f495215eb88d5994aea157cf6846b7c12193f33d3c3899528f196194a37
|
7
|
+
data.tar.gz: d2693bb74664c645a7ef5ea7d421847a95ab51f6ccd51076278191c07a8d7ebee231843db0ec7571b24504138ca2ccfe386d468feac0177f6b963fc653ecfddd
|
data/.rubocop.yml
CHANGED
@@ -13,13 +13,12 @@ Style/StringLiteralsInInterpolation:
|
|
13
13
|
Style/Documentation:
|
14
14
|
Enabled: false
|
15
15
|
|
16
|
+
Layout/LineLength:
|
17
|
+
Max: 120
|
18
|
+
|
19
|
+
Metrics/MethodLength:
|
20
|
+
Max: 30
|
21
|
+
|
16
22
|
Naming/FileName:
|
17
23
|
Exclude:
|
18
24
|
- 'lib/google-oauth-cli.rb'
|
19
|
-
- 'spec/google-oauth-cli_spec.rb'
|
20
|
-
|
21
|
-
Metrics/BlockLength:
|
22
|
-
Max: 28
|
23
|
-
|
24
|
-
Metrics/MethodLength:
|
25
|
-
Max: 15
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
google-oauth-cli (0)
|
4
|
+
google-oauth-cli (0.1.0)
|
5
5
|
googleauth (~> 1.5)
|
6
6
|
launchy (~> 2.5)
|
7
7
|
|
@@ -11,7 +11,6 @@ GEM
|
|
11
11
|
addressable (2.8.3)
|
12
12
|
public_suffix (>= 2.0.2, < 6.0)
|
13
13
|
ast (2.4.2)
|
14
|
-
diff-lcs (1.5.0)
|
15
14
|
faraday (2.7.4)
|
16
15
|
faraday-net_http (>= 2.0, < 3.1)
|
17
16
|
ruby2_keywords (>= 0.0.4)
|
@@ -38,19 +37,6 @@ GEM
|
|
38
37
|
rake (13.0.6)
|
39
38
|
regexp_parser (2.7.0)
|
40
39
|
rexml (3.2.5)
|
41
|
-
rspec (3.12.0)
|
42
|
-
rspec-core (~> 3.12.0)
|
43
|
-
rspec-expectations (~> 3.12.0)
|
44
|
-
rspec-mocks (~> 3.12.0)
|
45
|
-
rspec-core (3.12.1)
|
46
|
-
rspec-support (~> 3.12.0)
|
47
|
-
rspec-expectations (3.12.2)
|
48
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
49
|
-
rspec-support (~> 3.12.0)
|
50
|
-
rspec-mocks (3.12.5)
|
51
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
52
|
-
rspec-support (~> 3.12.0)
|
53
|
-
rspec-support (3.12.0)
|
54
40
|
rubocop (1.49.0)
|
55
41
|
json (~> 2.3)
|
56
42
|
parallel (~> 1.10)
|
@@ -74,12 +60,10 @@ GEM
|
|
74
60
|
|
75
61
|
PLATFORMS
|
76
62
|
arm64-darwin-22
|
77
|
-
x86_64-linux
|
78
63
|
|
79
64
|
DEPENDENCIES
|
80
65
|
google-oauth-cli!
|
81
66
|
rake (~> 13.0)
|
82
|
-
rspec (~> 3.12)
|
83
67
|
rubocop (~> 1.21)
|
84
68
|
|
85
69
|
BUNDLED WITH
|
data/Rakefile
CHANGED
data/lib/google-oauth-cli.rb
CHANGED
@@ -52,7 +52,7 @@ class GoogleOAuthCli
|
|
52
52
|
raise(Error, "Attempted to open #{uri} and failed because #{exception}")
|
53
53
|
end
|
54
54
|
|
55
|
-
credentials.code =
|
55
|
+
credentials.code = start_server_and_receive_code(state)
|
56
56
|
fetch_and_save_token!
|
57
57
|
|
58
58
|
credentials
|
@@ -62,4 +62,13 @@ class GoogleOAuthCli
|
|
62
62
|
credentials.fetch_access_token!
|
63
63
|
credentials_file&.write({ refresh_token: credentials.refresh_token }.to_json)
|
64
64
|
end
|
65
|
+
|
66
|
+
def start_server_and_receive_code(state)
|
67
|
+
server = Thread.new do
|
68
|
+
Thread.current.report_on_exception = false
|
69
|
+
Server.new(port: port, state: state).start
|
70
|
+
end
|
71
|
+
server.join
|
72
|
+
server.value
|
73
|
+
end
|
65
74
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-oauth-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Fujiki
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: googleauth
|
@@ -47,7 +47,6 @@ executables: []
|
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
|
-
- ".rspec"
|
51
50
|
- ".rubocop.yml"
|
52
51
|
- CHANGELOG.md
|
53
52
|
- Gemfile
|
@@ -68,7 +67,7 @@ metadata:
|
|
68
67
|
homepage_uri: https://github.com/fujikky/google-oauth-cli
|
69
68
|
source_code_uri: https://github.com/fujikky/google-oauth-cli
|
70
69
|
changelog_uri: https://github.com/fujikky/google-oauth-cli/tree/main/CHANGELOG
|
71
|
-
post_install_message:
|
70
|
+
post_install_message:
|
72
71
|
rdoc_options: []
|
73
72
|
require_paths:
|
74
73
|
- lib
|
@@ -83,8 +82,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
82
|
- !ruby/object:Gem::Version
|
84
83
|
version: '0'
|
85
84
|
requirements: []
|
86
|
-
rubygems_version: 3.4.
|
87
|
-
signing_key:
|
85
|
+
rubygems_version: 3.4.1
|
86
|
+
signing_key:
|
88
87
|
specification_version: 4
|
89
88
|
summary: Library for Google OAuth authentication from CLI
|
90
89
|
test_files: []
|
data/.rspec
DELETED