Skip to content

Commit 593e5d4

Browse files
author
nov
committed
append acct: scheme for email input
also close #5
1 parent d1eaafc commit 593e5d4

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ tmtags
1717
coverage*
1818
rdoc
1919
pkg
20+
Gemfile.lock
2021

2122
## PROJECT::SPECIFIC

LICENSE

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Copyright (c) 2011 nov matake
22

3+
MIT License
4+
35
Permission is hereby granted, free of charge, to any person obtaining
46
a copy of this software and associated documentation files (the
57
"Software"), to deal in the Software without restriction, including
@@ -17,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1719
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1820
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1921
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

lib/openid_connect/discovery/provider.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ def issuer
1111

1212
def self.discover!(identifier)
1313
resource = case identifier
14-
when /^acct:/, /@/, /^https?:\/\//
14+
when /^acct:/, /https?:\/\//
1515
identifier
16+
when /@/
17+
"acct:#{identifier}"
1618
else
1719
"https://#{identifier}"
1820
end

openid_connect.gemspec

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Gem::Specification.new do |s|
66
s.homepage = "https://github.com/nov/openid_connect"
77
s.summary = %q{OpenID Connect Server & Client Library}
88
s.description = %q{OpenID Connect Server & Client Library}
9+
s.license = 'MIT'
10+
911
s.files = `git ls-files`.split("\n")
1012
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
1113
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }

spec/openid_connect/discovery/provider_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
context 'when Email is given' do
5353
let(:identifier) { "nov@#{host}" }
54-
let(:resource) { identifier }
54+
let(:resource) { "acct:#{identifier}" }
5555
it_behaves_like :discover_provider
5656
end
5757

0 commit comments

Comments
 (0)