omniauth-uberpopug 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
+ SHA256:
3
+ metadata.gz: b6eaac4adc0ad0045ecab30afebe509583854017d8dfdca94d0ed3a6bfeb6ae5
4
+ data.tar.gz: d634b6f42dd1fd4c48c1d2a5e8f365431306a4d0e9f47be8d009cc212fbd85e7
5
+ SHA512:
6
+ metadata.gz: 1563b5e4a7272ef7635979f7b297ba377fb4377fd04ba91e8233d733439cc8f783f5e0ec78a2cf06308ff6c3e8f8aa5a221ec65ac170df1bbdef49104590da9c
7
+ data.tar.gz: 74ec07c5cf41a88ce3f32c733428e2f2e22a937662b40815865e56572e6ddecf284a60317419dd5f0c680194f27b8c80b31cbe549f8df77cc951db58de743215
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in omniauth-uberpopug.gemspec
6
+ gemspec
7
+
8
+ group :development, :test do
9
+ gem "rake", "~> 13.0"
10
+ gem "rspec", "~> 3.0"
11
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,77 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ omniauth-uberpopug (0.1.0)
5
+ omniauth (~> 2.0)
6
+ omniauth-oauth2 (~> 1.7.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ diff-lcs (1.4.4)
12
+ faraday (1.8.0)
13
+ faraday-em_http (~> 1.0)
14
+ faraday-em_synchrony (~> 1.0)
15
+ faraday-excon (~> 1.1)
16
+ faraday-httpclient (~> 1.0.1)
17
+ faraday-net_http (~> 1.0)
18
+ faraday-net_http_persistent (~> 1.1)
19
+ faraday-patron (~> 1.0)
20
+ faraday-rack (~> 1.0)
21
+ multipart-post (>= 1.2, < 3)
22
+ ruby2_keywords (>= 0.0.4)
23
+ faraday-em_http (1.0.0)
24
+ faraday-em_synchrony (1.0.0)
25
+ faraday-excon (1.1.0)
26
+ faraday-httpclient (1.0.1)
27
+ faraday-net_http (1.0.1)
28
+ faraday-net_http_persistent (1.2.0)
29
+ faraday-patron (1.0.0)
30
+ faraday-rack (1.0.0)
31
+ hashie (5.0.0)
32
+ jwt (2.3.0)
33
+ multi_json (1.15.0)
34
+ multi_xml (0.6.0)
35
+ multipart-post (2.1.1)
36
+ oauth2 (1.4.7)
37
+ faraday (>= 0.8, < 2.0)
38
+ jwt (>= 1.0, < 3.0)
39
+ multi_json (~> 1.3)
40
+ multi_xml (~> 0.5)
41
+ rack (>= 1.2, < 3)
42
+ omniauth (2.0.4)
43
+ hashie (>= 3.4.6)
44
+ rack (>= 1.6.2, < 3)
45
+ rack-protection
46
+ omniauth-oauth2 (1.7.2)
47
+ oauth2 (~> 1.4)
48
+ omniauth (>= 1.9, < 3)
49
+ rack (2.2.3)
50
+ rack-protection (2.1.0)
51
+ rack
52
+ rake (13.0.6)
53
+ rspec (3.10.0)
54
+ rspec-core (~> 3.10.0)
55
+ rspec-expectations (~> 3.10.0)
56
+ rspec-mocks (~> 3.10.0)
57
+ rspec-core (3.10.1)
58
+ rspec-support (~> 3.10.0)
59
+ rspec-expectations (3.10.1)
60
+ diff-lcs (>= 1.2.0, < 2.0)
61
+ rspec-support (~> 3.10.0)
62
+ rspec-mocks (3.10.2)
63
+ diff-lcs (>= 1.2.0, < 2.0)
64
+ rspec-support (~> 3.10.0)
65
+ rspec-support (3.10.3)
66
+ ruby2_keywords (0.0.5)
67
+
68
+ PLATFORMS
69
+ x86_64-linux
70
+
71
+ DEPENDENCIES
72
+ omniauth-uberpopug!
73
+ rake (~> 13.0)
74
+ rspec (~> 3.0)
75
+
76
+ BUNDLED WITH
77
+ 2.2.17
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Artem Rakov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # Omniauth::Uberpopug
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/omniauth/uberpopug`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'omniauth-uberpopug'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install omniauth-uberpopug
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ 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`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/omniauth-uberpopug.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
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/uberpopug"
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,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,31 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Uberpopug < OmniAuth::Strategies::OAuth2
6
+ option :name, :uberpopug
7
+
8
+ option :client_options, {
9
+ site: 'http://localhost:3000',
10
+ authorize_url: 'http://localhost:3000/oauth/authorize'
11
+ }
12
+
13
+ uid { raw_info['public_id'] }
14
+
15
+ info do
16
+ {
17
+ email: raw_info['email'],
18
+ full_name: raw_info['full_name'],
19
+ position: raw_info['position'],
20
+ state: raw_info['state'],
21
+ role: raw_info['role'],
22
+ public_id: raw_info['public_id']
23
+ }
24
+ end
25
+
26
+ def raw_info
27
+ @raw_info ||= access_token.get('/accounts/current').parsed
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Omniauth
4
+ module Uberpopug
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'uberpopug/version'
4
+ require_relative 'strategies/uberpopug'
5
+
6
+ module Omniauth
7
+ module Uberpopug
8
+ class Error < StandardError; end
9
+ end
10
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/omniauth/uberpopug/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "omniauth-uberpopug"
7
+ spec.version = Omniauth::Uberpopug::VERSION
8
+ spec.authors = ["Artem Rakov"]
9
+ spec.email = ["artem@rakov.me"]
10
+
11
+ spec.summary = "Omniauth strategy for uberpopug"
12
+ spec.description = "Omniauth strategy for uberpopug"
13
+ spec.homepage = "https://github.com/ArtemRakov/omniauth-uberpopug"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = "https://github.com/ArtemRakov/omniauth-uberpopug"
19
+ spec.metadata["changelog_uri"] = "https://github.com/ArtemRakov/omniauth-uberpopug"
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
25
+ end
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_dependency 'omniauth', '~> 2.0'
31
+ spec.add_dependency 'omniauth-oauth2', '~> 1.7.1'
32
+ # Uncomment to register a new dependency of your gem
33
+ # spec.add_dependency "example-gem", "~> 1.0"
34
+
35
+ # For more information and examples about making a new gem, checkout our
36
+ # guide at: https://bundler.io/guides/creating_gem.html
37
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-uberpopug
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Artem Rakov
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-11-11 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: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.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.7.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.7.1
41
+ description: Omniauth strategy for uberpopug
42
+ email:
43
+ - artem@rakov.me
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - ".rspec"
50
+ - Gemfile
51
+ - Gemfile.lock
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - bin/console
56
+ - bin/setup
57
+ - lib/omniauth/strategies/uberpopug.rb
58
+ - lib/omniauth/uberpopug.rb
59
+ - lib/omniauth/uberpopug/version.rb
60
+ - omniauth-uberpopug.gemspec
61
+ homepage: https://github.com/ArtemRakov/omniauth-uberpopug
62
+ licenses:
63
+ - MIT
64
+ metadata:
65
+ homepage_uri: https://github.com/ArtemRakov/omniauth-uberpopug
66
+ source_code_uri: https://github.com/ArtemRakov/omniauth-uberpopug
67
+ changelog_uri: https://github.com/ArtemRakov/omniauth-uberpopug
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: 2.4.0
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubygems_version: 3.2.3
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: Omniauth strategy for uberpopug
87
+ test_files: []