omniauth-wistia 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef55da8bb520cacda20dea1f4e126d6ba440cf726989787ff65f5f87d3ce9f54
4
- data.tar.gz: dc0d1212aec184ddc2a12fda9dc870071243dad20d6502e17038ed4e372d2a8b
3
+ metadata.gz: f1a301fddb41a520fe57b528518fd40de15e3f8be58e93a39d87e64361ff97f6
4
+ data.tar.gz: 87ba89eb9881531283d1e6b41c859ec50a5c564a630fb75fc9c649f1010e11ee
5
5
  SHA512:
6
- metadata.gz: 6dad91e721ce75c46a7a593a1c720fc2e1d7037cc7a9db5494707b1d74990179068ed96ff24fc003111f8e4766c7bf6c15bb2cd7310f709e4eb02a8b334cea9e
7
- data.tar.gz: 9e3afea588ef2803c48c30a496a9642a3daeac9cedbd58094eeef7938aa9b223091fd9a369e40fa1c07d2e172f7f9b636a0b86dcc46fb14ab8a21ab555fbbbcd
6
+ metadata.gz: f40fa6db2af447e33d067aeaa086da9f7dde605fd1b31553bdcb57c187eff9e9727e1714536386b6fc80309abd6398d5dd1fa430727ed810e6b9b6e26fe2cebc
7
+ data.tar.gz: 11aa30380febf5fceed2d6a3d7f860c4c8e9cca28c6df7f33b707296260dad6a3805c73a109dbdaa4aacc3776d92e68cdb5674e91325f193d4072dd7ae1c17ec
@@ -0,0 +1,10 @@
1
+ ### Unreleased
2
+
3
+ ### 0.1.1
4
+
5
+ * Fix callback url
6
+ * Setup uid, info, and raw_info to include as many details as we get back
7
+
8
+ ### 0.1.0
9
+
10
+ * Initial release
data/Rakefile CHANGED
@@ -7,4 +7,4 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.test_files = FileList["test/**/*_test.rb"]
8
8
  end
9
9
 
10
- task :default => :test
10
+ task default: :test
@@ -1,37 +1,49 @@
1
- require 'omniauth-oauth2'
2
- require 'multi_json'
1
+ require "omniauth-oauth2"
2
+ require "multi_json"
3
3
 
4
4
  module OmniAuth
5
5
  module Strategies
6
6
  class Wistia < OmniAuth::Strategies::OAuth2
7
- DEFAULT_SCOPE = 'all:all'
7
+ DEFAULT_SCOPE = "all:all"
8
8
 
9
- option :name, 'wistia'
9
+ option :name, "wistia"
10
10
 
11
11
  option :client_options, {
12
- :site => 'https://api.wistia.com',
13
- :authorize_path => '/oauth/authorize',
14
- :token_url => '/oauth/token',
12
+ site: "https://api.wistia.com",
13
+ authorize_path: "/oauth/authorize",
14
+ token_url: "/oauth/token"
15
15
  }
16
16
 
17
+ uid do
18
+ raw_info["id"]
19
+ end
20
+
21
+ info do
22
+ {
23
+ name: raw_info["name"],
24
+ email: request.params["contact_email"],
25
+ urls: {
26
+ account: raw_info["url"]
27
+ }
28
+ }
29
+ end
30
+
17
31
  extra do
18
32
  {
19
- 'raw_info' => raw_info
33
+ "raw_info" => raw_info.merge(request.params.slice("contact_id", "contact_email"))
20
34
  }
21
35
  end
22
36
 
23
37
  def raw_info
24
- @raw_info ||= access_token.get('https://api.wistia.com/v1/account.json').parsed
38
+ @raw_info ||= access_token.get("https://api.wistia.com/v1/account.json").parsed
25
39
  end
26
40
 
27
41
  protected
28
42
 
29
- def build_access_token
30
- verifier = request.params["code"]
31
- params = {:redirect_uri => callback_url, :state => request.params["state"], :client_id => client.id, :client_secret => client.secret}
32
- client.auth_code.get_token(verifier, params.merge(token_params.to_hash(:symbolize_keys => true)), deep_symbolize(options.auth_token_params))
43
+ # Override callback URL to strip query params, Wistia is strict about this (as per oauth2 spec).
44
+ def callback_url
45
+ full_host + script_name + callback_path
33
46
  end
34
-
35
47
  end
36
48
  end
37
49
  end
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Wistia
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -1,27 +1,29 @@
1
- require_relative 'lib/omniauth/wistia/version'
1
+ require_relative "lib/omniauth/wistia/version"
2
2
 
3
3
  Gem::Specification.new do |spec|
4
- spec.name = "omniauth-wistia"
5
- spec.version = Omniauth::Wistia::VERSION
6
- spec.authors = ["Chris Oliver"]
7
- spec.email = ["excid3@gmail.com"]
4
+ spec.name = "omniauth-wistia"
5
+ spec.version = Omniauth::Wistia::VERSION
6
+ spec.authors = ["Chris Oliver"]
7
+ spec.email = ["excid3@gmail.com"]
8
8
 
9
- spec.summary = %q{OmniAuth strategy for Wistia}
10
- spec.description = %q{OmniAuth strategy for Wistia}
11
- spec.homepage = "https://github.com/excid3/omniauth-wistia"
12
- spec.license = "MIT"
9
+ spec.summary = "OmniAuth strategy for Wistia"
10
+ spec.description = "OmniAuth strategy for Wistia"
11
+ spec.homepage = "https://github.com/excid3/omniauth-wistia"
12
+ spec.license = "MIT"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
14
 
15
15
  spec.metadata["homepage_uri"] = spec.homepage
16
16
  spec.metadata["source_code_uri"] = spec.homepage
17
- #spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
17
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
18
18
 
19
19
  # Specify which files should be added to the gem when it is released.
20
20
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
21
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
22
22
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
23
  end
24
- spec.bindir = "exe"
25
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.bindir = "exe"
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ["lib"]
27
+
28
+ spec.add_dependency "omniauth-oauth2", ">= 1.7", "< 2.0"
27
29
  end
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-wistia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-07 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2020-08-11 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.7'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.7'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
13
33
  description: OmniAuth strategy for Wistia
14
34
  email:
15
35
  - excid3@gmail.com
@@ -19,6 +39,7 @@ extra_rdoc_files: []
19
39
  files:
20
40
  - ".gitignore"
21
41
  - ".travis.yml"
42
+ - CHANGELOG.md
22
43
  - CODE_OF_CONDUCT.md
23
44
  - Gemfile
24
45
  - LICENSE.txt