omniauth-oyoh 0.0.1

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: 8c7d1059cd83727c5639b0e278d2c296ac381a7f
4
+ data.tar.gz: 2949039b6387c523669195503525d2ea7988419c
5
+ SHA512:
6
+ metadata.gz: 18864b1473bf88596ae4687fc839bc2cdafc285d2ce9bae0a832aaa10205763e1978de898cf30716d411b965b11770ac45ac24eccfe21eaedc300ff568aaa0a5
7
+ data.tar.gz: 247d95d086e7d94c44109ff2f65375ee9da8382e36ccce86b4b11580da9c21d972955bcc2665471c0002169b0f9a2d9abac97aa64eab16bd8617a83c2d4bea1f
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ coverage/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in omniauth-singly.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # OmniAuth OYOH - Own Your Own Health
2
+
3
+ ## Basic Usage
4
+
5
+ ### Rails
6
+
7
+ Rails.application.config.middleware.use OmniAuth::Builder do
8
+ provider :oyoh, ENV['SINGLY_ID'], ENV['SINGLY_SECRET']
9
+ end
10
+
11
+ ### Sinatra
12
+
13
+ use OmniAuth::Builder do
14
+ provider :oyoh, ENV['SINGLY_ID'], ENV['SINGLY_SECRET']
15
+ end
16
+
17
+ ### Devise
18
+
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
4
+
5
+ desc 'Default: run specs.'
6
+ task :default => :spec
7
+
8
+ desc "Run specs"
9
+ RSpec::Core::RakeTask.new
10
+
11
+ desc 'Run specs'
12
+ task :default => :spec
@@ -0,0 +1,2 @@
1
+ require "omniauth-dhh/version"
2
+ require "omniauth/strategies/dhh"
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Oyoh
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,33 @@
1
+ require "omniauth-oauth2"
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Oyoh < OmniAuth::Strategies::OAuth2
6
+ option :name, :oyoh
7
+
8
+ option :client_options, {
9
+ :site => "https://cajuncodefest.dhh.la.gov",
10
+ :authorize_url => "https://cajuncodefest.dhh.la.gov/oauth/authenticate",
11
+ :token_url => "https://cajuncodefest.dhh.la.gov/oauth/access_token"
12
+ }
13
+
14
+ uid do
15
+ raw_info["patient"]["patient_id"]
16
+ end
17
+
18
+ info do
19
+ {
20
+ :first_name => raw_info["patient"]["first_name"],
21
+ :last_name => raw_info["patient"]["last_name"],
22
+ :gender => raw_info["patient"]["gender"],
23
+ :date_of_birth => raw_info["patient"]["date_of_birth"]
24
+ }
25
+ end
26
+
27
+ def raw_info
28
+ @raw_info ||= access_token.get('/api/v1/me.json').parsed
29
+ end
30
+
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "omniauth-oyoh/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "omniauth-oyoh"
7
+ s.version = Omniauth::Oyoh::VERSION
8
+ s.authors = ["Reza Jelveh"]
9
+ s.email = ["reza@louisiana.edu"]
10
+ s.homepage = "https://github.com/fishman/omniauth-oyoh"
11
+ s.summary = %q{Official DHH Codefest strategy for OmniAuth}
12
+ s.description = %q{Official DHH Codefest (Own Your Own Health) strategy for OmniAuth}
13
+
14
+ s.rubyforge_project = "omniauth-dhh"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency 'omniauth', '~> 1.0'
22
+ s.add_dependency 'omniauth-oauth2', '~> 1.0'
23
+ s.add_development_dependency 'rspec', '~> 2.7'
24
+ s.add_development_dependency 'rack-test'
25
+ s.add_development_dependency 'simplecov'
26
+ s.add_development_dependency 'webmock'
27
+ end
@@ -0,0 +1,24 @@
1
+ require "spec_helper"
2
+
3
+ describe OmniAuth::Strategies::Oyoh do
4
+ subject do
5
+ OmniAuth::Strategies::Oyoh.new({})
6
+ end
7
+
8
+ context "client_options" do
9
+ it "uses the correct site" do
10
+ subject.options.client_options.site.
11
+ should == "https://cajuncodefest.dhh.la.gov"
12
+ end
13
+
14
+ it "uses the correct authorize_url" do
15
+ subject.options.client_options.authorize_url.
16
+ should == "https://cajuncodefest.dhh.la.gov/oauth/authenticate"
17
+ end
18
+
19
+ it "uses the correct token_url" do
20
+ subject.options.client_options.token_url.
21
+ should == "https://cajuncodefest.dhh.la.gov/oauth/access_token"
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,16 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'simplecov'
4
+ SimpleCov.start
5
+ require 'rspec'
6
+ require 'rack/test'
7
+ require 'webmock/rspec'
8
+ require 'omniauth'
9
+ require 'omniauth-singly'
10
+
11
+ RSpec.configure do |config|
12
+ config.include WebMock::API
13
+ config.include Rack::Test::Methods
14
+ config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
15
+ end
16
+
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-oyoh
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Reza Jelveh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-04-24 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.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.0'
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.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
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: Official DHH Codefest (Own Your Own Health) strategy for OmniAuth
98
+ email:
99
+ - reza@louisiana.edu
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - .gitignore
105
+ - Gemfile
106
+ - README.md
107
+ - Rakefile
108
+ - lib/omniauth-oyoh.rb
109
+ - lib/omniauth-oyoh/version.rb
110
+ - lib/omniauth/strategies/oyoh.rb
111
+ - omniauth-oyoh.gemspec
112
+ - spec/omniauth/strategies/oyoh_spec.rb
113
+ - spec/spec_helper.rb
114
+ homepage: https://github.com/fishman/omniauth-oyoh
115
+ licenses: []
116
+ metadata: {}
117
+ post_install_message:
118
+ rdoc_options: []
119
+ require_paths:
120
+ - lib
121
+ required_ruby_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ required_rubygems_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - '>='
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ requirements: []
132
+ rubyforge_project: omniauth-dhh
133
+ rubygems_version: 2.0.0
134
+ signing_key:
135
+ specification_version: 4
136
+ summary: Official DHH Codefest strategy for OmniAuth
137
+ test_files:
138
+ - spec/omniauth/strategies/oyoh_spec.rb
139
+ - spec/spec_helper.rb