omniauth-bouncie 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/.github/workflows/ci.yml +32 -0
- data/.github/workflows/publish.yml +18 -0
- data/.gitignore +8 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +19 -0
- data/README.md +51 -0
- data/Rakefile +4 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/omniauth-bouncie.rb +4 -0
- data/lib/omniauth-bouncie/version.rb +7 -0
- data/lib/omniauth/bouncie.rb +10 -0
- data/lib/omniauth/strategies/bouncie.rb +42 -0
- data/omniauth-bouncie.gemspec +27 -0
- metadata +58 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 057aa73992d28415c4c76558cfcb475b9e48807c8d1d9b9dd0007ce57938f057
|
4
|
+
data.tar.gz: 317b9b61452e8e788138c652b1364c953f10a09b60db9509dfde0ae92d6b17e6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 373a604ccea274206a2a51c99f5c31a3b70cd03e699c04056254bdcda0923ae3f7f2732f05e0542197a4645bbf8318c0863aa7eb41cb8d345cda538a7e6e72fc
|
7
|
+
data.tar.gz: '0885c54d49de0e43e5bb374a168258a178f905ce79154dd19089f18edc63ecf86616ae8652fd54c524030b229decab85c18e942ba1ce1851ecc4af151e984ed3'
|
@@ -0,0 +1,32 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
# test:
|
11
|
+
# runs-on: ubuntu-latest
|
12
|
+
# steps:
|
13
|
+
# - uses: actions/checkout@v2
|
14
|
+
# - name: Set up Ruby
|
15
|
+
# # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
16
|
+
# # change this to (see https://github.com/ruby/setup-ruby#versioning):
|
17
|
+
# # uses: ruby/setup-ruby@v1
|
18
|
+
# uses: ruby/setup-ruby@v1
|
19
|
+
# with:
|
20
|
+
# ruby-version: 2.6
|
21
|
+
# - name: Install dependencies
|
22
|
+
# run: bundle install
|
23
|
+
# - name: RSpec tests
|
24
|
+
# run: rspec spec
|
25
|
+
|
26
|
+
lint:
|
27
|
+
runs-on: ubuntu-latest
|
28
|
+
steps:
|
29
|
+
- name: Rubocop Linter Action
|
30
|
+
uses: andrewmcodes/rubocop-linter-action@v3.2.0
|
31
|
+
env:
|
32
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v1
|
14
|
+
- name: Build and publish gem
|
15
|
+
uses: jstastny/publish-gem-to-github@master
|
16
|
+
with:
|
17
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
18
|
+
owner: streetsmartslabs
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# OmniAuth::Bouncie
|
2
|
+
|
3
|
+
This is the unofficial OmniAuth strategy for authenticating to Bouncie. Register your app and see official documentation at [https://docs.bouncie.dev](https://docs.bouncie.dev).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'omniauth-bouncie'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle install
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install omniauth-bouncie
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
use OmniAuth::Builder do
|
25
|
+
provider :bouncie,
|
26
|
+
ENV['BOUNCIE_CLIENT_ID'],
|
27
|
+
ENV['BOUNCIE_CLIENT_SECRET'],
|
28
|
+
token_params: {
|
29
|
+
redirect_uri: 'http://localhost:3000/auth/bouncie/callback'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
```
|
33
|
+
|
34
|
+
## Development
|
35
|
+
|
36
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
37
|
+
|
38
|
+
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
39
|
+
|
40
|
+
## Contributing
|
41
|
+
|
42
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/omniauth-bouncie.
|
43
|
+
|
44
|
+
## License
|
45
|
+
Copyright (c) 2020 StreetSmarts Labs, LLC
|
46
|
+
|
47
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
48
|
+
|
49
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
50
|
+
|
51
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
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/bouncie'
|
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,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'omniauth-oauth2'
|
4
|
+
|
5
|
+
module OmniAuth
|
6
|
+
module Strategies
|
7
|
+
class Bouncie < OmniAuth::Strategies::OAuth2
|
8
|
+
# Give your strategy a name.
|
9
|
+
option :name, 'bouncie'
|
10
|
+
|
11
|
+
# This is where you pass the options you would pass when
|
12
|
+
# initializing your consumer from the OAuth gem.
|
13
|
+
option :client_options, { site: 'https://auth.bouncie.com',
|
14
|
+
authorize_url: 'dialog/authorize',
|
15
|
+
token_url: 'oauth/token' }
|
16
|
+
|
17
|
+
# These are called after authentication has succeeded. If
|
18
|
+
# possible, you should try to set the UID without making
|
19
|
+
# additional calls (if the user id is returned with the token
|
20
|
+
# or as a URI parameter). This may not be possible with all
|
21
|
+
# providers.
|
22
|
+
uid { raw_info['id'] }
|
23
|
+
|
24
|
+
info do
|
25
|
+
{
|
26
|
+
name: raw_info['name'],
|
27
|
+
email: raw_info['email']
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
extra do
|
32
|
+
{
|
33
|
+
raw_info: raw_info
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
def raw_info
|
38
|
+
@raw_info ||= JSON.parse(Faraday.get('https://api.bouncie.dev/v1/user', {}, { Authorization: access_token.token }).body)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/omniauth-bouncie/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'omniauth-bouncie'
|
7
|
+
spec.version = OmniAuth::Bouncie::VERSION
|
8
|
+
spec.authors = ['Corey Psoinos']
|
9
|
+
spec.email = ['corey@streetsmarts.io']
|
10
|
+
|
11
|
+
spec.summary = 'An omniauth strategy for Bouncie'
|
12
|
+
spec.description = 'An omniauth strategy for Bouncie'
|
13
|
+
spec.homepage = 'https://github.com/streetsmartslabs/omniauth-bouncie'
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
15
|
+
|
16
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = 'https://github.com/streetsmartslabs/omniauth-bouncie'
|
18
|
+
|
19
|
+
# Specify which files should be added to the gem when it is released.
|
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(__dir__)) do
|
22
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
|
+
end
|
24
|
+
spec.bindir = 'exe'
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
|
+
spec.require_paths = ['lib']
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-bouncie
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Corey Psoinos
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-07-08 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: An omniauth strategy for Bouncie
|
14
|
+
email:
|
15
|
+
- corey@streetsmarts.io
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- ".github/workflows/ci.yml"
|
21
|
+
- ".github/workflows/publish.yml"
|
22
|
+
- ".gitignore"
|
23
|
+
- Gemfile
|
24
|
+
- Gemfile.lock
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- bin/console
|
28
|
+
- bin/setup
|
29
|
+
- lib/omniauth-bouncie.rb
|
30
|
+
- lib/omniauth-bouncie/version.rb
|
31
|
+
- lib/omniauth/bouncie.rb
|
32
|
+
- lib/omniauth/strategies/bouncie.rb
|
33
|
+
- omniauth-bouncie.gemspec
|
34
|
+
homepage: https://github.com/streetsmartslabs/omniauth-bouncie
|
35
|
+
licenses: []
|
36
|
+
metadata:
|
37
|
+
homepage_uri: https://github.com/streetsmartslabs/omniauth-bouncie
|
38
|
+
source_code_uri: https://github.com/streetsmartslabs/omniauth-bouncie
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.3.0
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
requirements: []
|
54
|
+
rubygems_version: 3.0.6
|
55
|
+
signing_key:
|
56
|
+
specification_version: 4
|
57
|
+
summary: An omniauth strategy for Bouncie
|
58
|
+
test_files: []
|