omniauth-kanbox 1.0.0

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,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MTc5ODQzYmU0MDAyNTJhODM4ZTAyOTk2OTA2Y2JjMTEwMWNiYTljMg==
5
+ data.tar.gz: !binary |-
6
+ MGQ3ZjA4YWQ0MTU5ZTU1YTNhMWE4MmU5ODZkMTZiMjMzYTM2ZTJlNA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MTU5YzQ0ZDFmODUyMDhkYTc1ZmRmZDUxZjM3MmExZGYwZDFhMmE1YjI0YmJh
10
+ NmY2NGUwNDBlOWZmYjkxYzRjMDdhYzY5N2MxNjU5MjEzNTA5ZjMwYTc4MDI5
11
+ NDVmNWI1NWE4MDIyMzc5ZjQ2M2RlYmUwYjA3Y2UyOTMwNzlhNjQ=
12
+ data.tar.gz: !binary |-
13
+ MzBiNWYxYjE0N2JmMzNiMmNiNGY5NDMzOTI2NDE0ZDA1YzEyMDkyNDk3NWNj
14
+ MDk3MTU0MjNjNTgwNGJmYmJkNzE3MWY1NjQzMTA2ZDY0ZDk3NWQyOGRhMzhh
15
+ NjJmZDI2ZjcwODQwMDc1M2EwNjBmNzBlNTgwOTY5Y2Y0ZDBhMmU=
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-workxp.gemspec
4
+ gemspec
@@ -0,0 +1,53 @@
1
+ =======
2
+ omniauth-workxp
3
+ ===============
4
+
5
+ Unofficial OmniAuth strategy for Kanbox.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'omniauth-kanbox'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install omniauth-kanbox
20
+
21
+ ## Usage
22
+ Example with devise:
23
+
24
+ #### routes:
25
+ devise_for :users, :controllers => { omniauth_callbacks: "omniauth_callbacks"}
26
+ #### user.rb:
27
+ open omniauthable in devise:
28
+ devise :omniauthable
29
+ #### controller:
30
+ rails g controller omniauth_callbacks --skip-helper --skip-assets
31
+ class OmniauthCallbacksController < ApplicationController
32
+ def all
33
+ auth = request.env["omniauth.auth"]
34
+ raise auth.to_yaml
35
+ end
36
+
37
+ alias_method :kanbox, :all
38
+ end
39
+ #### devise.rb:
40
+ config.omniauth :kanbox, 'a9acabbfd9be74d4f77d2227b7621e18c7ba6290d87459801014039f8af63290', '0deb222c9602cedefc7ba17f6820e5c926e20bc9113406ec8fd71fff678189f0'
41
+
42
+ #### views:
43
+ <%= link_to "login by kanbox", http://lvh.me:3000/users/auth/kanbox %>
44
+
45
+
46
+ ## Contributing
47
+
48
+ 1. Fork it
49
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
50
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
51
+ 4. Push to the branch (`git push origin my-new-feature`)
52
+ 5. Create new Pull Request
53
+
@@ -0,0 +1,2 @@
1
+ require "omniauth-kanbox/version"
2
+ require 'omniauth/strategies/kanbox'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Kanbox
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,37 @@
1
+ require 'omniauth-oauth'
2
+ require 'multi_json'
3
+
4
+ module OmniAuth
5
+ module Strategies
6
+ class Kanbox < OmniAuth::Strategies::OAuth
7
+ option :name, 'kanbox'
8
+
9
+ option :client_options, {
10
+ :authorize_path => '/0/auth',
11
+ :site => 'https://auth.kanbox.com',
12
+ :token_url => "/0/token",
13
+ }
14
+
15
+ uid { raw_info['email'] }
16
+
17
+ info do
18
+ {
19
+ :name => raw_info['email']
20
+ :email => raw_info['email']
21
+ }
22
+ end
23
+
24
+ extra do
25
+ {
26
+ :raw_info => raw_info
27
+ }
28
+ end
29
+
30
+ def raw_info
31
+ @raw_info ||= access_token.get('0/info').parsed
32
+ end
33
+
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "omniauth-kanbox/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "omniauth-kanbox"
7
+ s.version = OmniAuth::Kanbox::VERSION
8
+ s.authors = ["YuanPing"]
9
+ s.email = ["yp.xjgz@gmail.com"]
10
+ s.homepage = "https://github.com/yuanping/omniauth-kanbox"
11
+ s.summary = %q{OmniAuth strategy for Kanbox}
12
+ s.description = %q{OmniAuth strategy for Kanbox}
13
+ s.license = "MIT"
14
+
15
+ s.rubyforge_project = "omniauth-kanbox"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_dependency 'omniauth', '~> 1.2'
23
+ s.add_dependency 'omniauth-oauth2', '~> 1.1'
24
+ s.add_development_dependency 'rspec', '~> 2.7'
25
+ s.add_development_dependency 'rack-test'
26
+ s.add_development_dependency 'simplecov'
27
+ s.add_development_dependency 'webmock'
28
+ end
metadata ADDED
@@ -0,0 +1,134 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-kanbox
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - YuanPing
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-29 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: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '2.7'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '2.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rack-test
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: webmock
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: OmniAuth strategy for Kanbox
98
+ email:
99
+ - yp.xjgz@gmail.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - Gemfile
105
+ - README.md
106
+ - lib/omniauth-kanbox.rb
107
+ - lib/omniauth-kanbox/version.rb
108
+ - lib/omniauth/strategies/kanbox.rb
109
+ - omniauth-kanbox.gemspec
110
+ homepage: https://github.com/yuanping/omniauth-kanbox
111
+ licenses:
112
+ - MIT
113
+ metadata: {}
114
+ post_install_message:
115
+ rdoc_options: []
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ requirements: []
129
+ rubyforge_project: omniauth-kanbox
130
+ rubygems_version: 2.1.11
131
+ signing_key:
132
+ specification_version: 4
133
+ summary: OmniAuth strategy for Kanbox
134
+ test_files: []