forked from lackstein/omniauth-discourse
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First commit modeled after OmniAuth OAuth strategy
- Loading branch information
0 parents
commit 1943c20
Showing
9 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
*.gem | ||
*.rbc | ||
.bundle | ||
.config | ||
.yardoc | ||
Gemfile.lock | ||
InstalledFiles | ||
_yardoc | ||
coverage | ||
doc/ | ||
lib/bundler/man | ||
pkg | ||
rdoc | ||
spec/reports | ||
test/tmp | ||
test/version_tmp | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Metrics/AbcSize: | ||
Enabled: false | ||
|
||
Metrics/BlockNesting: | ||
Max: 2 | ||
|
||
Metrics/LineLength: | ||
AllowURI: true | ||
Enabled: false | ||
|
||
Metrics/MethodLength: | ||
CountComments: false | ||
Max: 10 | ||
|
||
Metrics/ParameterLists: | ||
Max: 4 | ||
CountKeywordArgs: true | ||
|
||
Style/AccessModifierIndentation: | ||
EnforcedStyle: outdent | ||
|
||
Style/CollectionMethods: | ||
PreferredMethods: | ||
map: 'collect' | ||
reduce: 'inject' | ||
find: 'detect' | ||
find_all: 'select' | ||
|
||
Style/Documentation: | ||
Enabled: false | ||
|
||
Style/DotPosition: | ||
EnforcedStyle: trailing | ||
|
||
Style/DoubleNegation: | ||
Enabled: false | ||
|
||
Style/FileName: | ||
Exclude: | ||
- 'lib/omniauth-oauth.rb' | ||
|
||
Style/HashSyntax: | ||
EnforcedStyle: hash_rockets | ||
|
||
Style/Lambda: | ||
Enabled: false | ||
|
||
Style/SpaceInsideHashLiteralBraces: | ||
EnforcedStyle: no_space | ||
|
||
Style/StringLiterals: | ||
EnforcedStyle: double_quotes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
source "http://rubygems.org" | ||
|
||
gemspec | ||
|
||
gem "rake" | ||
|
||
group :test do | ||
gem "rack-test" | ||
gem "rspec", "~> 3.2" | ||
gem "rubocop", ">= 0.30", :platforms => [:ruby_19, :ruby_20, :ruby_21, :ruby_22] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# OmniAuth Discourse | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env rake | ||
require "bundler/gem_tasks" | ||
require "rspec/core/rake_task" | ||
|
||
RSpec::Core::RakeTask.new | ||
|
||
begin | ||
require "rubocop/rake_task" | ||
RuboCop::RakeTask.new | ||
rescue LoadError | ||
task :rubocop do | ||
$stderr.puts "Rubocop is disabled" | ||
end | ||
end | ||
|
||
task :default => [:spec, :rubocop] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require "omniauth-discourse/version" | ||
require "omniauth/strategies/discourse" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module OmniAuth | ||
module Discourse | ||
VERSION = "1.0.0" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "omniauth" | ||
|
||
module OmniAuth | ||
module Strategies | ||
class Discourse | ||
include OmniAuth::Strategy | ||
|
||
args [:sso_url, :sso_secret] | ||
option :sso_url, nil | ||
option :sso_secret, nil | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require File.expand_path("../lib/omniauth-discourse/version", __FILE__) | ||
|
||
Gem::Specification.new do |gem| | ||
gem.authors = ["Noah Lackstein"] | ||
gem.email = ["[email protected]"] | ||
gem.description = "A generic strategy for OmniAuth to authenticate against Discourse forum's SSO." | ||
gem.summary = gem.description | ||
gem.homepage = "https://github.com/lackstein/omniauth-discourse" | ||
gem.license = "MIT" | ||
|
||
gem.add_dependency "omniauth", "~> 1.0" | ||
gem.add_development_dependency "bundler", "~> 1.9" | ||
|
||
gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) } | ||
gem.files = `git ls-files`.split("\n") | ||
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") | ||
gem.name = "omniauth-discourse" | ||
gem.require_paths = ["lib"] | ||
gem.version = OmniAuth::Discourse::VERSION | ||
end |