Commit db3fc78
committed
Delete dead code: Discovery, OmniauthOptions, clock_skew
Three pieces of dead code surfaced during a post-testing code review:
1. The Discovery class (~100 LoC + spec) implemented OIDC discovery from
scratch but was never wired into any production code path. The real
discovery is delegated to omniauth_openid_connect via discovery: true
in the Devise omniauth provider config, which the library handles
itself. Dropping Discovery also removes DiscoveryError.
2. OmniauthOptions.build (~25 LoC + its only caller, self.omniauth_options)
was defined but never called. Hosts wire the OmniAuth provider
directly in their Devise initializer; the helper was a leftover from
an earlier iteration that built the options hash in-gem.
3. Configuration#clock_skew was settable but never read — the value was
never forwarded to any OIDC verification step. Removed along with its
specs.
Configuration#reset! is kept: it is legitimately used by the test
helper (spec_helper before(:each)) to isolate state between examples.
Removing it would force a clunkier 'replace the @config ivar' helper,
which is strictly worse than a one-line method on the class.1 parent 759f49b commit db3fc78
6 files changed
Lines changed: 1 addition & 240 deletions
File tree
- lib
- activeadmin/oidc
- spec/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
| |||
162 | 158 | | |
163 | 159 | | |
164 | 160 | | |
165 | | - | |
166 | 161 | | |
167 | 162 | | |
168 | 163 | | |
| |||
175 | 170 | | |
176 | 171 | | |
177 | 172 | | |
178 | | - | |
179 | 173 | | |
180 | 174 | | |
181 | 175 | | |
| |||
This file was deleted.
0 commit comments