Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit 12b58e2

Browse files
authored
Auth fix (#141)
* Skip 2FA enable prompt for accounts that did not yet enable it * Update rubocop to support Ruby 2.6
1 parent 2ec4645 commit 12b58e2

File tree

5 files changed

+140
-61
lines changed

5 files changed

+140
-61
lines changed

.rubocop.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@ inherit_from: .rubocop_todo.yml
33
AllCops:
44
Exclude:
55
- '_tmp/**/*'
6+
7+
Style/FrozenStringLiteralComment:
8+
Enabled: False
9+
10+
Style/NumericPredicate:
11+
Exclude:
12+
- 'lib/autoprovision/portal/profile_client.rb'

.rubocop_todo.yml

Lines changed: 62 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,58 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2019-02-19 13:51:31 +0100 using RuboCop version 0.58.2.
3+
# on 2021-02-08 17:52:56 +0100 using RuboCop version 0.61.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 33
9+
# Offense count: 42
10+
# Cop supports --auto-correct.
11+
# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
12+
# SupportedHashRocketStyles: key, separator, table
13+
# SupportedColonStyles: key, separator, table
14+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
15+
Layout/AlignHash:
16+
Exclude:
17+
- 'lib/autoprovision/portal/app_client.rb'
18+
19+
# Offense count: 16
20+
# Cop supports --auto-correct.
21+
Layout/EmptyLineAfterGuardClause:
22+
Exclude:
23+
- 'lib/autoprovision/auth_data.rb'
24+
- 'lib/autoprovision/certificate_helper.rb'
25+
- 'lib/autoprovision/device.rb'
26+
- 'lib/autoprovision/portal/app_client.rb'
27+
- 'lib/autoprovision/portal/common.rb'
28+
- 'lib/autoprovision/portal/device_client.rb'
29+
- 'lib/autoprovision/project_helper.rb'
30+
- 'log/log.rb'
31+
- 'params.rb'
32+
33+
# Offense count: 1
34+
# Cop supports --auto-correct.
35+
Layout/EmptyLinesAroundExceptionHandlingKeywords:
36+
Exclude:
37+
- 'main.rb'
38+
39+
# Offense count: 3
40+
# Cop supports --auto-correct.
41+
# Configuration parameters: Width, IgnoredPatterns.
42+
Layout/IndentationWidth:
43+
Exclude:
44+
- 'log/log.rb'
45+
- 'main.rb'
46+
47+
# Offense count: 1
48+
# Cop supports --auto-correct.
49+
# Configuration parameters: EnforcedStyle.
50+
# SupportedStyles: final_newline, final_blank_line
51+
Layout/TrailingBlankLines:
52+
Exclude:
53+
- 'main.rb'
54+
55+
# Offense count: 32
1056
Metrics/AbcSize:
1157
Max: 65
1258

@@ -25,8 +71,8 @@ Metrics/ClassLength:
2571
Metrics/CyclomaticComplexity:
2672
Max: 18
2773

28-
# Offense count: 36
29-
# Configuration parameters: CountComments.
74+
# Offense count: 35
75+
# Configuration parameters: CountComments, ExcludedMethods.
3076
Metrics/MethodLength:
3177
Max: 61
3278

@@ -35,7 +81,7 @@ Metrics/MethodLength:
3581
Metrics/ParameterLists:
3682
Max: 8
3783

38-
# Offense count: 13
84+
# Offense count: 14
3985
Metrics/PerceivedComplexity:
4086
Max: 22
4187

@@ -45,13 +91,6 @@ Style/BlockComments:
4591
Exclude:
4692
- 'spec/spec_helper.rb'
4793

48-
# Offense count: 1
49-
# Configuration parameters: EnforcedStyle.
50-
# SupportedStyles: each, for
51-
Style/For:
52-
Exclude:
53-
- 'lib/autoprovision/device.rb'
54-
5594
# Offense count: 1
5695
# Configuration parameters: MinBodyLength.
5796
Style/GuardClause:
@@ -65,7 +104,7 @@ Style/IfUnlessModifier:
65104
- 'lib/autoprovision/certificate_helper.rb'
66105
- 'lib/autoprovision/profile_helper.rb'
67106

68-
# Offense count: 4
107+
# Offense count: 7
69108
# Cop supports --auto-correct.
70109
# Configuration parameters: EnforcedStyle.
71110
# SupportedStyles: implicit, explicit
@@ -74,9 +113,18 @@ Style/RescueStandardError:
74113
- 'lib/autoprovision/portal/device_client.rb'
75114
- 'lib/autoprovision/portal/profile_client.rb'
76115
- 'lib/autoprovision/profile_helper.rb'
116+
- 'main.rb'
77117
- 'step.rb'
78118

79-
# Offense count: 229
119+
# Offense count: 4
120+
# Cop supports --auto-correct.
121+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
122+
# SupportedStyles: single_quotes, double_quotes
123+
Style/StringLiterals:
124+
Exclude:
125+
- 'main.rb'
126+
127+
# Offense count: 231
80128
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
81129
# URISchemes: http, https
82130
Metrics/LineLength:

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
source 'https://rubygems.org'
22

3-
gem 'fastlane'
3+
gem 'fastlane', '2.173.0'
44
gem 'openssl'
55
gem 'plist'
66
gem 'xcodeproj'
77

88
group :test do
99
gem 'rspec'
10-
gem 'rubocop', '0.58.2'
10+
gem 'rubocop', '0.61.1'
1111
end

Gemfile.lock

Lines changed: 68 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.2)
4+
CFPropertyList (3.0.3)
55
addressable (2.7.0)
66
public_suffix (>= 2.0.2, < 5.0)
7-
ast (2.4.1)
7+
artifactory (3.0.15)
8+
ast (2.4.2)
89
atomos (0.1.3)
910
aws-eventstream (1.1.0)
10-
aws-partitions (1.382.0)
11-
aws-sdk-core (3.109.1)
11+
aws-partitions (1.424.0)
12+
aws-sdk-core (3.112.0)
1213
aws-eventstream (~> 1, >= 1.0.2)
1314
aws-partitions (~> 1, >= 1.239.0)
1415
aws-sigv4 (~> 1.1)
1516
jmespath (~> 1.0)
16-
aws-sdk-kms (1.39.0)
17-
aws-sdk-core (~> 3, >= 3.109.0)
17+
aws-sdk-kms (1.42.0)
18+
aws-sdk-core (~> 3, >= 3.112.0)
1819
aws-sigv4 (~> 1.1)
19-
aws-sdk-s3 (1.83.0)
20-
aws-sdk-core (~> 3, >= 3.109.0)
20+
aws-sdk-s3 (1.88.0)
21+
aws-sdk-core (~> 3, >= 3.112.0)
2122
aws-sdk-kms (~> 1)
2223
aws-sigv4 (~> 1.1)
2324
aws-sigv4 (1.2.2)
@@ -31,24 +32,28 @@ GEM
3132
declarative (0.0.20)
3233
declarative-option (0.1.0)
3334
diff-lcs (1.4.4)
34-
digest-crc (0.6.1)
35-
rake (~> 13.0)
35+
digest-crc (0.6.3)
36+
rake (>= 12.0.0, < 14.0.0)
3637
domain_name (0.5.20190701)
3738
unf (>= 0.0.5, < 1.0.0)
3839
dotenv (2.7.6)
39-
emoji_regex (3.0.0)
40-
excon (0.76.0)
41-
faraday (1.0.1)
40+
emoji_regex (3.2.1)
41+
excon (0.79.0)
42+
faraday (1.3.0)
43+
faraday-net_http (~> 1.0)
4244
multipart-post (>= 1.2, < 3)
45+
ruby2_keywords
4346
faraday-cookie_jar (0.0.7)
4447
faraday (>= 0.8.0)
4548
http-cookie (~> 1.0.0)
49+
faraday-net_http (1.0.1)
4650
faraday_middleware (1.0.0)
4751
faraday (~> 1.0)
48-
fastimage (2.2.0)
49-
fastlane (2.163.0)
52+
fastimage (2.2.2)
53+
fastlane (2.173.0)
5054
CFPropertyList (>= 2.3, < 4.0.0)
5155
addressable (>= 2.3, < 3.0.0)
56+
artifactory (~> 3.0)
5257
aws-sdk-s3 (~> 1.0)
5358
babosa (>= 1.0.3, < 2.0.0)
5459
bundler (>= 1.12.0, < 3.0.0)
@@ -91,20 +96,35 @@ GEM
9196
representable (~> 3.0)
9297
retriable (>= 2.0, < 4.0)
9398
signet (~> 0.12)
99+
google-apis-core (0.2.1)
100+
addressable (~> 2.5, >= 2.5.1)
101+
googleauth (~> 0.14)
102+
httpclient (>= 2.8.1, < 3.0)
103+
mini_mime (~> 1.0)
104+
representable (~> 3.0)
105+
retriable (>= 2.0, < 4.0)
106+
rexml
107+
signet (~> 0.14)
108+
webrick
109+
google-apis-iamcredentials_v1 (0.1.0)
110+
google-apis-core (~> 0.1)
111+
google-apis-storage_v1 (0.1.0)
112+
google-apis-core (~> 0.1)
94113
google-cloud-core (1.5.0)
95114
google-cloud-env (~> 1.0)
96115
google-cloud-errors (~> 1.0)
97116
google-cloud-env (1.4.0)
98117
faraday (>= 0.17.3, < 2.0)
99118
google-cloud-errors (1.0.1)
100-
google-cloud-storage (1.29.1)
119+
google-cloud-storage (1.30.0)
101120
addressable (~> 2.5)
102121
digest-crc (~> 0.4)
103-
google-api-client (~> 0.33)
122+
google-apis-iamcredentials_v1 (~> 0.1)
123+
google-apis-storage_v1 (~> 0.1)
104124
google-cloud-core (~> 1.2)
105125
googleauth (~> 0.9)
106126
mini_mime (~> 1.0)
107-
googleauth (0.14.0)
127+
googleauth (0.15.0)
108128
faraday (>= 0.17.3, < 2.0)
109129
jwt (>= 1.4, < 3.0)
110130
memoist (~> 0.16)
@@ -117,56 +137,58 @@ GEM
117137
httpclient (2.8.3)
118138
jaro_winkler (1.5.4)
119139
jmespath (1.4.0)
120-
json (2.3.1)
140+
json (2.5.1)
121141
jwt (2.2.2)
122142
memoist (0.16.2)
123-
mini_magick (4.10.1)
143+
mini_magick (4.11.0)
124144
mini_mime (1.0.2)
125145
multi_json (1.15.0)
126146
multipart-post (2.0.0)
127147
nanaimo (0.3.0)
128-
naturally (2.2.0)
148+
naturally (2.2.1)
129149
openssl (2.2.0)
130150
os (1.1.1)
131-
parallel (1.19.2)
132-
parser (2.7.2.0)
151+
parallel (1.20.1)
152+
parser (3.0.0.0)
133153
ast (~> 2.4.1)
134-
plist (3.5.0)
135-
powerpack (0.1.2)
154+
plist (3.6.0)
155+
powerpack (0.1.3)
136156
public_suffix (4.0.6)
137157
rainbow (3.0.0)
138-
rake (13.0.1)
158+
rake (13.0.3)
139159
representable (3.0.4)
140160
declarative (< 0.1.0)
141161
declarative-option (< 0.2.0)
142162
uber (< 0.2.0)
143163
retriable (3.1.2)
164+
rexml (3.2.4)
144165
rouge (2.0.7)
145-
rspec (3.9.0)
146-
rspec-core (~> 3.9.0)
147-
rspec-expectations (~> 3.9.0)
148-
rspec-mocks (~> 3.9.0)
149-
rspec-core (3.9.3)
150-
rspec-support (~> 3.9.3)
151-
rspec-expectations (3.9.2)
166+
rspec (3.10.0)
167+
rspec-core (~> 3.10.0)
168+
rspec-expectations (~> 3.10.0)
169+
rspec-mocks (~> 3.10.0)
170+
rspec-core (3.10.1)
171+
rspec-support (~> 3.10.0)
172+
rspec-expectations (3.10.1)
152173
diff-lcs (>= 1.2.0, < 2.0)
153-
rspec-support (~> 3.9.0)
154-
rspec-mocks (3.9.1)
174+
rspec-support (~> 3.10.0)
175+
rspec-mocks (3.10.2)
155176
diff-lcs (>= 1.2.0, < 2.0)
156-
rspec-support (~> 3.9.0)
157-
rspec-support (3.9.3)
158-
rubocop (0.58.2)
177+
rspec-support (~> 3.10.0)
178+
rspec-support (3.10.2)
179+
rubocop (0.61.1)
159180
jaro_winkler (~> 1.5.1)
160181
parallel (~> 1.10)
161182
parser (>= 2.5, != 2.5.1.1)
162183
powerpack (~> 0.1)
163184
rainbow (>= 2.2.2, < 4.0)
164185
ruby-progressbar (~> 1.7)
165-
unicode-display_width (~> 1.0, >= 1.0.1)
166-
ruby-progressbar (1.10.1)
186+
unicode-display_width (~> 1.4.0)
187+
ruby-progressbar (1.11.0)
188+
ruby2_keywords (0.0.4)
167189
rubyzip (2.3.0)
168190
security (0.1.3)
169-
signet (0.14.0)
191+
signet (0.14.1)
170192
addressable (~> 2.3)
171193
faraday (>= 0.17.3, < 2.0)
172194
jwt (>= 1.5, < 3.0)
@@ -186,7 +208,8 @@ GEM
186208
unf (0.1.4)
187209
unf_ext
188210
unf_ext (0.0.7.7)
189-
unicode-display_width (1.7.0)
211+
unicode-display_width (1.4.1)
212+
webrick (1.7.0)
190213
word_wrap (1.0.0)
191214
xcodeproj (1.19.0)
192215
CFPropertyList (>= 2.3.3, < 4.0)
@@ -196,18 +219,18 @@ GEM
196219
nanaimo (~> 0.3.0)
197220
xcpretty (0.3.0)
198221
rouge (~> 2.0.7)
199-
xcpretty-travis-formatter (1.0.0)
222+
xcpretty-travis-formatter (1.0.1)
200223
xcpretty (~> 0.2, >= 0.0.7)
201224

202225
PLATFORMS
203226
ruby
204227

205228
DEPENDENCIES
206-
fastlane
229+
fastlane (= 2.173.0)
207230
openssl
208231
plist
209232
rspec
210-
rubocop (= 0.58.2)
233+
rubocop (= 0.61.1)
211234
xcodeproj
212235

213236
BUNDLED WITH

lib/autoprovision/portal/auth_client.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module Portal
55
class AuthClient
66
def self.login(username, password, two_factor_session = nil, team_id = nil)
77
ENV['FASTLANE_SESSION'] = two_factor_session unless two_factor_session.to_s.empty?
8+
ENV['SPACESHIP_SKIP_2FA_UPGRADE'] = '1'
89

910
client = Spaceship::Portal.login(username, password)
1011

0 commit comments

Comments
 (0)