Skip to content

Commit 6b2d097

Browse files
committed
🚸 Client / Server examples
1 parent 6a25bfc commit 6b2d097

File tree

15 files changed

+144
-58
lines changed

15 files changed

+144
-58
lines changed

.envrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export K_SOUP_COV_DO=true # Means you want code coverage
1919
# Available formats are html, xml, rcov, lcov, json, tty
2020
export K_SOUP_COV_COMMAND_NAME="RSpec Coverage"
2121
export K_SOUP_COV_FORMATTERS="html,tty"
22-
export K_SOUP_COV_MIN_BRANCH=11 # Means you want to enforce X% branch coverage
23-
export K_SOUP_COV_MIN_LINE=61 # Means you want to enforce X% line coverage
22+
export K_SOUP_COV_MIN_BRANCH=9 # Means you want to enforce X% branch coverage
23+
export K_SOUP_COV_MIN_LINE=58 # Means you want to enforce X% line coverage
2424
export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met
2525
export K_SOUP_COV_MULTI_FORMATTERS=true
2626
export MAX_ROWS=1 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage

.github/workflows/coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ permissions:
66
id-token: write
77

88
env:
9-
K_SOUP_COV_MIN_BRANCH: 11
10-
K_SOUP_COV_MIN_LINE: 61
9+
K_SOUP_COV_MIN_BRANCH: 9
10+
K_SOUP_COV_MIN_LINE: 58
1111
K_SOUP_COV_MIN_HARD: true
1212
K_SOUP_COV_FORMATTERS: "html,xml,rcov,lcov,json,tty"
1313
K_SOUP_COV_DO: true
@@ -129,7 +129,7 @@ jobs:
129129
hide_complexity: true
130130
indicators: true
131131
output: both
132-
thresholds: '61 11'
132+
thresholds: '58 9'
133133
continue-on-error: ${{ matrix.experimental != 'false' }}
134134

135135
- name: Add Coverage PR Comment

.rubocop_gradual.lock

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"bin/bundle:247448467": [
33
[64, 5, 20, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 2485198147]
44
],
5-
"lib/omniauth/strategies/open_id.rb:3703196606": [
6-
[50, 17, 10, "Lint/DuplicateHashKey: Duplicated key in hash literal.", 3672542120]
7-
],
85
"omniauth-openid.gemspec:1698529195": [
96
[4, 23, 12, "Gemspec/RubyVersionGlobalsUsage: Do not use `RUBY_VERSION` in gemspec file.", 31296028]
107
],

Gemfile

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,6 @@ eval_gemfile "gemfiles/modular/coverage.gemfile"
2626
### Testing
2727
gem "appraisal", github: "pboling/appraisal", branch: "galtzo"
2828

29-
# gem 'rake', '~> 12.0'
30-
31-
# platforms :jruby do
32-
# gem 'jruby-openssl', '~> 0.9'
33-
# end
34-
# group :development, :test do
35-
# gem 'rack-test'
36-
# gem 'rspec', '>= 3.0'
37-
# gem 'simplecov', '>= 0.9'
38-
# gem 'webmock'#, '~> 3.0'
39-
# gem 'yard', '>= 0.9.11'
40-
# end
4129
# group :example do
4230
# gem 'sinatra'
4331
# end

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,27 @@ Note the use of nil, which will trigger ruby-openid's default Memory Store.
127127

128128
Please contribute some documentation if you have the gumption! The maintainer's time is limited, and sometimes the authors of PRs with new options don't update the _this_ readme. 😭
129129

130+
## Example
131+
132+
A terribly basic example of an OpenID client/server is at `/examples`
133+
134+
In one shell run the [server][server]:
135+
136+
```shell
137+
cd examples
138+
./server.rb
139+
```
140+
141+
In another shell run the [client][client]:
142+
143+
```shell
144+
cd examples
145+
./client.rb
146+
```
147+
148+
[server]: examples/server.rb
149+
[client]: examples/client.rb
150+
130151
## 🔐 Security
131152

132153
See [SECURITY.md][🔐security].

REEK

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
11
lib/omniauth/openid/version.rb -- 1 warning:
22
[2]:IrresponsibleModule: OmniAuth::OpenID has no descriptive comment [https://github.com/troessner/reek/blob/v6.5.0/docs/Irresponsible-Module.md]
3-
lib/omniauth/strategies/open_id.rb -- 28 warnings:
4-
[129, 129]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'AX[:city]' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
5-
[126, 128]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'AX[:first_name]' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
6-
[127, 128]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'AX[:last_name]' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
7-
[129, 129]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'AX[:state]' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
8-
[131, 131]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'AX[:website]' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
9-
[131, 131]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'Array(ax.get_single(AX[:website]))' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
10-
[129, 129]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'ax.get_single(AX[:city])' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
11-
[126, 128]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'ax.get_single(AX[:first_name])' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
12-
[127, 128]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'ax.get_single(AX[:last_name])' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
13-
[129, 129]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'ax.get_single(AX[:state])' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
14-
[131, 131]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'ax.get_single(AX[:website])' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
15-
[45, 50]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#dummy_app calls 'options.trust_root' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
16-
[81, 82]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#get_identifier calls 'options.identifier_param' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
17-
[125, 126, 127, 128, 128, 128, 129, 129, 129, 129, 130, 131, 131]:FeatureEnvy: OmniAuth::Strategies::OpenID#ax_user_info refers to 'ax' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.5.0/docs/Feature-Envy.md]
18-
[81, 82, 83]:FeatureEnvy: OmniAuth::Strategies::OpenID#get_identifier refers to 'f' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.5.0/docs/Feature-Envy.md]
19-
[114, 115, 116, 117]:FeatureEnvy: OmniAuth::Strategies::OpenID#sreg_user_info refers to 'sreg' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.5.0/docs/Feature-Envy.md]
3+
lib/omniauth/strategies/open_id.rb -- 30 warnings:
4+
[137, 137]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'AX[:city]' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
5+
[134, 136]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'AX[:first_name]' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
6+
[135, 136]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'AX[:last_name]' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
7+
[137, 137]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'AX[:state]' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
8+
[139, 139]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'AX[:website]' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
9+
[139, 139]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'Array(ax.get_single(AX[:website]))' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
10+
[137, 137]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'ax.get_single(AX[:city])' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
11+
[134, 136]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'ax.get_single(AX[:first_name])' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
12+
[135, 136]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'ax.get_single(AX[:last_name])' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
13+
[137, 137]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'ax.get_single(AX[:state])' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
14+
[139, 139]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#ax_user_info calls 'ax.get_single(AX[:website])' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
15+
[38, 39, 40, 42]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#dummy_app calls 'options.trust_root' 4 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
16+
[89, 90]:DuplicateMethodCall: OmniAuth::Strategies::OpenID#get_identifier calls 'options.identifier_param' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
17+
[133, 134, 135, 136, 136, 136, 137, 137, 137, 137, 138, 139, 139]:FeatureEnvy: OmniAuth::Strategies::OpenID#ax_user_info refers to 'ax' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.5.0/docs/Feature-Envy.md]
18+
[89, 90, 91]:FeatureEnvy: OmniAuth::Strategies::OpenID#get_identifier refers to 'f' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.5.0/docs/Feature-Envy.md]
19+
[122, 123, 124, 125]:FeatureEnvy: OmniAuth::Strategies::OpenID#sreg_user_info refers to 'sreg' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.5.0/docs/Feature-Envy.md]
2020
[9]:InstanceVariableAssumption: OmniAuth::Strategies::OpenID assumes too much for instance variable '@openid_response' [https://github.com/troessner/reek/blob/v6.5.0/docs/Instance-Variable-Assumption.md]
21+
[39]:ManualDispatch: OmniAuth::Strategies::OpenID#dummy_app manually dispatches method call [https://github.com/troessner/reek/blob/v6.5.0/docs/Manual-Dispatch.md]
2122
[45]:NestedIterators: OmniAuth::Strategies::OpenID#dummy_app contains iterators nested 2 deep [https://github.com/troessner/reek/blob/v6.5.0/docs/Nested-Iterators.md]
22-
[134]:NilCheck: OmniAuth::Strategies::OpenID#ax_user_info performs a nil-check [https://github.com/troessner/reek/blob/v6.5.0/docs/Nil-Check.md]
23-
[118]:NilCheck: OmniAuth::Strategies::OpenID#sreg_user_info performs a nil-check [https://github.com/troessner/reek/blob/v6.5.0/docs/Nil-Check.md]
24-
[132]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#ax_user_info has the variable name 'h' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
25-
[132, 134]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#ax_user_info has the variable name 'k' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
26-
[132, 134]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#ax_user_info has the variable name 'v' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
23+
[142]:NilCheck: OmniAuth::Strategies::OpenID#ax_user_info performs a nil-check [https://github.com/troessner/reek/blob/v6.5.0/docs/Nil-Check.md]
24+
[126]:NilCheck: OmniAuth::Strategies::OpenID#sreg_user_info performs a nil-check [https://github.com/troessner/reek/blob/v6.5.0/docs/Nil-Check.md]
25+
[34]:TooManyStatements: OmniAuth::Strategies::OpenID#dummy_app has approx 8 statements [https://github.com/troessner/reek/blob/v6.5.0/docs/Too-Many-Statements.md]
26+
[140]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#ax_user_info has the variable name 'h' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
27+
[140, 142]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#ax_user_info has the variable name 'k' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
28+
[140, 142]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#ax_user_info has the variable name 'v' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
2729
[45]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#dummy_app has the variable name 'm' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
28-
[80]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#get_identifier has the variable name 'f' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
29-
[59, 60]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#identifier has the variable name 'i' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
30-
[118]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#sreg_user_info has the variable name 'k' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
31-
[118]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#sreg_user_info has the variable name 'v' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
30+
[88]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#get_identifier has the variable name 'f' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
31+
[67, 68]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#identifier has the variable name 'i' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
32+
[126]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#sreg_user_info has the variable name 'k' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
33+
[126]:UncommunicativeVariableName: OmniAuth::Strategies::OpenID#sreg_user_info has the variable name 'v' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
3234
spec/omniauth/strategies/open_id_spec.rb -- 1 warning:
3335
[2]:TooManyStatements: app has approx 6 statements [https://github.com/troessner/reek/blob/v6.5.0/docs/Too-Many-Statements.md]
3436
.yard_gfm_support.rb -- 1 warning:
3537
[9, 9]:FeatureEnvy: KramdownGfmDocument#initialize refers to 'options' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.5.0/docs/Feature-Envy.md]
36-
31 total warnings
38+
33 total warnings

docs/_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ <h2>Namespace Listing A-Z</h2>
159159
</div>
160160

161161
<div id="footer">
162-
Generated on Sun Jun 8 13:25:41 2025 by
162+
Generated on Sun Jun 8 14:26:18 2025 by
163163
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
164164
0.9.37 (ruby-3.4.4).
165165
</div>

docs/file.CODE_OF_CONDUCT.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ <h2 id="attribution">Attribution</h2>
192192
</div></div>
193193

194194
<div id="footer">
195-
Generated on Sun Jun 8 13:25:41 2025 by
195+
Generated on Sun Jun 8 14:26:19 2025 by
196196
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
197197
0.9.37 (ruby-3.4.4).
198198
</div>

docs/file.CONTRIBUTING.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ <h3 id="to-release-a-new-version">To release a new version:</h3>
192192
</div></div>
193193

194194
<div id="footer">
195-
Generated on Sun Jun 8 13:25:41 2025 by
195+
Generated on Sun Jun 8 14:26:19 2025 by
196196
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
197197
0.9.37 (ruby-3.4.4).
198198
</div>

docs/file.README.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,22 @@ <h3 id="configured-identifiers">Configured Identifiers</h3>
254254

255255
<p>Please contribute some documentation if you have the gumption! The maintainer’s time is limited, and sometimes the authors of PRs with new options don’t update the <em>this</em> readme. 😭</p>
256256

257+
<h2 id="example">Example</h2>
258+
259+
<p>A terribly basic example of an OpenID client/server is at <code>/examples</code></p>
260+
261+
<p>In one shell run the <a href="examples/server.rb">server</a>:</p>
262+
263+
<pre class="code language-shell"><code class="language-shell">cd examples
264+
./server.rb
265+
</code></pre>
266+
267+
<p>In another shell run the <a href="examples/client.rb">client</a>:</p>
268+
269+
<pre class="code language-shell"><code class="language-shell">cd examples
270+
./client.rb
271+
</code></pre>
272+
257273
<h2 id="-security">🔐 Security</h2>
258274

259275
<p>See <a href="file.SECURITY.html" title="SECURITY.md">SECURITY.md</a>.</p>
@@ -396,7 +412,7 @@ <h2 id="-one-more-thing">🤑 One more thing</h2>
396412
</div></div>
397413

398414
<div id="footer">
399-
Generated on Sun Jun 8 13:25:41 2025 by
415+
Generated on Sun Jun 8 14:26:19 2025 by
400416
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
401417
0.9.37 (ruby-3.4.4).
402418
</div>

0 commit comments

Comments
 (0)