omniauth-mspcfo 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 303005f3a21f5921e886e2c33ad5a6aa3d8607b5
4
+ data.tar.gz: 516141aec87bf00b6c10f785099d6fc7426c29e1
5
+ SHA512:
6
+ metadata.gz: 511888e2397b57461da8fca18ed8f2ea95b3eb34661a87f139c81c2112ff2696f8f13223e65155456034999f2d4ad5865d082f57eb4c2542ff6a06fb401b703b
7
+ data.tar.gz: 160705f96fed9ee733bbc651b0615f947854c7326a215e70bd3b4c27b396e071a52ac52f77c47f364d39fd31a0a74610e1982451993f2462202dc15a4ba469a4
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.swp
@@ -0,0 +1,48 @@
1
+ Layout/AccessModifierIndentation:
2
+ EnforcedStyle: outdent
3
+
4
+ Layout/SpaceInsideHashLiteralBraces:
5
+ EnforcedStyle: no_space
6
+
7
+ Metrics/BlockNesting:
8
+ Max: 2
9
+
10
+ Metrics/LineLength:
11
+ AllowURI: true
12
+ Enabled: false
13
+
14
+ Metrics/MethodLength:
15
+ CountComments: false
16
+ Max: 10
17
+
18
+ Metrics/ParameterLists:
19
+ Max: 4
20
+ CountKeywordArgs: true
21
+
22
+ Style/CollectionMethods:
23
+ PreferredMethods:
24
+ map: 'collect'
25
+ reduce: 'inject'
26
+ find: 'detect'
27
+ find_all: 'select'
28
+
29
+ Style/Documentation:
30
+ Enabled: false
31
+
32
+ Style/DoubleNegation:
33
+ Enabled: false
34
+
35
+ Style/HashSyntax:
36
+ EnforcedStyle: hash_rockets
37
+
38
+ Style/StderrPuts:
39
+ Enabled: false
40
+
41
+ Style/StringLiterals:
42
+ EnforcedStyle: double_quotes
43
+
44
+ Style/TrailingCommaInArguments:
45
+ EnforcedStyleForMultiline: comma
46
+
47
+ Style/TrailingCommaInLiteral:
48
+ EnforcedStyleForMultiline: comma
data/Gemfile ADDED
@@ -0,0 +1,19 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "rake", "~> 12.0"
4
+
5
+ group :test do
6
+ gem "addressable", "~> 2.3.8", :platforms => %i[jruby ruby_18]
7
+ gem "coveralls"
8
+ gem "json", :platforms => %i[jruby ruby_18 ruby_19]
9
+ gem "mime-types", "~> 1.25", :platforms => %i[jruby ruby_18]
10
+ gem "rack-test"
11
+ gem "rest-client", "~> 1.7.3", :platforms => %i[jruby ruby_18]
12
+ gem "rspec", "~> 3.2"
13
+ gem "rubocop", ">= 0.51", :platforms => %i[ruby_19 ruby_20 ruby_21 ruby_22 ruby_23 ruby_24]
14
+ gem "simplecov", ">= 0.9"
15
+ gem "webmock", "~> 3.0"
16
+ end
17
+
18
+ # Specify your gem's dependencies in omniauth-oauth2.gemspec
19
+ gemspec
@@ -0,0 +1,19 @@
1
+ # OmniAuth MSPCFO OAuth2
2
+
3
+ This is the OmniAuth OAuth2 strategy for authentication to [MSPCFO](https://www.mspcfo.com).
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'omniauth-mspcfo'
11
+ ```
12
+
13
+ And then, you need to add the following to your `config/initializers/omniauth.rb`:
14
+
15
+ ```ruby
16
+ Rails.application.config.middleware.use OmniAuth::Builder do
17
+ provider :mspcfo, ENV['MSPCFO_KEY'], ENV['MSPCFO_SECRET']
18
+ end
19
+ ```
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+ require "rspec/core/rake_task"
4
+
5
+ RSpec::Core::RakeTask.new
6
+
7
+ task :test => :spec
8
+
9
+ begin
10
+ require "rubocop/rake_task"
11
+ RuboCop::RakeTask.new
12
+ rescue LoadError
13
+ task :rubocop do
14
+ $stderr.puts "RuboCop is disabled"
15
+ end
16
+ end
17
+
18
+ task :default => %i[spec rubocop]
@@ -0,0 +1,2 @@
1
+ require 'omniauth/mspcfo/version'
2
+ require 'omniauth/strategies/mspcfo'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Mspcfo
3
+ VERSION = "0.0.1".freeze
4
+ end
5
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth-oauth2'
4
+
5
+ module OmniAuth
6
+ module Strategies
7
+ class Mspcfo < OmniAuth::Strategies::OAuth2
8
+ option :name, 'mspcfo'
9
+
10
+ option :client_options, site: 'https://app.mspcfo.com'
11
+
12
+ uid { raw_info['id'] }
13
+
14
+ info do
15
+ {
16
+ name: raw_info['name'],
17
+ email: raw_info['email']
18
+ }
19
+ end
20
+
21
+ extra do
22
+ {
23
+ raw_info: raw_info
24
+ }
25
+ end
26
+
27
+ def raw_info
28
+ @raw_info ||= if (resp = access_token.get('/me').parsed)
29
+ resp['data'] || {}
30
+ else
31
+ {}
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,24 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "omniauth/mspcfo/version"
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.authors = ['Kevin Pheasey']
7
+ gem.email = ['kevin@kpsoftware.io']
8
+ gem.description = "An OmniAuth OAuth2 strategy for MSPCFO."
9
+ gem.summary = gem.description
10
+ gem.homepage = "https://github.com/mspcfo/omniauth-mspcfo"
11
+ gem.licenses = %w[MIT]
12
+
13
+ gem.executables = `git ls-files -- bin/*`.split("\n").collect { |f| File.basename(f) }
14
+ gem.files = `git ls-files`.split("\n")
15
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ gem.name = "omniauth-mspcfo"
17
+ gem.require_paths = %w[lib]
18
+ gem.version = OmniAuth::Mspcfo::VERSION
19
+
20
+ gem.add_runtime_dependency 'omniauth', '~> 1.2'
21
+ gem.add_runtime_dependency 'omniauth-oauth2', '~> 1.1'
22
+
23
+ gem.add_development_dependency "bundler", "~> 1.0"
24
+ end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-mspcfo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kevin Pheasey
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-06-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: omniauth-oauth2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ description: An OmniAuth OAuth2 strategy for MSPCFO.
56
+ email:
57
+ - kevin@kpsoftware.io
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rubocop.yml"
64
+ - Gemfile
65
+ - README.md
66
+ - Rakefile
67
+ - lib/omniauth-mspcfo.rb
68
+ - lib/omniauth/mspcfo/version.rb
69
+ - lib/omniauth/strategies/mspcfo.rb
70
+ - omniauth-mspcfo.gemspec
71
+ homepage: https://github.com/mspcfo/omniauth-mspcfo
72
+ licenses:
73
+ - MIT
74
+ metadata: {}
75
+ post_install_message:
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubyforge_project:
91
+ rubygems_version: 2.6.14
92
+ signing_key:
93
+ specification_version: 4
94
+ summary: An OmniAuth OAuth2 strategy for MSPCFO.
95
+ test_files: []