omniauth-mesosphere 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ddfd444ac86dbcfad41a1d9e07de5be4a51465a7
4
+ data.tar.gz: ea3ded231930f15a556f1122bd75312432b265e9
5
+ SHA512:
6
+ metadata.gz: ace5242f5041bee69def0da5d5897cd55482c753d8f66fa07518e853be34decdf37a55e1b864769acdfffc6af489aac51f29c3b583195d945ec1fa60d92fd011
7
+ data.tar.gz: 96edca4bf12fbfde17223badff0639250c6d5479946ea02cb5b8523503cbba6c4fd951a225ef5a8c0e37bc478a1bfd4e69ff4225f462107639608b2be38ca095
@@ -0,0 +1,17 @@
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
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-mesosphere.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 BC Broussard
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+
2
+ # Omniauth::Mesosphere
3
+
4
+
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'omniauth-mesosphere'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install omniauth-mesosphere
19
+
20
+ ## Usage
21
+
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,2 @@
1
+ require "omniauth-mesosphere/version"
2
+ require 'omniauth/strategies/mesosphere'
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Mesosphere
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,43 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Mesosphere < OmniAuth::Strategies::OAuth2
6
+ BASE_URL = "https://accounts.mesosphere.com"
7
+ option :name, 'mesosphere'
8
+
9
+ unless OmniAuth.config.test_mode
10
+ option :client_options, {
11
+ :authorize_path => "/oauth/authorize",
12
+ :site => BASE_URL
13
+ }
14
+ else
15
+ option :client_options, {
16
+ :authorize_path => "/oauth/authorize",
17
+ :site => "http://localhost:3001"
18
+ }
19
+ end
20
+
21
+ uid{ raw_info['id'] }
22
+
23
+ info do
24
+ {
25
+ :name => raw_info['name'],
26
+ :email => raw_info['email'],
27
+ :image => raw_info['image']
28
+ }
29
+ end
30
+
31
+ extra do
32
+ {
33
+ 'raw_info' => raw_info
34
+ }
35
+ end
36
+
37
+ def raw_info
38
+ @raw_info ||= access_token.get('/api/v1/user').parsed
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'omniauth-mesosphere/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+
8
+ spec.add_dependency 'omniauth-oauth2', '~> 1.2.0'
9
+
10
+ spec.name = "omniauth-mesosphere"
11
+ spec.version = Omniauth::Mesosphere::VERSION
12
+ spec.authors = ["BC Broussard"]
13
+ spec.email = ["bc.broussard@flyingcranes.com"]
14
+ spec.summary = spec.description
15
+ spec.description = %q{OmniAuth strategy for Mesosphere}
16
+ spec.homepage = "https://github.com/mesosphere/omniauth-mesosphere"
17
+ spec.license = "MIT"
18
+
19
+ spec.files = `git ls-files -z`.split("\x0")
20
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_development_dependency "rake"
25
+
26
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-mesosphere
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - BC Broussard
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-14 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.2.0
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.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: OmniAuth strategy for Mesosphere
42
+ email:
43
+ - bc.broussard@flyingcranes.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - lib/omniauth-mesosphere.rb
54
+ - lib/omniauth-mesosphere/version.rb
55
+ - lib/omniauth/strategies/mesosphere.rb
56
+ - omniauth-mesosphere.gemspec
57
+ homepage: https://github.com/mesosphere/omniauth-mesosphere
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.2.2
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: ''
81
+ test_files: []