omniauth-breakthemold 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/README.md +39 -0
- data/Rakefile +2 -0
- data/lib/omniauth-breakthemold.rb +1 -0
- data/lib/omniauth/breakthemold.rb +2 -0
- data/lib/omniauth/breakthemold/version.rb +5 -0
- data/lib/omniauth/strategies/breakthemold.rb +42 -0
- data/omniauth-breakthemold.gemspec +24 -0
- metadata +95 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dc5c9fc3a8816a0e4fd6219e426ceb581a0dc8a0
|
4
|
+
data.tar.gz: 15357fd6d54f2b5dd82d496ca6b9e0613c5552db
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d4ead02062d5dd924fce6eeadaac795f307b5416c9346c8f8a07bd1258144700788eecf4e789632bacddc02837d113d5b1932efafb919ffc2a30259febf94b68
|
7
|
+
data.tar.gz: 34fe0a9fa95c6c2cc64d7fa35295353bb2675e70b634284074ab76f2a4c14adaac411331cfb40dd541845a581d64b791f3ccd343ee69749b6031d9dcb6d4f3ec
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Omniauth::Breakthemold
|
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/breakthemold`. 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-breakthemold'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install omniauth-breakthemold
|
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 `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` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
1. Fork it ( https://github.com/[my-github-username]/omniauth-breakthemold/fork )
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "omniauth/breakthemold"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class Breakthemold < OmniAuth::Strategies::OAuth2
|
6
|
+
# Give your strategy a name.
|
7
|
+
option :name, 'breakthemold'
|
8
|
+
|
9
|
+
# This is where you pass the options you would pass when
|
10
|
+
# initializing your consumer from the OAuth gem.
|
11
|
+
option :client_options, { site: "https://www.breakthemold.co.uk", token_url: "/oauth/request_token", access_url: "/oauth/authorize" }
|
12
|
+
option :authorize_params, { state: '1' }
|
13
|
+
option :token_params, { oauth: 'request_token' }
|
14
|
+
|
15
|
+
# These are called after authentication has succeeded. If
|
16
|
+
# possible, you should try to set the UID without making
|
17
|
+
# additional calls (if the user id is returned with the token
|
18
|
+
# or as a URI parameter). This may not be possible with all
|
19
|
+
# providers.
|
20
|
+
uid { raw_info['ID'] }
|
21
|
+
|
22
|
+
info do
|
23
|
+
{
|
24
|
+
name: raw_info['display_name'],
|
25
|
+
email: raw_info['user_email'],
|
26
|
+
nickname: raw_info['user_nicename'],
|
27
|
+
role: raw_info['user_role']
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
extra do
|
32
|
+
{
|
33
|
+
'raw_info' => raw_info
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
def raw_info
|
38
|
+
@raw_info ||= access_token.get(options[:client_options][:access_url], params: { oauth: 'request_access' }).parsed
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'omniauth/breakthemold/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "omniauth-breakthemold"
|
8
|
+
spec.version = Omniauth::Breakthemold::VERSION
|
9
|
+
spec.authors = ["siera"]
|
10
|
+
spec.email = ["sieraruo@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{A Breakthemold Oauth2 Provider Plugin Strategy for Omniauth}
|
13
|
+
spec.description = %q{A Breakthemold Oauth2 Provider Plugin Strategy for Omniauth}
|
14
|
+
spec.homepage = "http://www.breakthemold.co.uk"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "omniauth-oauth2"
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.8"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-breakthemold
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- siera
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-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: '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: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.8'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.8'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
description: A Breakthemold Oauth2 Provider Plugin Strategy for Omniauth
|
56
|
+
email:
|
57
|
+
- sieraruo@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".travis.yml"
|
64
|
+
- Gemfile
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- lib/omniauth-breakthemold.rb
|
68
|
+
- lib/omniauth/breakthemold.rb
|
69
|
+
- lib/omniauth/breakthemold/version.rb
|
70
|
+
- lib/omniauth/strategies/breakthemold.rb
|
71
|
+
- omniauth-breakthemold.gemspec
|
72
|
+
homepage: http://www.breakthemold.co.uk
|
73
|
+
licenses: []
|
74
|
+
metadata: {}
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 2.4.8
|
92
|
+
signing_key:
|
93
|
+
specification_version: 4
|
94
|
+
summary: A Breakthemold Oauth2 Provider Plugin Strategy for Omniauth
|
95
|
+
test_files: []
|