omniauth-path 0.1.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d523a74d7979c569d3fdbf896586f69bef40bb3f
4
+ data.tar.gz: fdde227cd9c55a59d9513646045465ccae932ddc
5
+ SHA512:
6
+ metadata.gz: 5a8e6f4b954cd3ac8643ab6a161b3bc5e366604af752d5665b0742ccc50d34841ebfbbc67d452b6e6a8da468e4aa0dbbe2b368eb3bfbcb6f7f665d4389caf430
7
+ data.tar.gz: 5f14fa5b710fb1518f477d971d3317fda480550fe7da8300de666660839447dec2c4b2bc63e4b72147e9a947f7936d57a84f5bfba4555d6a66faee47721b29f2
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/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-path.gemspec
4
+ gemspec
5
+
6
+ group :example do
7
+ gem 'sinatra'
8
+ end
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # OmniAuth Path Strategy
2
+
3
+ Strategy to auth with Path via OmniAuth
4
+
5
+ Get you API Key at https://path.com/developers
6
+
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'omniauth-path'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install omniauth-path
23
+
24
+ ## Usage
25
+
26
+ ```ruby
27
+ Rails.application.config.middleware.use OmniAuth::Builder do
28
+ provider :path, ENV["PATH_API_KEY"], ENV["PATH_API_SECRET"]
29
+ end
30
+ ```
31
+
32
+ ## Development
33
+
34
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
35
+
36
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
37
+
38
+ ## Contributing
39
+
40
+ 1. Fork it ( https://github.com/[my-github-username]/omniauth-path/fork )
41
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
42
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
43
+ 4. Push to the branch (`git push origin my-new-feature`)
44
+ 5. Create a new Pull Request
45
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "omniauth/path"
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,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,8 @@
1
+ require "omniauth/path/version"
2
+ require File.join('omniauth', 'strategies', 'path')
3
+
4
+ module Omniauth
5
+ module Path
6
+ # Your code goes here...
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Path
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,34 @@
1
+ require 'omniauth/strategies/oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Path < OmniAuth::Strategies::OAuth2
6
+
7
+ option :name, 'path'
8
+
9
+ option :client_options, {
10
+ :site => 'https://partner.path.com',
11
+ :authorize_url => '/oauth2/authenticate',
12
+ :token_url => '/oauth2/access_token'
13
+ }
14
+
15
+ uid do
16
+ raw_info['user']['id']
17
+ end
18
+
19
+ info do
20
+ user = raw_info['user']
21
+ {
22
+ name: user['name'],
23
+ email: user['email'],
24
+ photo: user['photo']
25
+ }
26
+ end
27
+
28
+ def raw_info
29
+ @raw_info ||= access_token.get('https://partner.path.com/1/user/self').parsed
30
+ end
31
+
32
+ end
33
+ end
34
+ 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/path/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "omniauth-path"
8
+ spec.version = Omniauth::Path::VERSION
9
+ spec.authors = ["Kento Moriwaki"]
10
+ spec.email = ["kento@wantedly.com"]
11
+
12
+ spec.summary = %q{A Path OAuth2 strategy for OmniAuth 1.x}
13
+ spec.description = %q{A Path OAuth2 strategy for OmniAuth 1.x}
14
+ spec.homepage = "https://github.com/KentoMoriwaki/omniauth-path"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "bin"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency 'omniauth', '>=1.1.1'
22
+ spec.add_runtime_dependency 'omniauth-oauth2', '>= 1.1.1'
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.8"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ end
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-path
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Kento Moriwaki
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-19 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.1.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.1.1
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.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.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.8'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ description: A Path OAuth2 strategy for OmniAuth 1.x
70
+ email:
71
+ - kento@wantedly.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - README.md
79
+ - Rakefile
80
+ - bin/console
81
+ - bin/setup
82
+ - lib/omniauth/path.rb
83
+ - lib/omniauth/path/version.rb
84
+ - lib/omniauth/strategies/path.rb
85
+ - omniauth-path.gemspec
86
+ homepage: https://github.com/KentoMoriwaki/omniauth-path
87
+ licenses: []
88
+ metadata: {}
89
+ post_install_message:
90
+ rdoc_options: []
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ requirements: []
104
+ rubyforge_project:
105
+ rubygems_version: 2.2.2
106
+ signing_key:
107
+ specification_version: 4
108
+ summary: A Path OAuth2 strategy for OmniAuth 1.x
109
+ test_files: []
110
+ has_rdoc: