omniauth-canvas 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +651 -0
- data/README.md +43 -13
- data/lib/omniauth-canvas.rb +1 -1
- data/lib/omniauth-canvas/version.rb +1 -1
- data/lib/omniauth/strategies/canvas.rb +19 -21
- data/spec/omniauth/strategies/canvas_spec.rb +8 -9
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7d90232035d82f77899c0ebc88dc52ccc2d72f5
|
4
|
+
data.tar.gz: 1aede78f76663a8c5909129c5ab129e847348bb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eccc01db48cd4cb81299b45c944d7914f4868138813556e9929e94e84bfad6eababef8dadf83cb0071ef6e5c5cb345dff68b67a2df58ca0540dd5cf8a2eeef18
|
7
|
+
data.tar.gz: 2bd428be2dbd5b4d262d76da4e6412615f0ad6ae539bc6e8d19ba54d10de90b4d6d52037f9c1a2a68ec50eb912338b029292ba8df3dc4807b5a86c149bcf5c44
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,651 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- db/schema.rb
|
4
|
+
|
5
|
+
Style/AccessorMethodName:
|
6
|
+
Description: Check the naming of accessor methods for get_/set_.
|
7
|
+
Enabled: false
|
8
|
+
|
9
|
+
Style/Alias:
|
10
|
+
Description: 'Use alias_method instead of alias.'
|
11
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
Style/ArrayJoin:
|
15
|
+
Description: 'Use Array#join instead of Array#*.'
|
16
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Style/AsciiComments:
|
20
|
+
Description: 'Use only ascii symbols in comments.'
|
21
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
Style/AsciiIdentifiers:
|
25
|
+
Description: 'Use only ascii symbols in identifiers.'
|
26
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
Style/Attr:
|
30
|
+
Description: 'Checks for uses of Module#attr.'
|
31
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Metrics/BlockNesting:
|
35
|
+
Description: 'Avoid excessive block nesting'
|
36
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
Style/CaseEquality:
|
40
|
+
Description: 'Avoid explicit use of the case equality operator(===).'
|
41
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Style/CharacterLiteral:
|
45
|
+
Description: 'Checks for uses of character literals.'
|
46
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
47
|
+
Enabled: false
|
48
|
+
|
49
|
+
Style/ClassAndModuleChildren:
|
50
|
+
Description: 'Checks style of children classes and modules.'
|
51
|
+
Enabled: true
|
52
|
+
EnforcedStyle: nested
|
53
|
+
|
54
|
+
Metrics/ClassLength:
|
55
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
56
|
+
Enabled: false
|
57
|
+
|
58
|
+
Metrics/ModuleLength:
|
59
|
+
Description: 'Avoid modules longer than 100 lines of code.'
|
60
|
+
Enabled: false
|
61
|
+
|
62
|
+
Metrics/BlockLength:
|
63
|
+
Exclude:
|
64
|
+
- "**/*_spec.rb"
|
65
|
+
|
66
|
+
Style/ClassVars:
|
67
|
+
Description: 'Avoid the use of class variables.'
|
68
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
69
|
+
Enabled: false
|
70
|
+
|
71
|
+
Style/CollectionMethods:
|
72
|
+
Enabled: true
|
73
|
+
PreferredMethods:
|
74
|
+
find: detect
|
75
|
+
inject: reduce
|
76
|
+
collect: map
|
77
|
+
find_all: select
|
78
|
+
|
79
|
+
Style/ColonMethodCall:
|
80
|
+
Description: 'Do not use :: for method call.'
|
81
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
|
82
|
+
Enabled: false
|
83
|
+
|
84
|
+
Style/CommentAnnotation:
|
85
|
+
Description: >-
|
86
|
+
Checks formatting of special comments
|
87
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
88
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
89
|
+
Enabled: false
|
90
|
+
|
91
|
+
Metrics/AbcSize:
|
92
|
+
Description: >-
|
93
|
+
A calculated magnitude based on number of assignments,
|
94
|
+
branches, and conditions.
|
95
|
+
Enabled: false
|
96
|
+
|
97
|
+
Metrics/CyclomaticComplexity:
|
98
|
+
Description: >-
|
99
|
+
A complexity metric that is strongly correlated to the number
|
100
|
+
of test cases needed to validate a method.
|
101
|
+
Enabled: false
|
102
|
+
|
103
|
+
Rails/Delegate:
|
104
|
+
Description: 'Prefer delegate method for delegations.'
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
Style/DeprecatedHashMethods:
|
108
|
+
Description: 'Checks for use of deprecated Hash methods.'
|
109
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
|
110
|
+
Enabled: false
|
111
|
+
|
112
|
+
Style/Documentation:
|
113
|
+
Description: 'Document classes and non-namespace modules.'
|
114
|
+
Enabled: false
|
115
|
+
|
116
|
+
Style/DotPosition:
|
117
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
118
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
119
|
+
EnforcedStyle: trailing
|
120
|
+
|
121
|
+
Style/DoubleNegation:
|
122
|
+
Description: 'Checks for uses of double negation (!!).'
|
123
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
124
|
+
Enabled: false
|
125
|
+
|
126
|
+
Style/EachWithObject:
|
127
|
+
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
128
|
+
Enabled: false
|
129
|
+
|
130
|
+
Style/EmptyLiteral:
|
131
|
+
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
132
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
|
133
|
+
Enabled: false
|
134
|
+
|
135
|
+
# Checks whether the source file has a utf-8 encoding comment or not
|
136
|
+
# AutoCorrectEncodingComment must match the regex
|
137
|
+
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
138
|
+
Style/Encoding:
|
139
|
+
Enabled: false
|
140
|
+
|
141
|
+
Style/EvenOdd:
|
142
|
+
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
143
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
144
|
+
Enabled: false
|
145
|
+
|
146
|
+
Style/ExtraSpacing:
|
147
|
+
Description: 'Do not use unnecessary spacing.'
|
148
|
+
Enabled: true
|
149
|
+
|
150
|
+
Style/FileName:
|
151
|
+
Description: 'Use snake_case for source file names.'
|
152
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
153
|
+
Enabled: false
|
154
|
+
|
155
|
+
Style/FrozenStringLiteralComment:
|
156
|
+
Description: >-
|
157
|
+
Add the frozen_string_literal comment to the top of files
|
158
|
+
to help transition from Ruby 2.3.0 to Ruby 3.0.
|
159
|
+
Enabled: false
|
160
|
+
|
161
|
+
Style/FlipFlop:
|
162
|
+
Description: 'Checks for flip flops'
|
163
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
164
|
+
Enabled: false
|
165
|
+
|
166
|
+
Style/FormatString:
|
167
|
+
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
168
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
|
169
|
+
Enabled: false
|
170
|
+
|
171
|
+
Style/GlobalVars:
|
172
|
+
Description: 'Do not introduce global variables.'
|
173
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
174
|
+
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
|
175
|
+
Enabled: false
|
176
|
+
|
177
|
+
Style/GuardClause:
|
178
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
179
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
180
|
+
Enabled: false
|
181
|
+
|
182
|
+
Style/IfUnlessModifier:
|
183
|
+
Description: >-
|
184
|
+
Favor modifier if/unless usage when you have a
|
185
|
+
single-line body.
|
186
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
187
|
+
Enabled: false
|
188
|
+
|
189
|
+
Style/IfWithSemicolon:
|
190
|
+
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
191
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
192
|
+
Enabled: false
|
193
|
+
|
194
|
+
Style/InlineComment:
|
195
|
+
Description: 'Avoid inline comments.'
|
196
|
+
Enabled: false
|
197
|
+
|
198
|
+
Style/Lambda:
|
199
|
+
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
200
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
201
|
+
Enabled: false
|
202
|
+
|
203
|
+
Style/LambdaCall:
|
204
|
+
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
205
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
206
|
+
Enabled: false
|
207
|
+
|
208
|
+
Style/LineEndConcatenation:
|
209
|
+
Description: >-
|
210
|
+
Use \ instead of + or << to concatenate two string literals at
|
211
|
+
line end.
|
212
|
+
Enabled: false
|
213
|
+
|
214
|
+
Metrics/LineLength:
|
215
|
+
Description: 'Limit lines to 120 characters.'
|
216
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
217
|
+
Max: 120
|
218
|
+
Enabled: true
|
219
|
+
|
220
|
+
Metrics/MethodLength:
|
221
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
222
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
223
|
+
Enabled: false
|
224
|
+
|
225
|
+
Style/ModuleFunction:
|
226
|
+
Description: 'Checks for usage of `extend self` in modules.'
|
227
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
228
|
+
Enabled: false
|
229
|
+
|
230
|
+
Style/MultilineOperationIndentation:
|
231
|
+
Description: >-
|
232
|
+
Checks indentation of binary operations that span more than
|
233
|
+
one line.
|
234
|
+
Enabled: true
|
235
|
+
EnforcedStyle: indented
|
236
|
+
|
237
|
+
Style/MultilineBlockChain:
|
238
|
+
Description: 'Avoid multi-line chains of blocks.'
|
239
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
240
|
+
Enabled: false
|
241
|
+
|
242
|
+
Style/MultilineMethodCallIndentation:
|
243
|
+
Description: >-
|
244
|
+
Checks indentation of method calls with the dot operator
|
245
|
+
that span more than one line.
|
246
|
+
Enabled: true
|
247
|
+
EnforcedStyle: indented
|
248
|
+
|
249
|
+
Style/NegatedIf:
|
250
|
+
Description: >-
|
251
|
+
Favor unless over if for negative conditions
|
252
|
+
(or control flow or).
|
253
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
254
|
+
Enabled: false
|
255
|
+
|
256
|
+
Style/NegatedWhile:
|
257
|
+
Description: 'Favor until over while for negative conditions.'
|
258
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
|
259
|
+
Enabled: false
|
260
|
+
|
261
|
+
Style/Next:
|
262
|
+
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
263
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
264
|
+
Enabled: false
|
265
|
+
|
266
|
+
Style/NilComparison:
|
267
|
+
Description: 'Prefer x.nil? to x == nil.'
|
268
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
269
|
+
Enabled: false
|
270
|
+
|
271
|
+
Style/Not:
|
272
|
+
Description: 'Use ! instead of not.'
|
273
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
274
|
+
Enabled: false
|
275
|
+
|
276
|
+
Style/NumericLiterals:
|
277
|
+
Description: >-
|
278
|
+
Add underscores to large numeric literals to improve their
|
279
|
+
readability.
|
280
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
281
|
+
Enabled: false
|
282
|
+
|
283
|
+
Style/NumericPredicate:
|
284
|
+
Description: >-
|
285
|
+
This cop checks for usage of comparison operators
|
286
|
+
(`==`, `!=`, `>`, `<`) to test numbers as
|
287
|
+
zero, nonzero, positive, or negative.
|
288
|
+
These can be replaced by their respective predicate methods.
|
289
|
+
The cop can also be configured to do the reverse.
|
290
|
+
StyleGuide: 'http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/NumericPredicate'
|
291
|
+
Enabled: false
|
292
|
+
|
293
|
+
Style/OneLineConditional:
|
294
|
+
Description: >-
|
295
|
+
Favor the ternary operator(?:) over
|
296
|
+
if/then/else/end constructs.
|
297
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
298
|
+
Enabled: false
|
299
|
+
|
300
|
+
Style/OpMethod:
|
301
|
+
Description: 'When defining binary operators, name the argument other.'
|
302
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
303
|
+
Enabled: false
|
304
|
+
|
305
|
+
Metrics/ParameterLists:
|
306
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
307
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
308
|
+
Enabled: false
|
309
|
+
|
310
|
+
Style/PercentLiteralDelimiters:
|
311
|
+
Description: 'Use `%`-literal delimiters consistently'
|
312
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
|
313
|
+
Enabled: false
|
314
|
+
|
315
|
+
Style/PerlBackrefs:
|
316
|
+
Description: 'Avoid Perl-style regex back references.'
|
317
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
318
|
+
Enabled: false
|
319
|
+
|
320
|
+
Style/PredicateName:
|
321
|
+
Description: 'Check the names of predicate methods.'
|
322
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
323
|
+
NamePrefixBlacklist:
|
324
|
+
- is_
|
325
|
+
Exclude:
|
326
|
+
- spec/**/*
|
327
|
+
|
328
|
+
Style/Proc:
|
329
|
+
Description: 'Use proc instead of Proc.new.'
|
330
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
|
331
|
+
Enabled: false
|
332
|
+
|
333
|
+
Style/RaiseArgs:
|
334
|
+
Description: 'Checks the arguments passed to raise/fail.'
|
335
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
|
336
|
+
Enabled: false
|
337
|
+
|
338
|
+
Style/RegexpLiteral:
|
339
|
+
Description: 'Use / or %r around regular expressions.'
|
340
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
341
|
+
Enabled: false
|
342
|
+
|
343
|
+
Style/SelfAssignment:
|
344
|
+
Description: >-
|
345
|
+
Checks for places where self-assignment shorthand should have
|
346
|
+
been used.
|
347
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
348
|
+
Enabled: false
|
349
|
+
|
350
|
+
Style/SingleLineBlockParams:
|
351
|
+
Description: 'Enforces the names of some block params.'
|
352
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
353
|
+
Enabled: false
|
354
|
+
|
355
|
+
Style/SingleLineMethods:
|
356
|
+
Description: 'Avoid single-line methods.'
|
357
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
358
|
+
Enabled: false
|
359
|
+
|
360
|
+
Style/SignalException:
|
361
|
+
Description: 'Checks for proper usage of fail and raise.'
|
362
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
|
363
|
+
Enabled: false
|
364
|
+
|
365
|
+
Style/SpecialGlobalVars:
|
366
|
+
Description: 'Avoid Perl-style global variables.'
|
367
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
368
|
+
Enabled: false
|
369
|
+
|
370
|
+
Style/StringLiterals:
|
371
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
372
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
373
|
+
EnforcedStyle: double_quotes
|
374
|
+
Enabled: true
|
375
|
+
|
376
|
+
Style/TrailingCommaInArguments:
|
377
|
+
Description: 'Checks for trailing comma in argument lists.'
|
378
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
379
|
+
EnforcedStyleForMultiline:
|
380
|
+
- consistent_comma
|
381
|
+
- no_comma
|
382
|
+
SupportedStyles:
|
383
|
+
- comma
|
384
|
+
- consistent_comma
|
385
|
+
- no_comma
|
386
|
+
Enabled: true
|
387
|
+
|
388
|
+
Style/TrailingCommaInLiteral:
|
389
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
390
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
391
|
+
EnforcedStyleForMultiline:
|
392
|
+
- consistent_comma
|
393
|
+
- no_comma
|
394
|
+
SupportedStyles:
|
395
|
+
- comma
|
396
|
+
- consistent_comma
|
397
|
+
- no_comma
|
398
|
+
Enabled: true
|
399
|
+
|
400
|
+
Style/TrivialAccessors:
|
401
|
+
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
402
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
403
|
+
Enabled: false
|
404
|
+
|
405
|
+
Style/VariableInterpolation:
|
406
|
+
Description: >-
|
407
|
+
Don't interpolate global, instance and class variables
|
408
|
+
directly in strings.
|
409
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
410
|
+
Enabled: false
|
411
|
+
|
412
|
+
Style/WhenThen:
|
413
|
+
Description: 'Use when x then ... for one-line cases.'
|
414
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
|
415
|
+
Enabled: false
|
416
|
+
|
417
|
+
Style/WhileUntilModifier:
|
418
|
+
Description: >-
|
419
|
+
Favor modifier while/until usage when you have a
|
420
|
+
single-line body.
|
421
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
422
|
+
Enabled: false
|
423
|
+
|
424
|
+
Style/WordArray:
|
425
|
+
Description: 'Use %w or %W for arrays of words.'
|
426
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
427
|
+
Enabled: false
|
428
|
+
|
429
|
+
# Lint
|
430
|
+
|
431
|
+
Lint/AmbiguousOperator:
|
432
|
+
Description: >-
|
433
|
+
Checks for ambiguous operators in the first argument of a
|
434
|
+
method invocation without parentheses.
|
435
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
436
|
+
Enabled: false
|
437
|
+
|
438
|
+
Lint/AmbiguousRegexpLiteral:
|
439
|
+
Description: >-
|
440
|
+
Checks for ambiguous regexp literals in the first argument of
|
441
|
+
a method invocation without parenthesis.
|
442
|
+
Enabled: false
|
443
|
+
|
444
|
+
Lint/AssignmentInCondition:
|
445
|
+
Description: "Don't use assignment in conditions."
|
446
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
447
|
+
Enabled: false
|
448
|
+
|
449
|
+
Lint/CircularArgumentReference:
|
450
|
+
Description: "Don't refer to the keyword argument in the default value."
|
451
|
+
Enabled: false
|
452
|
+
|
453
|
+
Lint/ConditionPosition:
|
454
|
+
Description: >-
|
455
|
+
Checks for condition placed in a confusing position relative to
|
456
|
+
the keyword.
|
457
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
458
|
+
Enabled: false
|
459
|
+
|
460
|
+
Lint/DeprecatedClassMethods:
|
461
|
+
Description: 'Check for deprecated class method calls.'
|
462
|
+
Enabled: false
|
463
|
+
|
464
|
+
Lint/DuplicatedKey:
|
465
|
+
Description: 'Check for duplicate keys in hash literals.'
|
466
|
+
Enabled: false
|
467
|
+
|
468
|
+
Lint/EachWithObjectArgument:
|
469
|
+
Description: 'Check for immutable argument given to each_with_object.'
|
470
|
+
Enabled: false
|
471
|
+
|
472
|
+
Lint/ElseLayout:
|
473
|
+
Description: 'Check for odd code arrangement in an else block.'
|
474
|
+
Enabled: false
|
475
|
+
|
476
|
+
Lint/FormatParameterMismatch:
|
477
|
+
Description: 'The number of parameters to format/sprint must match the fields.'
|
478
|
+
Enabled: false
|
479
|
+
|
480
|
+
Lint/HandleExceptions:
|
481
|
+
Description: "Don't suppress exception."
|
482
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
483
|
+
Enabled: false
|
484
|
+
|
485
|
+
Lint/InvalidCharacterLiteral:
|
486
|
+
Description: >-
|
487
|
+
Checks for invalid character literals with a non-escaped
|
488
|
+
whitespace character.
|
489
|
+
Enabled: false
|
490
|
+
|
491
|
+
Style/InitialIndentation:
|
492
|
+
Description: >-
|
493
|
+
Checks the indentation of the first non-blank non-comment line in a file.
|
494
|
+
Enabled: false
|
495
|
+
|
496
|
+
Lint/LiteralInCondition:
|
497
|
+
Description: 'Checks of literals used in conditions.'
|
498
|
+
Enabled: false
|
499
|
+
|
500
|
+
Lint/LiteralInInterpolation:
|
501
|
+
Description: 'Checks for literals used in interpolation.'
|
502
|
+
Enabled: false
|
503
|
+
|
504
|
+
Lint/Loop:
|
505
|
+
Description: >-
|
506
|
+
Use Kernel#loop with break rather than begin/end/until or
|
507
|
+
begin/end/while for post-loop tests.
|
508
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
509
|
+
Enabled: false
|
510
|
+
|
511
|
+
Lint/NestedMethodDefinition:
|
512
|
+
Description: 'Do not use nested method definitions.'
|
513
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
|
514
|
+
Enabled: false
|
515
|
+
|
516
|
+
Lint/NonLocalExitFromIterator:
|
517
|
+
Description: 'Do not use return in iterator to cause non-local exit.'
|
518
|
+
Enabled: false
|
519
|
+
|
520
|
+
Lint/ParenthesesAsGroupedExpression:
|
521
|
+
Description: >-
|
522
|
+
Checks for method calls with a space before the opening
|
523
|
+
parenthesis.
|
524
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
525
|
+
Enabled: false
|
526
|
+
|
527
|
+
Lint/RequireParentheses:
|
528
|
+
Description: >-
|
529
|
+
Use parentheses in the method call to avoid confusion
|
530
|
+
about precedence.
|
531
|
+
Enabled: false
|
532
|
+
|
533
|
+
Lint/UnderscorePrefixedVariableName:
|
534
|
+
Description: 'Do not use prefix `_` for a variable that is used.'
|
535
|
+
Enabled: false
|
536
|
+
|
537
|
+
Lint/UnneededDisable:
|
538
|
+
Description: >-
|
539
|
+
Checks for rubocop:disable comments that can be removed.
|
540
|
+
Note: this cop is not disabled when disabling all cops.
|
541
|
+
It must be explicitly disabled.
|
542
|
+
Enabled: false
|
543
|
+
|
544
|
+
Lint/Void:
|
545
|
+
Description: 'Possible use of operator/literal/variable in void context.'
|
546
|
+
Enabled: false
|
547
|
+
|
548
|
+
# Performance
|
549
|
+
|
550
|
+
Performance/CaseWhenSplat:
|
551
|
+
Description: >-
|
552
|
+
Place `when` conditions that use splat at the end
|
553
|
+
of the list of `when` branches.
|
554
|
+
Enabled: false
|
555
|
+
|
556
|
+
Performance/Count:
|
557
|
+
Description: >-
|
558
|
+
Use `count` instead of `select...size`, `reject...size`,
|
559
|
+
`select...count`, `reject...count`, `select...length`,
|
560
|
+
and `reject...length`.
|
561
|
+
Enabled: false
|
562
|
+
|
563
|
+
Performance/Detect:
|
564
|
+
Description: >-
|
565
|
+
Use `detect` instead of `select.first`, `find_all.first`,
|
566
|
+
`select.last`, and `find_all.last`.
|
567
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
568
|
+
Enabled: false
|
569
|
+
|
570
|
+
Performance/FlatMap:
|
571
|
+
Description: >-
|
572
|
+
Use `Enumerable#flat_map`
|
573
|
+
instead of `Enumerable#map...Array#flatten(1)`
|
574
|
+
or `Enumberable#collect..Array#flatten(1)`
|
575
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
576
|
+
Enabled: false
|
577
|
+
|
578
|
+
Performance/ReverseEach:
|
579
|
+
Description: 'Use `reverse_each` instead of `reverse.each`.'
|
580
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
581
|
+
Enabled: false
|
582
|
+
|
583
|
+
Performance/Sample:
|
584
|
+
Description: >-
|
585
|
+
Use `sample` instead of `shuffle.first`,
|
586
|
+
`shuffle.last`, and `shuffle[Fixnum]`.
|
587
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
588
|
+
Enabled: false
|
589
|
+
|
590
|
+
Performance/Size:
|
591
|
+
Description: >-
|
592
|
+
Use `size` instead of `count` for counting
|
593
|
+
the number of elements in `Array` and `Hash`.
|
594
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
|
595
|
+
Enabled: false
|
596
|
+
|
597
|
+
Performance/StringReplacement:
|
598
|
+
Description: >-
|
599
|
+
Use `tr` instead of `gsub` when you are replacing the same
|
600
|
+
number of characters. Use `delete` instead of `gsub` when
|
601
|
+
you are deleting characters.
|
602
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
603
|
+
Enabled: false
|
604
|
+
|
605
|
+
# Rails
|
606
|
+
|
607
|
+
Rails/ActionFilter:
|
608
|
+
Description: 'Enforces consistent use of action filter methods.'
|
609
|
+
Enabled: false
|
610
|
+
|
611
|
+
Rails/Date:
|
612
|
+
Description: >-
|
613
|
+
Checks the correct usage of date aware methods,
|
614
|
+
such as Date.today, Date.current etc.
|
615
|
+
Enabled: false
|
616
|
+
|
617
|
+
Rails/FindBy:
|
618
|
+
Description: 'Prefer find_by over where.first.'
|
619
|
+
Enabled: false
|
620
|
+
|
621
|
+
Rails/FindEach:
|
622
|
+
Description: 'Prefer all.find_each over all.find.'
|
623
|
+
Enabled: false
|
624
|
+
|
625
|
+
Rails/HasAndBelongsToMany:
|
626
|
+
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
627
|
+
Enabled: false
|
628
|
+
|
629
|
+
Rails/Output:
|
630
|
+
Description: 'Checks for calls to puts, print, etc.'
|
631
|
+
Enabled: false
|
632
|
+
|
633
|
+
Rails/ReadWriteAttribute:
|
634
|
+
Description: >-
|
635
|
+
Checks for read_attribute(:attr) and
|
636
|
+
write_attribute(:attr, val).
|
637
|
+
Enabled: false
|
638
|
+
|
639
|
+
Rails/ScopeArgs:
|
640
|
+
Description: 'Checks the arguments of ActiveRecord scopes.'
|
641
|
+
Enabled: false
|
642
|
+
|
643
|
+
Rails/TimeZone:
|
644
|
+
Description: 'Checks the correct usage of time zone aware methods.'
|
645
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
|
646
|
+
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
|
647
|
+
Enabled: false
|
648
|
+
|
649
|
+
Rails/Validation:
|
650
|
+
Description: 'Use validates :attribute, hash of validations.'
|
651
|
+
Enabled: false
|
data/README.md
CHANGED
@@ -7,27 +7,57 @@ http://www.OpenTapestry.com to Instructure Canvas.
|
|
7
7
|
|
8
8
|
# Setup
|
9
9
|
Contact Instructure or your Canvas administrator to get an OAuth key and secret. By default omniauth-canvas will attempt to
|
10
|
-
authenticate with http://canvas.instructure.com.
|
10
|
+
authenticate with http://canvas.instructure.com.
|
11
11
|
|
12
|
-
|
12
|
+
**NOTE**: you will need to set `env['rack.session']['oauth_site']` to the current Canvas instance that you wish to OAuth with. By default this is https://canvas.instructure.com
|
13
13
|
|
14
|
-
|
14
|
+
To dynamically set the canvas site url do one of the following.
|
15
15
|
|
16
|
-
|
17
|
-
provider :canvas, :setup => lambda{|env|
|
18
|
-
request = Rack::Request.new(env)
|
19
|
-
env['omniauth.strategy'].options[:client_options].site = env['rack.session']['oauth_site']
|
20
|
-
}
|
21
|
-
end
|
22
|
-
|
23
|
-
## Setup with Devise:
|
16
|
+
## Standard setup
|
24
17
|
|
25
|
-
|
18
|
+
```ruby
|
19
|
+
use OmniAuth::Builder do
|
20
|
+
provider :canvas, 'canvas_key', 'canvas_secret', :setup => lambda{|env|
|
26
21
|
request = Rack::Request.new(env)
|
27
22
|
env['omniauth.strategy'].options[:client_options].site = env['rack.session']['oauth_site']
|
28
23
|
}
|
24
|
+
end
|
25
|
+
```
|
26
|
+
|
27
|
+
## Setup with Devise
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
config.omniauth :canvas, 'canvas_key', 'canvas_secret', :setup => lambda{|env|
|
31
|
+
request = Rack::Request.new(env)
|
32
|
+
env['omniauth.strategy'].options[:client_options].site = env['rack.session']['oauth_site']
|
33
|
+
}
|
34
|
+
```
|
35
|
+
|
36
|
+
## Alernative Setup
|
37
|
+
|
38
|
+
In this setup, you do not have to set `env['rack.session']['oauth_site']`
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
42
|
+
provider :canvas, APP_CONFIG['canvas_client_id'], APP_CONFIG['canvas_client_secret'],
|
43
|
+
{
|
44
|
+
:client_options => {
|
45
|
+
:site => APP_CONFIG['canvas_host']
|
46
|
+
}
|
47
|
+
}
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
|
52
|
+
# Canvas Configuration
|
53
|
+
|
54
|
+
If you are running your own installation of canvas, you can generate a client ID
|
55
|
+
and secret in the Site Admin account of your Canvas install. There will be a
|
56
|
+
"Developer Keys" tab on the left navigation sidebar. For more information,
|
57
|
+
consult the [Canvas OAuth Documentation](https://canvas.instructure.com/doc/api/file.oauth.html)
|
58
|
+
|
29
59
|
|
30
|
-
|
60
|
+
# License
|
31
61
|
|
32
62
|
Copyright (C) 2012-2016 by Justin Ball and Atomic Jolt.
|
33
63
|
|
data/lib/omniauth-canvas.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require "omniauth-canvas/version"
|
2
|
-
require
|
2
|
+
require "omniauth/strategies/canvas"
|
@@ -3,39 +3,36 @@ require "omniauth-oauth2"
|
|
3
3
|
module OmniAuth
|
4
4
|
module Strategies
|
5
5
|
class Canvas < OmniAuth::Strategies::OAuth2
|
6
|
-
|
7
6
|
option :name, "canvas"
|
8
7
|
|
9
|
-
option :client_options,
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
}
|
8
|
+
option :client_options,
|
9
|
+
site: "https://canvas.instructure.com",
|
10
|
+
authorize_url: "/login/oauth2/auth",
|
11
|
+
token_url: "/login/oauth2/token"
|
14
12
|
|
15
|
-
option :provider_ignores_state,
|
13
|
+
option :provider_ignores_state, false
|
16
14
|
|
17
|
-
option :token_params,
|
18
|
-
|
19
|
-
}
|
15
|
+
option :token_params,
|
16
|
+
parse: :json
|
20
17
|
|
21
18
|
uid do
|
22
|
-
access_token[
|
19
|
+
access_token["user"]["id"]
|
23
20
|
end
|
24
21
|
|
25
22
|
info do
|
26
23
|
{
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
24
|
+
"name" => raw_info["name"],
|
25
|
+
"email" => raw_info["primary_email"],
|
26
|
+
"bio" => raw_info["bio"],
|
27
|
+
"title" => raw_info["title"],
|
28
|
+
"nickname" => raw_info["login_id"],
|
29
|
+
"active_avatar" => raw_info["avatar_url"],
|
30
|
+
"url" => access_token.client.site
|
34
31
|
}
|
35
32
|
end
|
36
33
|
|
37
34
|
extra do
|
38
|
-
{ :
|
35
|
+
{ raw_info: raw_info }
|
39
36
|
end
|
40
37
|
|
41
38
|
def raw_info
|
@@ -43,9 +40,10 @@ module OmniAuth
|
|
43
40
|
end
|
44
41
|
|
45
42
|
def query_string
|
46
|
-
|
43
|
+
""
|
47
44
|
end
|
48
45
|
end
|
49
46
|
end
|
50
47
|
end
|
51
|
-
|
48
|
+
|
49
|
+
OmniAuth.config.add_camelization "canvas", "Canvas"
|
@@ -1,17 +1,17 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe OmniAuth::Strategies::OAuth2 do
|
4
|
-
def app; lambda{|
|
4
|
+
def app; lambda { |_env| [200, {}, ["Hello."]] } end
|
5
5
|
|
6
6
|
before do
|
7
|
-
@request = double(
|
8
|
-
@request.
|
7
|
+
@request = double("Request")
|
8
|
+
allow(@request).to receive(:params).and_return({})
|
9
9
|
OmniAuth.config.test_mode = true
|
10
10
|
end
|
11
11
|
|
12
12
|
subject do
|
13
13
|
OmniAuth::Strategies::Canvas.new(nil, @options || {}).tap do |strategy|
|
14
|
-
strategy.
|
14
|
+
allow(strategy).to receive(:request).and_return(@request)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -21,16 +21,15 @@ describe OmniAuth::Strategies::OAuth2 do
|
|
21
21
|
|
22
22
|
context "client options" do
|
23
23
|
it "has correct api site" do
|
24
|
-
subject.options.client_options.site.
|
24
|
+
expect(subject.options.client_options.site).to eq("https://canvas.instructure.com")
|
25
25
|
end
|
26
26
|
|
27
27
|
it "has correct access token path" do
|
28
|
-
subject.options.client_options.token_url.
|
28
|
+
expect(subject.options.client_options.token_url).to eq("/login/oauth2/token")
|
29
29
|
end
|
30
30
|
|
31
31
|
it "has correct authorize url" do
|
32
|
-
subject.options.client_options.authorize_url.
|
32
|
+
expect(subject.options.client_options.authorize_url).to eq("/login/oauth2/auth")
|
33
33
|
end
|
34
34
|
end
|
35
|
-
|
36
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-canvas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Ball
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -46,6 +46,7 @@ extra_rdoc_files: []
|
|
46
46
|
files:
|
47
47
|
- ".gitignore"
|
48
48
|
- ".rspec"
|
49
|
+
- ".rubocop.yml"
|
49
50
|
- ".ruby-gemset"
|
50
51
|
- ".ruby-version"
|
51
52
|
- Gemfile
|
@@ -77,10 +78,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
78
|
version: '0'
|
78
79
|
requirements: []
|
79
80
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.
|
81
|
+
rubygems_version: 2.6.8
|
81
82
|
signing_key:
|
82
83
|
specification_version: 4
|
83
84
|
summary: OmniAuth Oauth2 strategy for Instructure Canvas.
|
84
85
|
test_files:
|
85
86
|
- spec/omniauth/strategies/canvas_spec.rb
|
86
87
|
- spec/spec_helper.rb
|
88
|
+
has_rdoc:
|