omniauth-tiltify 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 +7 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +62 -0
- data/README.md +48 -0
- data/Rakefile +3 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/omniauth/strategies/tiltify.rb +32 -0
- data/lib/omniauth/tiltify/version.rb +7 -0
- data/lib/omniauth/tiltify.rb +2 -0
- data/omniauth-tiltify.gemspec +33 -0
- metadata +81 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 89bdbd68366bacfd8c4bf6995c12affd6eb9525dd99d16437235a88ef5966627
|
4
|
+
data.tar.gz: 684986a82fee83354da84fe9051c8761c8d88e566e17a3f0db1acec599cdaba1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d247e4de854b9c219fd1ed93e4aaaf522f7a9fc9511383c283d9e95718595f621f035863242b3fed0e9e9ec9a466939864202348b99bbb52113c6a763f09074c
|
7
|
+
data.tar.gz: 20594492709c1be60d39bff0e806cddfbc85e29696a3ef6fddd39a94fcf8339ecc01d5d0b30cf464bf76d69a76027ee0bf66be6d41d1ca21fd4f0a08fac97aeb
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
omniauth-tiltify (0.1.0)
|
5
|
+
omniauth
|
6
|
+
omniauth-oauth2
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
faraday (1.8.0)
|
12
|
+
faraday-em_http (~> 1.0)
|
13
|
+
faraday-em_synchrony (~> 1.0)
|
14
|
+
faraday-excon (~> 1.1)
|
15
|
+
faraday-httpclient (~> 1.0.1)
|
16
|
+
faraday-net_http (~> 1.0)
|
17
|
+
faraday-net_http_persistent (~> 1.1)
|
18
|
+
faraday-patron (~> 1.0)
|
19
|
+
faraday-rack (~> 1.0)
|
20
|
+
multipart-post (>= 1.2, < 3)
|
21
|
+
ruby2_keywords (>= 0.0.4)
|
22
|
+
faraday-em_http (1.0.0)
|
23
|
+
faraday-em_synchrony (1.0.0)
|
24
|
+
faraday-excon (1.1.0)
|
25
|
+
faraday-httpclient (1.0.1)
|
26
|
+
faraday-net_http (1.0.1)
|
27
|
+
faraday-net_http_persistent (1.2.0)
|
28
|
+
faraday-patron (1.0.0)
|
29
|
+
faraday-rack (1.0.0)
|
30
|
+
hashie (4.1.0)
|
31
|
+
jwt (2.3.0)
|
32
|
+
multi_json (1.15.0)
|
33
|
+
multi_xml (0.6.0)
|
34
|
+
multipart-post (2.1.1)
|
35
|
+
oauth2 (1.4.7)
|
36
|
+
faraday (>= 0.8, < 2.0)
|
37
|
+
jwt (>= 1.0, < 3.0)
|
38
|
+
multi_json (~> 1.3)
|
39
|
+
multi_xml (~> 0.5)
|
40
|
+
rack (>= 1.2, < 3)
|
41
|
+
omniauth (2.0.4)
|
42
|
+
hashie (>= 3.4.6)
|
43
|
+
rack (>= 1.6.2, < 3)
|
44
|
+
rack-protection
|
45
|
+
omniauth-oauth2 (1.7.1)
|
46
|
+
oauth2 (~> 1.4)
|
47
|
+
omniauth (>= 1.9, < 3)
|
48
|
+
rack (2.2.3)
|
49
|
+
rack-protection (2.1.0)
|
50
|
+
rack
|
51
|
+
rake (13.0.6)
|
52
|
+
ruby2_keywords (0.0.5)
|
53
|
+
|
54
|
+
PLATFORMS
|
55
|
+
x86_64-linux
|
56
|
+
|
57
|
+
DEPENDENCIES
|
58
|
+
omniauth-tiltify!
|
59
|
+
rake (~> 13.0)
|
60
|
+
|
61
|
+
BUNDLED WITH
|
62
|
+
2.2.29
|
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# OmniAuth Tiltify
|
2
|
+
|
3
|
+
An OmniAuth strategy for Tiltify
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add the OmniAuth Tiltify and OmniAuth rails_csrf_protection gems to your Gemfile
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'omniauth-tiltify'
|
11
|
+
gem 'omniauth-rails_csrf_protection'
|
12
|
+
```
|
13
|
+
|
14
|
+
## Usage
|
15
|
+
|
16
|
+
Create an Application by going to `https://dashboard.tiltify.com/MYUSERNAME/my-account/connected-accounts/applications` (and replacing `MYUSERNAME` with your own username, of course) and hitting the "create application" button.
|
17
|
+
|
18
|
+
Here's an example for adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
22
|
+
provider :tiltify, ENV["TILTIFY_APP"], ENV["TILTIFY_SECRET"]
|
23
|
+
end
|
24
|
+
```
|
25
|
+
|
26
|
+
## Auth Hash
|
27
|
+
|
28
|
+
Here's an example *Auth Hash* available in `request.env['omniauth.auth']`:
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
{
|
32
|
+
provider: "tiltify",
|
33
|
+
uid: 12345,
|
34
|
+
info: {
|
35
|
+
username: "testuser",
|
36
|
+
url: "https://tiltify.com/@testuser",
|
37
|
+
first_name: "Test",
|
38
|
+
last_name: "User",
|
39
|
+
email: "test@test.com",
|
40
|
+
avatar: "https://assets.tiltify.com/assets/default-avatar.png",
|
41
|
+
name: "Test User"
|
42
|
+
},
|
43
|
+
credentials: {
|
44
|
+
token: "abc123", # OAuth 2.0 access_token, which you may wish to store
|
45
|
+
expires: false # this will always be false
|
46
|
+
}
|
47
|
+
}
|
48
|
+
```
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "omniauth/tiltify"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class Tiltify < OmniAuth::Strategies::OAuth2
|
6
|
+
|
7
|
+
option :client_options, {
|
8
|
+
site: "https://tiltify.com",
|
9
|
+
authorize_url: "/oauth/authorize",
|
10
|
+
token_url: "/oauth/token"
|
11
|
+
}
|
12
|
+
|
13
|
+
uid { raw_info["data"]["id"] }
|
14
|
+
|
15
|
+
info do
|
16
|
+
{
|
17
|
+
"username" => raw_info["data"]["username"],
|
18
|
+
"url" => raw_info["data"]["url"],
|
19
|
+
"first_name" => raw_info["data"]["firstName"],
|
20
|
+
"last_name" => raw_info["data"]["lastName"],
|
21
|
+
"email" => raw_info["data"]["email"],
|
22
|
+
"avatar" => raw_info["data"]["avatar"]["src"]
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
def raw_info
|
27
|
+
@raw_info ||= access_token.get('/api/v3/user').parsed
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/omniauth/tiltify/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "omniauth-tiltify"
|
7
|
+
spec.version = Omniauth::Tiltify::VERSION
|
8
|
+
spec.authors = ["Dean Perry"]
|
9
|
+
spec.email = ["dean@deanpcmad.com"]
|
10
|
+
|
11
|
+
spec.summary = "OmniAuth strategy for Tiltify"
|
12
|
+
spec.homepage = "https://github.com/deanpcmad/omniauth-tiltify"
|
13
|
+
spec.required_ruby_version = ">= 2.6.0"
|
14
|
+
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
16
|
+
|
17
|
+
# Specify which files should be added to the gem when it is released.
|
18
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
21
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
22
|
+
end
|
23
|
+
end
|
24
|
+
spec.bindir = "exe"
|
25
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
26
|
+
spec.require_paths = ["lib"]
|
27
|
+
|
28
|
+
spec.add_dependency 'omniauth'
|
29
|
+
spec.add_dependency 'omniauth-oauth2'
|
30
|
+
|
31
|
+
# For more information and examples about making a new gem, checkout our
|
32
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-tiltify
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dean Perry
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-10-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: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '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: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description:
|
42
|
+
email:
|
43
|
+
- dean@deanpcmad.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- Gemfile
|
49
|
+
- Gemfile.lock
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- bin/console
|
53
|
+
- bin/setup
|
54
|
+
- lib/omniauth/strategies/tiltify.rb
|
55
|
+
- lib/omniauth/tiltify.rb
|
56
|
+
- lib/omniauth/tiltify/version.rb
|
57
|
+
- omniauth-tiltify.gemspec
|
58
|
+
homepage: https://github.com/deanpcmad/omniauth-tiltify
|
59
|
+
licenses: []
|
60
|
+
metadata:
|
61
|
+
homepage_uri: https://github.com/deanpcmad/omniauth-tiltify
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 2.6.0
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubygems_version: 3.1.6
|
78
|
+
signing_key:
|
79
|
+
specification_version: 4
|
80
|
+
summary: OmniAuth strategy for Tiltify
|
81
|
+
test_files: []
|