omniauth-django 1.0.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/gem-push.yml +30 -0
- data/.github/workflows/ruby.yml +22 -0
- data/.gitignore +17 -0
- data/.idea/inspectionProfiles/Project_Default.xml +7 -0
- data/.idea/inspectionProfiles/profiles_settings.xml +6 -0
- data/.idea/misc.xml +6 -0
- data/.idea/modules.xml +8 -0
- data/.rspec +1 -0
- data/Gemfile +13 -0
- data/Guardfile +10 -0
- data/LICENSE.txt +7 -0
- data/README.md +61 -0
- data/Rakefile +8 -0
- data/lib/omniauth-django/version.rb +5 -0
- data/lib/omniauth-github.rb +2 -0
- data/lib/omniauth/strategies/django.rb +52 -0
- data/omniauth-github.gemspec +25 -0
- metadata +151 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e0d8a9949a97b9534da3d329418e59ec19721f12727a967124052726f31ea2ab
|
4
|
+
data.tar.gz: fa959651e0d5c6b67f23337454a00b57111835196930deae4606d2995a8d8f6f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 59117e69ca67b5a0ce589decdb0fd7ce702d6b3537e8076135ddd3273502480ba0b91f4b9ed1765593d5f8bf680b346f8de5e04bf1e7c6c11100ce83a527e72b
|
7
|
+
data.tar.gz: 3c30b0a2b22e53d5a8e2a337fe3a8344bc4786ab164aa08b342a66b972b148a7184f10dca545f1cc9ebdbc56c6d234a5d0d4727edad8266db555e594bff31c09
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
name: Build + Publish
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
- name: Set up Ruby 2.5
|
17
|
+
uses: actions/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: 2.5.x
|
20
|
+
|
21
|
+
- name: Publish to RubyGems
|
22
|
+
run: |
|
23
|
+
mkdir -p $HOME/.gem
|
24
|
+
touch $HOME/.gem/credentials
|
25
|
+
chmod 0600 $HOME/.gem/credentials
|
26
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
27
|
+
gem build *.gemspec
|
28
|
+
gem push *.gem
|
29
|
+
env:
|
30
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby-version: ['2.4', '2.5', '2.6']
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
15
|
+
uses: actions/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: ${{ matrix.ruby-version }}
|
18
|
+
- name: Build and test with Rake
|
19
|
+
run: |
|
20
|
+
gem install bundler
|
21
|
+
bundle install --jobs 4 --retry 3
|
22
|
+
bundle exec rake
|
data/.gitignore
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
2
|
+
<profile version="1.0">
|
3
|
+
<option name="myName" value="Project Default" />
|
4
|
+
<inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
|
5
|
+
<inspection_tool class="TsLint" enabled="true" level="WARNING" enabled_by_default="true" />
|
6
|
+
</profile>
|
7
|
+
</component>
|
data/.idea/misc.xml
ADDED
data/.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/omniauth-django.iml" filepath="$PROJECT_DIR$/.idea/omniauth-django.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/Gemfile
ADDED
data/Guardfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) 2011 Michael Bleigh and Intridea, Inc.
|
2
|
+
|
3
|
+
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:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
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/README.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+

|
2
|
+
|
3
|
+
# OmniAuth Django
|
4
|
+
|
5
|
+
This is the official OmniAuth strategy for authenticating to GitHub. To
|
6
|
+
use it, you'll need to sign up for an OAuth2 Application ID and Secret
|
7
|
+
on the [GitHub Applications Page](https://github.com/settings/applications).
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'omniauth-github', github: 'omniauth/omniauth-github', branch: 'master'
|
13
|
+
```
|
14
|
+
|
15
|
+
## Basic Usage
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
use OmniAuth::Builder do
|
19
|
+
provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET']
|
20
|
+
end
|
21
|
+
```
|
22
|
+
|
23
|
+
## Github Enterprise Usage
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'],
|
27
|
+
{
|
28
|
+
:client_options => {
|
29
|
+
:site => 'https://github.YOURDOMAIN.com/api/v3',
|
30
|
+
:authorize_url => 'https://github.YOURDOMAIN.com/login/oauth/authorize',
|
31
|
+
:token_url => 'https://github.YOURDOMAIN.com/login/oauth/access_token',
|
32
|
+
}
|
33
|
+
}
|
34
|
+
```
|
35
|
+
|
36
|
+
## Scopes
|
37
|
+
|
38
|
+
GitHub API v3 lets you set scopes to provide granular access to different types of data:
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
use OmniAuth::Builder do
|
42
|
+
provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'], scope: "user,repo,gist"
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
More info on [Scopes](http://developer.github.com/v3/oauth/#scopes).
|
47
|
+
|
48
|
+
|
49
|
+
## Semver
|
50
|
+
This project adheres to Semantic Versioning 2.0.0. Any violations of this scheme are considered to be bugs.
|
51
|
+
All changes will be tracked [here](https://github.com/omniauth/omniauth-github/releases).
|
52
|
+
|
53
|
+
## License
|
54
|
+
|
55
|
+
Copyright (c) 2011 Michael Bleigh and Intridea, Inc.
|
56
|
+
|
57
|
+
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:
|
58
|
+
|
59
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
60
|
+
|
61
|
+
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
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class Django < OmniAuth::Strategies::OAuth2
|
6
|
+
option :client_options, {
|
7
|
+
:site => 'https://api.parkingdp.online/openid/',
|
8
|
+
:authorize_url => 'https://api.parkingdp.online/openid/authorize/',
|
9
|
+
:token_url => 'https://api.parkingdp.online/openid/token/'
|
10
|
+
}
|
11
|
+
|
12
|
+
def request_phase
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
16
|
+
def authorize_params
|
17
|
+
super.tap do |params|
|
18
|
+
%w[scope client_options].each do |v|
|
19
|
+
if request.params[v]
|
20
|
+
params[v.to_sym] = request.params[v]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
uid { raw_info['nickname'] }
|
27
|
+
|
28
|
+
info do
|
29
|
+
{
|
30
|
+
'name' => raw_info['nickname'],
|
31
|
+
'email' => raw_info['email'],
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
extra do
|
36
|
+
{}
|
37
|
+
end
|
38
|
+
|
39
|
+
def raw_info
|
40
|
+
access_token.options[:mode] = :header
|
41
|
+
p access_token.get('userinfo').parsed
|
42
|
+
@raw_info ||= access_token.get('userinfo').parsed
|
43
|
+
end
|
44
|
+
|
45
|
+
def callback_url
|
46
|
+
full_host + script_name + callback_path
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
OmniAuth.config.add_camelization 'django', 'Django'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/omniauth-django/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Oleksandr Shyshatskyi"]
|
6
|
+
gem.email = ["shalal545@gmail.com"]
|
7
|
+
gem.description = %q{Official OmniAuth strategy for django.}
|
8
|
+
gem.summary = %q{Official OmniAuth strategy for django.}
|
9
|
+
gem.homepage = "https://github.com/Monstrofil/omniauth-django"
|
10
|
+
gem.license = "MIT"
|
11
|
+
|
12
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
13
|
+
gem.files = `git ls-files`.split("\n")
|
14
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
|
+
gem.name = "omniauth-django"
|
16
|
+
gem.require_paths = ["lib"]
|
17
|
+
gem.version = OmniAuth::Django::VERSION
|
18
|
+
|
19
|
+
gem.add_dependency 'omniauth', '~> 1.5'
|
20
|
+
gem.add_dependency 'omniauth-oauth2', '>= 1.4.0', '< 2.0'
|
21
|
+
gem.add_development_dependency 'rspec', '~> 3.5'
|
22
|
+
gem.add_development_dependency 'rack-test'
|
23
|
+
gem.add_development_dependency 'simplecov'
|
24
|
+
gem.add_development_dependency 'webmock'
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-django
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Oleksandr Shyshatskyi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-08-17 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: '1.5'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
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.4.0
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '2.0'
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.4.0
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '2.0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3.5'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '3.5'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rack-test
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: simplecov
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: webmock
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
description: Official OmniAuth strategy for django.
|
104
|
+
email:
|
105
|
+
- shalal545@gmail.com
|
106
|
+
executables: []
|
107
|
+
extensions: []
|
108
|
+
extra_rdoc_files: []
|
109
|
+
files:
|
110
|
+
- ".github/workflows/gem-push.yml"
|
111
|
+
- ".github/workflows/ruby.yml"
|
112
|
+
- ".gitignore"
|
113
|
+
- ".idea/inspectionProfiles/Project_Default.xml"
|
114
|
+
- ".idea/inspectionProfiles/profiles_settings.xml"
|
115
|
+
- ".idea/misc.xml"
|
116
|
+
- ".idea/modules.xml"
|
117
|
+
- ".rspec"
|
118
|
+
- Gemfile
|
119
|
+
- Guardfile
|
120
|
+
- LICENSE.txt
|
121
|
+
- README.md
|
122
|
+
- Rakefile
|
123
|
+
- lib/omniauth-django/version.rb
|
124
|
+
- lib/omniauth-github.rb
|
125
|
+
- lib/omniauth/strategies/django.rb
|
126
|
+
- omniauth-github.gemspec
|
127
|
+
homepage: https://github.com/Monstrofil/omniauth-django
|
128
|
+
licenses:
|
129
|
+
- MIT
|
130
|
+
metadata: {}
|
131
|
+
post_install_message:
|
132
|
+
rdoc_options: []
|
133
|
+
require_paths:
|
134
|
+
- lib
|
135
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
requirements: []
|
146
|
+
rubyforge_project:
|
147
|
+
rubygems_version: 2.7.6.2
|
148
|
+
signing_key:
|
149
|
+
specification_version: 4
|
150
|
+
summary: Official OmniAuth strategy for django.
|
151
|
+
test_files: []
|