Skip to content

Commit

Permalink
append acct: scheme for email input
Browse files Browse the repository at this point in the history
also close nov#5
  • Loading branch information
nov committed Oct 15, 2013
1 parent d1eaafc commit 593e5d4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ tmtags
coverage*
rdoc
pkg
Gemfile.lock

## PROJECT::SPECIFIC
4 changes: 3 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Copyright (c) 2011 nov matake

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
Expand All @@ -17,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 3 additions & 1 deletion lib/openid_connect/discovery/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ def issuer

def self.discover!(identifier)
resource = case identifier
when /^acct:/, /@/, /^https?:\/\//
when /^acct:/, /https?:\/\//
identifier
when /@/
"acct:#{identifier}"
else
"https://#{identifier}"
end
Expand Down
2 changes: 2 additions & 0 deletions openid_connect.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Gem::Specification.new do |s|
s.homepage = "https://github.com/nov/openid_connect"
s.summary = %q{OpenID Connect Server & Client Library}
s.description = %q{OpenID Connect Server & Client Library}
s.license = 'MIT'

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
Expand Down
2 changes: 1 addition & 1 deletion spec/openid_connect/discovery/provider_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

context 'when Email is given' do
let(:identifier) { "nov@#{host}" }
let(:resource) { identifier }
let(:resource) { "acct:#{identifier}" }
it_behaves_like :discover_provider
end

Expand Down

0 comments on commit 593e5d4

Please sign in to comment.