omniauth-litmus 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 877d73ade9f6ee1a13b30f6959fd1233b1119a79
4
+ data.tar.gz: 33e1e5295d2b477c796fa2632442481a99be2d48
5
+ SHA512:
6
+ metadata.gz: 255914cd28d4520700c58b38f5a843156405365607e6401d5068f404bad048e4f8e38a1cfa72f7271913bf717921df01948e592dcef7e5ba6341f7b6e4dac387
7
+ data.tar.gz: 5fbc0d1589656e0602c82a795598bcabb0d054c4c9999b3b9bf99d8dc91df059d0d780727fb87049794fb8bd61069545d62235f302520680e2a647366d4ced15
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ before_install: gem install bundler -v 1.12.5
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-litmus.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Litmus Software, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # OmniAuth Litmus
2
+
3
+ This is the official OmniAuth strategy for authenticating against Litmus. To
4
+ use it, you'll need an OAuth2 Application ID and Secret, until this is available
5
+ from within Litmus, please request this via resellers@litmus.com
6
+
7
+ ## Usage
8
+
9
+ use OmniAuth::Builder do
10
+ provider :litmus, ENV['LITMUS_APP_ID'], ENV['LITMUS_SECRET']
11
+ end
12
+
13
+ ## License
14
+
15
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
16
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "omniauth/litmus"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Litmus
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require "omniauth/litmus/version"
2
+ require "omniauth/strategies/litmus"
@@ -0,0 +1,28 @@
1
+ require "omniauth-oauth2"
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Litmus < OmniAuth::Strategies::OAuth2
6
+ option :name, "litmus"
7
+ option :client_options, {
8
+ site: ENV["LITMUS_OAUTH_HOST"] || "https://litmus.com"
9
+ }
10
+
11
+ uid { raw_info["id"].to_s }
12
+ info do
13
+ {
14
+ "name" => raw_info["full_name"],
15
+ "first_name" => raw_info["first_name"],
16
+ "last_name" => raw_info["last_name"]
17
+ }
18
+ end
19
+
20
+ def raw_info
21
+ access_token.options[:mode] = :query
22
+ @raw_info ||= access_token.
23
+ get("https://api.litmus.com/v2/users/current").
24
+ parsed["user"]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'omniauth/litmus/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "omniauth-litmus"
8
+ spec.version = Omniauth::Litmus::VERSION
9
+ spec.authors = ["Rahim Packir Saibo"]
10
+ spec.email = ["rahim@litmus.com"]
11
+
12
+ spec.summary = %q{Official OmniAuth strategy for Litmus}
13
+ spec.description = %q{Official OmniAuth strategy for Litmus}
14
+ spec.homepage = "https://github.com/litmus/omniauth-litmus"
15
+ spec.license = "MIT"
16
+
17
+ spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ spec.files = `git ls-files`.split("\n")
19
+ spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ spec.name = "omniauth-litmus"
21
+ spec.require_paths = ["lib"]
22
+
23
+ # Waiting on fix for https://github.com/intridea/omniauth-oauth2/issues/81
24
+ # Before rolling on to >= 1.4.x
25
+ # Essentially Doorkeeper and omniauth don't play well together with OAuth
26
+ # state param
27
+ spec.add_dependency 'omniauth-oauth2', '>= 1.1.1', '< 1.4.0'
28
+
29
+ spec.add_development_dependency "bundler", "~> 1.12"
30
+ spec.add_development_dependency "rake", "~> 10.0"
31
+ spec.add_development_dependency "rspec", "~> 3.0"
32
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Omniauth::Litmus do
4
+ it 'has a version number' do
5
+ expect(Omniauth::Litmus::VERSION).not_to be nil
6
+ end
7
+ end
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'omniauth/litmus'
metadata ADDED
@@ -0,0 +1,125 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-litmus
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Rahim Packir Saibo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-06-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth-oauth2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.1.1
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 1.4.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 1.1.1
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 1.4.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.12'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.12'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '10.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '10.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rspec
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '3.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.0'
75
+ description: Official OmniAuth strategy for Litmus
76
+ email:
77
+ - rahim@litmus.com
78
+ executables:
79
+ - console
80
+ - setup
81
+ extensions: []
82
+ extra_rdoc_files: []
83
+ files:
84
+ - ".gitignore"
85
+ - ".rspec"
86
+ - ".travis.yml"
87
+ - Gemfile
88
+ - LICENSE.txt
89
+ - README.md
90
+ - Rakefile
91
+ - bin/console
92
+ - bin/setup
93
+ - lib/omniauth/litmus.rb
94
+ - lib/omniauth/litmus/version.rb
95
+ - lib/omniauth/strategies/litmus.rb
96
+ - omniauth-litmus.gemspec
97
+ - spec/omniauth/litmus_spec.rb
98
+ - spec/spec_helper.rb
99
+ homepage: https://github.com/litmus/omniauth-litmus
100
+ licenses:
101
+ - MIT
102
+ metadata: {}
103
+ post_install_message:
104
+ rdoc_options: []
105
+ require_paths:
106
+ - lib
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ requirements: []
118
+ rubyforge_project:
119
+ rubygems_version: 2.5.1
120
+ signing_key:
121
+ specification_version: 4
122
+ summary: Official OmniAuth strategy for Litmus
123
+ test_files:
124
+ - spec/omniauth/litmus_spec.rb
125
+ - spec/spec_helper.rb