glogin 0.5.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +12 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +11 -0
- data/.github/workflows/codecov.yml +20 -0
- data/.github/workflows/rake.yml +24 -0
- data/.rubocop.yml +4 -0
- data/.rultor.yml +9 -16
- data/.simplecov +8 -6
- data/Gemfile +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +15 -30
- data/Rakefile +2 -2
- data/glogin.gemspec +12 -16
- data/lib/glogin/auth.rb +3 -6
- data/lib/glogin/codec.rb +50 -49
- data/lib/glogin/cookie.rb +12 -6
- data/lib/glogin/version.rb +3 -3
- data/lib/glogin.rb +2 -2
- data/logo.svg +19 -0
- data/test/glogin/test_auth.rb +1 -3
- data/test/glogin/test_codec.rb +5 -4
- data/test/glogin/test_cookie.rb +12 -8
- data/test/test__helper.rb +2 -2
- data/test/test_glogin.rb +2 -2
- metadata +42 -28
- data/.travis.yml +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1d167febc4cddb92a21a6e768ba084262e600379dafd23440768ce622b2abe7
|
4
|
+
data.tar.gz: 7afd525bbc7ec53f454a279d2840575456af556f46b28cff73ca84f727d6941d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a6be3c9cdd283c53b19bc6ab5add3d6ba4687a55a5d49521cf1997e79be4c6974ab0e72d49baf098f7978f73c6aec8135a66f224531c0f308a2a2915f393c2e
|
7
|
+
data.tar.gz: ddda55fec3c9483989f186fbe43f3ca006fe041677cf22a5d5c84604bd4e157cb5c6e14e67c0abae14729dedef405bb02c57424d00e3df1a5527feaaa5466124
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Make sure the title of the issue explains the problem you are having. Also, the description of the issue must clearly explain what is broken, not what you want us to implement. Go through this checklist and make sure you answer "YES" to all points:
|
2
|
+
|
3
|
+
- You have all pre-requisites listed in README.md installed
|
4
|
+
- You are sure that you are not reporting a duplicate (search all issues)
|
5
|
+
- You say "is broken" or "doesn't work" in the title
|
6
|
+
- You tell us what you are trying to do
|
7
|
+
- You explain the results you are getting
|
8
|
+
- You suggest an alternative result you would like to see
|
9
|
+
|
10
|
+
This article will help you understand what we are looking for: http://www.yegor256.com/2014/11/24/principles-of-bug-tracking.html
|
11
|
+
|
12
|
+
Thank you for your contribution!
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Many thanks for your contribution, we truly appreciate it. We will appreciate it even more, if you make sure that you can say "YES" to each point in this short checklist:
|
2
|
+
|
3
|
+
- You made a small amount of changes (less than 100 lines, less than 10 files)
|
4
|
+
- You made changes related to only one bug (create separate PRs for separate problems)
|
5
|
+
- You are ready to defend your changes (there will be a code review)
|
6
|
+
- You don't touch what you don't understand
|
7
|
+
- You ran the build locally and it passed
|
8
|
+
|
9
|
+
This article will help you understand what we are looking for: http://www.yegor256.com/2015/02/09/serious-code-reviewer.html
|
10
|
+
|
11
|
+
Thank you for your contribution!
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: codecov
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
jobs:
|
8
|
+
codecov:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v2
|
12
|
+
- uses: actions/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: 2.7
|
15
|
+
- run: bundle update
|
16
|
+
- run: bundle exec rake
|
17
|
+
- uses: codecov/codecov-action@v1
|
18
|
+
with:
|
19
|
+
file: coverage/.resultset.json
|
20
|
+
fail_ci_if_error: true
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
name: rake
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
jobs:
|
11
|
+
test:
|
12
|
+
name: test
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
os: [ubuntu-latest, macos-latest]
|
16
|
+
ruby: [2.7]
|
17
|
+
runs-on: ${{ matrix.os }}
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- uses: actions/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
23
|
+
- run: bundle update
|
24
|
+
- run: bundle exec rake
|
data/.rubocop.yml
CHANGED
@@ -4,9 +4,13 @@ AllCops:
|
|
4
4
|
- 'assets/**/*'
|
5
5
|
DisplayCopNames: true
|
6
6
|
TargetRubyVersion: 2.3
|
7
|
+
SuggestExtensions: false
|
8
|
+
NewCops: enable
|
7
9
|
|
8
10
|
Metrics/MethodLength:
|
9
11
|
Enabled: false
|
12
|
+
Style/ClassAndModuleChildren:
|
13
|
+
Enabled: false
|
10
14
|
Layout/MultilineMethodCallIndentation:
|
11
15
|
Enabled: false
|
12
16
|
Metrics/AbcSize:
|
data/.rultor.yml
CHANGED
@@ -1,31 +1,24 @@
|
|
1
|
+
docker:
|
2
|
+
image: yegor256/rultor-image:1.9.0
|
1
3
|
assets:
|
2
|
-
rubygems.yml:
|
3
|
-
s3cfg: zerocracy/home#assets/s3cfg
|
4
|
+
rubygems.yml: yegor256/home#assets/rubygems.yml
|
4
5
|
install: |
|
5
|
-
|
6
|
-
|
7
|
-
sudo apt-get -y update
|
8
|
-
sudo gem install pdd
|
6
|
+
pdd -f /dev/null
|
7
|
+
sudo bundle install --no-color "--gemfile=$(pwd)/Gemfile"
|
9
8
|
release:
|
10
9
|
script: |-
|
11
|
-
|
12
|
-
rake
|
10
|
+
[[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
|
11
|
+
bundle exec rake
|
13
12
|
rm -rf *.gem
|
14
|
-
sed -i "s/
|
13
|
+
sed -i "s/0\.0\.0/${tag}/g" lib/glogin/version.rb
|
15
14
|
git add lib/glogin/version.rb
|
16
15
|
git commit -m "version set to ${tag}"
|
17
16
|
gem build glogin.gemspec
|
18
17
|
chmod 0600 ../rubygems.yml
|
19
18
|
gem push *.gem --config-file ../rubygems.yml
|
20
|
-
commanders:
|
21
|
-
- yegor256
|
22
|
-
architect:
|
23
|
-
- yegor256
|
24
19
|
merge:
|
25
20
|
script: |-
|
26
|
-
bundle
|
27
|
-
rake
|
28
|
-
pdd
|
21
|
+
bundle exec rake
|
29
22
|
deploy:
|
30
23
|
script: |-
|
31
24
|
echo "There is nothing to deploy"
|
data/.simplecov
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
3
5
|
#
|
4
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -19,21 +21,21 @@
|
|
19
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
22
|
# SOFTWARE.
|
21
23
|
|
22
|
-
if Gem.win_platform?
|
24
|
+
if Gem.win_platform?
|
23
25
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
24
26
|
SimpleCov::Formatter::HTMLFormatter
|
25
27
|
]
|
26
28
|
SimpleCov.start do
|
27
|
-
add_filter
|
28
|
-
add_filter
|
29
|
+
add_filter '/test/'
|
30
|
+
add_filter '/features/'
|
29
31
|
end
|
30
32
|
else
|
31
33
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
32
34
|
[SimpleCov::Formatter::HTMLFormatter]
|
33
35
|
)
|
34
36
|
SimpleCov.start do
|
35
|
-
add_filter
|
36
|
-
add_filter
|
37
|
+
add_filter '/test/'
|
38
|
+
add_filter '/features/'
|
37
39
|
minimum_coverage 20
|
38
40
|
end
|
39
41
|
end
|
data/Gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,15 +1,19 @@
|
|
1
|
+
<img src="/logo.svg" width="64px" height="64px"/>
|
2
|
+
|
1
3
|
[![Managed by Zerocracy](https://www.0crat.com/badge/C3RFVLU72.svg)](https://www.0crat.com/p/C3RFVLU72)
|
2
4
|
[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/glogin)](http://www.rultor.com/p/yegor256/glogin)
|
3
|
-
[![We recommend RubyMine](
|
5
|
+
[![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
|
4
6
|
|
5
|
-
[![
|
7
|
+
[![rake](https://github.com/yegor256/glogin/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/glogin/actions/workflows/rake.yml)
|
6
8
|
[![PDD status](http://www.0pdd.com/svg?name=yegor256/glogin)](http://www.0pdd.com/p?name=yegor256/glogin)
|
7
9
|
[![Gem Version](https://badge.fury.io/rb/glogin.svg)](http://badge.fury.io/rb/glogin)
|
8
10
|
[![Maintainability](https://api.codeclimate.com/v1/badges/155f86b639d155259219/maintainability)](https://codeclimate.com/github/yegor256/glogin/maintainability)
|
9
11
|
[![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/glogin.svg)](https://codecov.io/github/yegor256/glogin?branch=master)
|
10
12
|
[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/yegor256/glogin/master/frames)
|
11
13
|
|
12
|
-
|
14
|
+
![Lines of code](https://img.shields.io/tokei/lines/github/yegor256/glogin)
|
15
|
+
[![Hits-of-Code](https://hitsofcode.com/github/yegor256/glogin)](https://hitsofcode.com/view/github/yegor256/glogin)
|
16
|
+
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/glogin/blob/master/LICENSE.txt)
|
13
17
|
|
14
18
|
This simple gem will help you enable login/logout through
|
15
19
|
[GitHub OAuth](https://developer.github.com/apps/building-integrations/setting-up-and-registering-oauth-apps/)
|
@@ -17,6 +21,9 @@ for your web application. This is how it works with
|
|
17
21
|
[Sinatra](http://www.sinatrarb.com/),
|
18
22
|
but you can do something similar in any framework.
|
19
23
|
|
24
|
+
Read this blog post to get the idea:
|
25
|
+
[_Simplified GitHub Login for a Ruby Web App_](https://www.yegor256.com/2018/06/19/glogin.html)
|
26
|
+
|
20
27
|
First, somewhere in the global space, before the app starts:
|
21
28
|
|
22
29
|
```ruby
|
@@ -47,7 +54,7 @@ before '/*' do
|
|
47
54
|
# encrypt the value in the cookie.
|
48
55
|
secret
|
49
56
|
).to_user
|
50
|
-
rescue
|
57
|
+
rescue GLogin::Codec::DecodingError => _
|
51
58
|
# Nothing happens here, the user is not logged in.
|
52
59
|
cookies.delete(:glogin)
|
53
60
|
end
|
@@ -62,6 +69,8 @@ a local variable `@user` will be set to something like this:
|
|
62
69
|
{ login: 'yegor256', avatar: 'http://...' }
|
63
70
|
```
|
64
71
|
|
72
|
+
If the `secret` is an empty string, the encryption will be disabled.
|
73
|
+
|
65
74
|
Next, we need a URL for GitHub OAuth callback:
|
66
75
|
|
67
76
|
```ruby
|
@@ -132,7 +141,7 @@ encrypted = codec.encrypt('Hello, world!')
|
|
132
141
|
decrypted = codec.decrypt(encrypted)
|
133
142
|
```
|
134
143
|
|
135
|
-
|
144
|
+
## How to contribute
|
136
145
|
|
137
146
|
Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
|
138
147
|
Make sure you build is green before you contribute
|
@@ -141,31 +150,7 @@ your pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 2
|
|
141
150
|
|
142
151
|
```
|
143
152
|
$ bundle update
|
144
|
-
$ rake
|
153
|
+
$ bundle exec rake
|
145
154
|
```
|
146
155
|
|
147
156
|
If it's clean and you don't see any error messages, submit your pull request.
|
148
|
-
|
149
|
-
## License
|
150
|
-
|
151
|
-
(The MIT License)
|
152
|
-
|
153
|
-
Copyright (c) 2017-2019 Yegor Bugayenko
|
154
|
-
|
155
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
156
|
-
of this software and associated documentation files (the 'Software'), to deal
|
157
|
-
in the Software without restriction, including without limitation the rights
|
158
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
159
|
-
copies of the Software, and to permit persons to whom the Software is
|
160
|
-
furnished to do so, subject to the following conditions:
|
161
|
-
|
162
|
-
The above copyright notice and this permission notice shall be included in all
|
163
|
-
copies or substantial portions of the Software.
|
164
|
-
|
165
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
166
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
167
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
168
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
169
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
170
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
171
|
-
SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -63,7 +63,7 @@ RuboCop::RakeTask.new(:rubocop) do |task|
|
|
63
63
|
end
|
64
64
|
|
65
65
|
task :copyright do
|
66
|
-
sh "grep -q -r '
|
66
|
+
sh "grep -q -r '2017-#{Date.today.strftime('%Y')}' \
|
67
67
|
--include '*.rb' \
|
68
68
|
--include '*.txt' \
|
69
69
|
--include 'Rakefile' \
|
data/glogin.gemspec
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
# Copyright (c) 2017-2019 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
4
|
#
|
6
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -28,11 +27,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
28
27
|
require_relative 'lib/glogin/version'
|
29
28
|
|
30
29
|
Gem::Specification.new do |s|
|
31
|
-
s.
|
32
|
-
if s.respond_to? :required_rubygems_version=
|
33
|
-
s.required_rubygems_version = Gem::Requirement.new('>= 0')
|
34
|
-
end
|
35
|
-
s.rubygems_version = '2.2'
|
30
|
+
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
36
31
|
s.required_ruby_version = '~>2.3'
|
37
32
|
s.name = 'glogin'
|
38
33
|
s.version = GLogin::VERSION
|
@@ -44,15 +39,16 @@ Gem::Specification.new do |s|
|
|
44
39
|
s.homepage = 'http://github.com/yegor256/glogin'
|
45
40
|
s.files = `git ls-files`.split($RS)
|
46
41
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
47
|
-
s.test_files = s.files.grep(%r{^(test)/})
|
48
42
|
s.rdoc_options = ['--charset=UTF-8']
|
49
43
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
50
|
-
s.
|
51
|
-
s.add_development_dependency '
|
52
|
-
s.add_development_dependency '
|
53
|
-
s.add_development_dependency '
|
54
|
-
s.add_development_dependency '
|
55
|
-
s.add_development_dependency '
|
56
|
-
s.add_development_dependency 'rubocop
|
57
|
-
s.add_development_dependency '
|
44
|
+
s.add_runtime_dependency 'base58', '0.2.3'
|
45
|
+
s.add_development_dependency 'codecov', '0.6.0'
|
46
|
+
s.add_development_dependency 'minitest', '5.16.1'
|
47
|
+
s.add_development_dependency 'rake', '13.0.6'
|
48
|
+
s.add_development_dependency 'rdoc', '6.4.0'
|
49
|
+
s.add_development_dependency 'rspec-rails', '5.1.2'
|
50
|
+
s.add_development_dependency 'rubocop', '1.31.1'
|
51
|
+
s.add_development_dependency 'rubocop-rspec', '2.11.1'
|
52
|
+
s.add_development_dependency 'webmock', '3.14.0'
|
53
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
58
54
|
end
|
data/lib/glogin/auth.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -28,7 +28,7 @@ require 'cgi'
|
|
28
28
|
|
29
29
|
# GLogin main module.
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
31
|
-
# Copyright:: Copyright (c) 2017-
|
31
|
+
# Copyright:: Copyright (c) 2017-2022 Yegor Bugayenko
|
32
32
|
# License:: MIT
|
33
33
|
module GLogin
|
34
34
|
#
|
@@ -45,10 +45,7 @@ module GLogin
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def login_uri
|
48
|
-
|
49
|
-
CGI.escape(@id) +
|
50
|
-
'&redirect_uri=' +
|
51
|
-
CGI.escape(@redirect)
|
48
|
+
"https://github.com/login/oauth/authorize?client_id=#{CGI.escape(@id)}&redirect_uri=#{CGI.escape(@redirect)}"
|
52
49
|
end
|
53
50
|
|
54
51
|
def user(code)
|
data/lib/glogin/codec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -24,63 +24,64 @@
|
|
24
24
|
require 'securerandom'
|
25
25
|
require 'openssl'
|
26
26
|
require 'digest/sha1'
|
27
|
-
require '
|
27
|
+
require 'base58'
|
28
28
|
|
29
29
|
# Codec.
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
31
|
-
# Copyright:: Copyright (c) 2017-
|
31
|
+
# Copyright:: Copyright (c) 2017-2022 Yegor Bugayenko
|
32
32
|
# License:: MIT
|
33
|
-
|
34
|
-
#
|
35
|
-
|
36
|
-
#
|
37
|
-
class Codec
|
38
|
-
def initialize(secret = '')
|
39
|
-
raise 'Secret can\'t be nil' if secret.nil?
|
40
|
-
@secret = secret
|
41
|
-
end
|
33
|
+
class GLogin::Codec
|
34
|
+
# When can't decode.
|
35
|
+
class DecodingError < StandardError; end
|
42
36
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
else
|
48
|
-
cpr = cipher
|
49
|
-
cpr.decrypt
|
50
|
-
cpr.key = digest
|
51
|
-
plain = Base64.decode64(text)
|
52
|
-
raise OpenSSL::Cipher::CipherError if plain.empty?
|
53
|
-
decrypted = cpr.update(plain)
|
54
|
-
decrypted << cpr.final
|
55
|
-
salt, body = decrypted.to_s.split(' ', 2)
|
56
|
-
raise OpenSSL::Cipher::CipherError if salt.empty?
|
57
|
-
raise OpenSSL::Cipher::CipherError if body.nil?
|
58
|
-
body.force_encoding('UTF-8')
|
59
|
-
body
|
60
|
-
end
|
61
|
-
end
|
37
|
+
def initialize(secret = '')
|
38
|
+
raise 'Secret can\'t be nil' if secret.nil?
|
39
|
+
@secret = secret
|
40
|
+
end
|
62
41
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
42
|
+
def decrypt(text)
|
43
|
+
raise 'Text can\'t be nil' if text.nil?
|
44
|
+
if @secret.empty?
|
45
|
+
text
|
46
|
+
else
|
47
|
+
cpr = cipher
|
48
|
+
cpr.decrypt
|
49
|
+
cpr.key = digest
|
50
|
+
raise DecodingError unless /^[a-zA-Z0-9]+$/.match?(text)
|
51
|
+
plain = Base58.base58_to_binary(text)
|
52
|
+
raise DecodingError if plain.empty?
|
53
|
+
decrypted = cpr.update(plain)
|
54
|
+
decrypted << cpr.final
|
55
|
+
salt, body = decrypted.to_s.split(' ', 2)
|
56
|
+
raise DecodingError if salt.empty?
|
57
|
+
raise DecodingError if body.nil?
|
58
|
+
body.force_encoding('UTF-8')
|
59
|
+
body
|
76
60
|
end
|
61
|
+
rescue OpenSSL::Cipher::CipherError => e
|
62
|
+
raise DecodingError, e.message
|
63
|
+
end
|
77
64
|
|
78
|
-
|
79
|
-
|
65
|
+
def encrypt(text)
|
66
|
+
raise 'Text can\'t be nil' if text.nil?
|
67
|
+
if @secret.empty?
|
68
|
+
text
|
69
|
+
else
|
70
|
+
cpr = cipher
|
71
|
+
cpr.encrypt
|
72
|
+
cpr.key = digest
|
73
|
+
salt = SecureRandom.base64(Random.rand(8..32))
|
74
|
+
encrypted = cpr.update("#{salt} #{text}")
|
75
|
+
encrypted << cpr.final
|
76
|
+
Base58.binary_to_base58(encrypted)
|
80
77
|
end
|
78
|
+
end
|
81
79
|
|
82
|
-
|
83
|
-
|
84
|
-
|
80
|
+
def digest
|
81
|
+
Digest::SHA1.hexdigest(@secret)[0..31]
|
82
|
+
end
|
83
|
+
|
84
|
+
def cipher
|
85
|
+
OpenSSL::Cipher.new('aes-256-cbc')
|
85
86
|
end
|
86
87
|
end
|
data/lib/glogin/cookie.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -28,7 +28,7 @@ require_relative 'codec'
|
|
28
28
|
|
29
29
|
# GLogin main module.
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
31
|
-
# Copyright:: Copyright (c) 2017-
|
31
|
+
# Copyright:: Copyright (c) 2017-2022 Yegor Bugayenko
|
32
32
|
# License:: MIT
|
33
33
|
module GLogin
|
34
34
|
# Split symbol inside the cookie text
|
@@ -51,18 +51,18 @@ module GLogin
|
|
51
51
|
# Returns a hash with two elements: login and avatar.
|
52
52
|
# If the secret is empty, the text will be returned, without
|
53
53
|
# any decryption. If the data is not valid, an exception
|
54
|
-
#
|
54
|
+
# GLogin::Codec::DecodingError will be raised, which you have
|
55
55
|
# to catch in your applicaiton and ignore the login attempt.
|
56
56
|
def to_user
|
57
57
|
plain = Codec.new(@secret).decrypt(@text)
|
58
|
-
login, avatar, bearer, ctx = plain.split(GLogin::SPLIT,
|
58
|
+
id, login, avatar, bearer, ctx = plain.split(GLogin::SPLIT, 5)
|
59
59
|
if !@secret.empty? && ctx.to_s != @context
|
60
60
|
raise(
|
61
|
-
|
61
|
+
GLogin::Codec::DecodingError,
|
62
62
|
"Context '#{@context}' expected, but '#{ctx}' found"
|
63
63
|
)
|
64
64
|
end
|
65
|
-
{ login: login, avatar: avatar, bearer: bearer }
|
65
|
+
{ id: id, login: login, avatar: avatar, bearer: bearer }
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
@@ -77,6 +77,11 @@ module GLogin
|
|
77
77
|
@context = context.to_s
|
78
78
|
end
|
79
79
|
|
80
|
+
# GitHub id of the authenticated user
|
81
|
+
def id
|
82
|
+
@json['id']
|
83
|
+
end
|
84
|
+
|
80
85
|
# GitHub login name of the authenticated user
|
81
86
|
def login
|
82
87
|
@json['login']
|
@@ -91,6 +96,7 @@ module GLogin
|
|
91
96
|
def to_s
|
92
97
|
Codec.new(@secret).encrypt(
|
93
98
|
[
|
99
|
+
id,
|
94
100
|
login,
|
95
101
|
avatar_url,
|
96
102
|
@json['bearer'],
|
data/lib/glogin/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -23,8 +23,8 @@
|
|
23
23
|
|
24
24
|
# GLogin main module.
|
25
25
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
26
|
-
# Copyright:: Copyright (c) 2017-
|
26
|
+
# Copyright:: Copyright (c) 2017-2022 Yegor Bugayenko
|
27
27
|
# License:: MIT
|
28
28
|
module GLogin
|
29
|
-
VERSION = '0.
|
29
|
+
VERSION = '0.8.0'
|
30
30
|
end
|
data/lib/glogin.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -28,7 +28,7 @@ require_relative 'glogin/cookie'
|
|
28
28
|
|
29
29
|
# GLogin main module.
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
31
|
-
# Copyright:: Copyright (c) 2017-
|
31
|
+
# Copyright:: Copyright (c) 2017-2022 Yegor Bugayenko
|
32
32
|
# License:: MIT
|
33
33
|
module GLogin
|
34
34
|
end
|
data/logo.svg
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="314px" height="314px" viewBox="0 0 314 314" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3
|
+
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
|
4
|
+
<title>Group 2</title>
|
5
|
+
<desc>Created with Sketch.</desc>
|
6
|
+
<defs></defs>
|
7
|
+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
8
|
+
<g id="Group-2">
|
9
|
+
<g id="Group">
|
10
|
+
<circle id="Oval" fill="#053C5E" cx="157" cy="157" r="157"></circle>
|
11
|
+
<rect id="Rectangle" fill="#2B2B2B" x="0" y="234" width="233" height="68"></rect>
|
12
|
+
<text id="glogin" font-family="CourierNewPS-BoldMT, Courier New" font-size="50" font-weight="bold" fill="#FFFFFF">
|
13
|
+
<tspan x="28" y="282">glogin</tspan>
|
14
|
+
</text>
|
15
|
+
<path d="M135.676765,111.215287 C135.211714,113.540467 132.770932,120.688823 130.252813,127.100603 C127.734621,133.512383 125.2898,140.431445 124.819828,142.476214 C123.6868,147.405663 121.517836,147.185477 119.69487,141.95608 C116.899865,133.938362 105.171362,111.043501 103.859129,111.043501 C100.420089,111.043501 101.508757,114.986149 109.1771,130.30227 C113.739327,139.414532 118.032086,147.448041 118.716515,148.15443 C120.694817,150.196115 120.172626,154.319657 117.358599,158.877992 C113.567467,165.019055 107.570942,183.721189 108.054206,187.896804 C108.804956,194.383204 112.436054,192.210274 113.355359,184.724515 C114.48376,175.535577 120.945556,159.641154 124.897459,156.333653 C127.109021,154.482778 128.268636,151.905536 128.573284,148.163978 C128.818001,145.157747 131.906711,135.560972 135.437115,126.837819 C138.96752,118.114666 141.511492,110.079835 141.090434,108.982574 C139.755727,105.504315 136.554941,106.824333 135.676765,111.215287 M174.714659,126.841564 C169.37392,129.699438 169.197653,130.049915 167.452978,141.283475 C165.577352,153.360398 165.225112,168.513913 166.548289,180.203784 L167.566817,189.202501 L161.346213,191.9541 C154.601949,194.937416 150.91195,200.302465 153.156708,203.861146 C155.104824,206.949562 157.09025,206.70198 157.571826,203.310532 C158.083734,199.706169 166.097413,193.204052 170.29418,192.987978 C172.116999,192.894116 173.522874,191.717021 173.97823,189.903529 C174.383277,188.290613 177.740353,184.944554 181.438431,182.467858 C188.546172,177.707551 194.317883,170.450278 194.317883,166.273341 C194.317883,162.684548 189.493165,158.361603 185.487795,158.361603 C180.701636,158.361603 180.027195,155.239403 183.731222,150.229385 C188.308065,144.038966 188.284856,130.867646 183.690534,127.147387 C179.896537,124.075276 179.885006,124.074836 174.714659,126.841564 M182.67318,134.240439 C184.752542,140.153164 174.808961,161.185104 171.588639,157.68562 C169.868715,155.81653 172.863122,135.012708 175.266374,132.134564 C177.872553,129.013319 181.163896,129.949075 182.67318,134.240439 M184.854262,162.269586 C190.589839,163.855621 189.673839,167.881335 181.645765,176.371155 C177.281618,180.986262 173.904933,183.573859 173.371946,182.711474 C172.876636,181.91012 172.127869,176.711937 171.707987,171.159972 L170.944531,161.065463 L176.209475,161.200234 C179.105172,161.274339 182.995308,161.755548 184.854262,162.269586 M132.642184,172.492256 C131.593837,175.224098 133.152917,177.288844 136.264027,177.288844 C139.014965,177.288844 139.431396,176.221769 138.067531,172.667568 C137.039234,169.987871 133.645289,169.878218 132.642184,172.492256 M203.781503,185.840798 C203.781503,187.657595 209.264724,193.512152 210.966361,193.512152 C212.534035,193.512152 211.991059,187.391138 210.270768,185.670847 C208.092403,183.492409 203.781503,183.605293 203.781503,185.840798" id="Fill-6" fill="#427B8A" fill-rule="nonzero"></path>
|
16
|
+
</g>
|
17
|
+
</g>
|
18
|
+
</g>
|
19
|
+
</svg>
|
data/test/glogin/test_auth.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -29,13 +29,11 @@ class TestAuth < Minitest::Test
|
|
29
29
|
def test_authenticate_via_https
|
30
30
|
auth = GLogin::Auth.new('1234', '4433', 'https://example.org')
|
31
31
|
stub_request(:post, 'https://github.com/login/oauth/access_token').to_return(
|
32
|
-
status: 200,
|
33
32
|
body: {
|
34
33
|
access_token: 'some-token'
|
35
34
|
}.to_json
|
36
35
|
)
|
37
36
|
stub_request(:get, 'https://api.github.com/user').to_return(
|
38
|
-
status: 200,
|
39
37
|
body: {
|
40
38
|
auth_code: '437849732894732',
|
41
39
|
login: 'yegor256'
|
data/test/glogin/test_codec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -22,6 +22,7 @@
|
|
22
22
|
# SOFTWARE.
|
23
23
|
|
24
24
|
require 'minitest/autorun'
|
25
|
+
require 'base64'
|
25
26
|
require_relative '../../lib/glogin/codec'
|
26
27
|
|
27
28
|
class TestCodec < Minitest::Test
|
@@ -40,7 +41,7 @@ class TestCodec < Minitest::Test
|
|
40
41
|
end
|
41
42
|
|
42
43
|
def test_decrypts_with_invalid_password
|
43
|
-
assert_raises
|
44
|
+
assert_raises GLogin::Codec::DecodingError do
|
44
45
|
GLogin::Codec.new('the wrong key').decrypt(
|
45
46
|
GLogin::Codec.new('the right key').encrypt('the text')
|
46
47
|
)
|
@@ -49,12 +50,12 @@ class TestCodec < Minitest::Test
|
|
49
50
|
|
50
51
|
def test_encrypts_into_plain_string
|
51
52
|
text = GLogin::Codec.new('6hFGrte5LLmwi').encrypt("K&j\n\n\tuIpwp00{]=")
|
52
|
-
assert(text =~
|
53
|
+
assert(text =~ /^[a-zA-Z0-9]+$/, text)
|
53
54
|
assert(!text.include?("\n"), text)
|
54
55
|
end
|
55
56
|
|
56
57
|
def test_decrypts_broken_text
|
57
|
-
assert_raises
|
58
|
+
assert_raises GLogin::Codec::DecodingError do
|
58
59
|
GLogin::Codec.new('the key').decrypt('этот текст не был зашифрован')
|
59
60
|
end
|
60
61
|
end
|
data/test/glogin/test_cookie.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -30,7 +30,8 @@ class TestCookie < Minitest::Test
|
|
30
30
|
user = GLogin::Cookie::Closed.new(
|
31
31
|
GLogin::Cookie::Open.new(
|
32
32
|
JSON.parse(
|
33
|
-
"{\"
|
33
|
+
"{\"id\":\"123\",
|
34
|
+
\"login\":\"yegor256\",
|
34
35
|
\"avatar_url\":\"https://avatars1.githubusercontent.com/u/526301\"}"
|
35
36
|
),
|
36
37
|
secret
|
@@ -46,35 +47,38 @@ class TestCookie < Minitest::Test
|
|
46
47
|
context = '127.0.0.1'
|
47
48
|
user = GLogin::Cookie::Closed.new(
|
48
49
|
GLogin::Cookie::Open.new(
|
49
|
-
JSON.parse('{"login":"jeffrey","avatar_url":"#"}'),
|
50
|
+
JSON.parse('{"id":"123","login":"jeffrey","avatar_url":"#"}'),
|
50
51
|
secret,
|
51
52
|
context
|
52
53
|
).to_s,
|
53
54
|
secret,
|
54
55
|
context
|
55
56
|
).to_user
|
57
|
+
assert_equal(user[:id], '123')
|
56
58
|
assert_equal(user[:login], 'jeffrey')
|
57
59
|
assert_equal(user[:avatar], '#')
|
58
60
|
end
|
59
61
|
|
60
62
|
def test_decrypts_in_test_mode
|
61
63
|
user = GLogin::Cookie::Closed.new(
|
62
|
-
'test|http://example.com', ''
|
64
|
+
'123|test|http://example.com', ''
|
63
65
|
).to_user
|
66
|
+
assert_equal(user[:id], '123')
|
64
67
|
assert_equal(user[:login], 'test')
|
65
68
|
assert_equal(user[:avatar], 'http://example.com')
|
66
69
|
end
|
67
70
|
|
68
71
|
def test_decrypts_in_test_mode_with_context
|
69
72
|
user = GLogin::Cookie::Closed.new(
|
70
|
-
'
|
73
|
+
'123', '', 'some context'
|
71
74
|
).to_user
|
72
|
-
assert_equal('
|
75
|
+
assert_equal('123', user[:id])
|
76
|
+
assert_nil(user[:login])
|
73
77
|
assert_nil(user[:avatar])
|
74
78
|
end
|
75
79
|
|
76
80
|
def test_fails_on_broken_text
|
77
|
-
assert_raises
|
81
|
+
assert_raises GLogin::Codec::DecodingError do
|
78
82
|
GLogin::Cookie::Closed.new(
|
79
83
|
GLogin::Cookie::Open.new(
|
80
84
|
JSON.parse('{"login":"x","avatar_url":"x"}'),
|
@@ -87,7 +91,7 @@ class TestCookie < Minitest::Test
|
|
87
91
|
|
88
92
|
def test_fails_on_wrong_context
|
89
93
|
secret = 'fdjruewoijs789fdsufds89f7ds89fs'
|
90
|
-
assert_raises
|
94
|
+
assert_raises GLogin::Codec::DecodingError do
|
91
95
|
GLogin::Cookie::Closed.new(
|
92
96
|
GLogin::Cookie::Open.new(
|
93
97
|
JSON.parse('{"login":"x","avatar_url":"x"}'),
|
data/test/test__helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -21,7 +21,7 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
22
|
# SOFTWARE.
|
23
23
|
|
24
|
-
|
24
|
+
$stdout.sync = true
|
25
25
|
|
26
26
|
require 'simplecov'
|
27
27
|
SimpleCov.start
|
data/test/test_glogin.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#
|
4
|
-
# Copyright (c) 2017-
|
4
|
+
# Copyright (c) 2017-2022 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -26,7 +26,7 @@ require_relative '../lib/glogin'
|
|
26
26
|
|
27
27
|
# GLogin main module test.
|
28
28
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
|
-
# Copyright:: Copyright (c) 2017-
|
29
|
+
# Copyright:: Copyright (c) 2017-2022 Yegor Bugayenko
|
30
30
|
# License:: MIT
|
31
31
|
class TestGLogin < Minitest::Test
|
32
32
|
def test_basic
|
metadata
CHANGED
@@ -1,127 +1,141 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glogin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: base58
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.2.3
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.2.3
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: codecov
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
31
|
- - '='
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
33
|
+
version: 0.6.0
|
20
34
|
type: :development
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
38
|
- - '='
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
40
|
+
version: 0.6.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: minitest
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - '='
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: 5.
|
47
|
+
version: 5.16.1
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - '='
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: 5.
|
54
|
+
version: 5.16.1
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - '='
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
61
|
+
version: 13.0.6
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - '='
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
68
|
+
version: 13.0.6
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rdoc
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - '='
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.
|
75
|
+
version: 6.4.0
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - '='
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: 4.
|
82
|
+
version: 6.4.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rspec-rails
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - '='
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
89
|
+
version: 5.1.2
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - '='
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
96
|
+
version: 5.1.2
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rubocop
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - '='
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
103
|
+
version: 1.31.1
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - '='
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
110
|
+
version: 1.31.1
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rubocop-rspec
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - '='
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
117
|
+
version: 2.11.1
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - '='
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
124
|
+
version: 2.11.1
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: webmock
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - '='
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: 3.
|
131
|
+
version: 3.14.0
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - '='
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: 3.
|
138
|
+
version: 3.14.0
|
125
139
|
description: Enables login/logout functionality for a Ruby web app
|
126
140
|
email: yegor256@gmail.com
|
127
141
|
executables: []
|
@@ -132,12 +146,15 @@ extra_rdoc_files:
|
|
132
146
|
files:
|
133
147
|
- ".0pdd.yml"
|
134
148
|
- ".gitattributes"
|
149
|
+
- ".github/ISSUE_TEMPLATE.md"
|
150
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
151
|
+
- ".github/workflows/codecov.yml"
|
152
|
+
- ".github/workflows/rake.yml"
|
135
153
|
- ".gitignore"
|
136
154
|
- ".pdd"
|
137
155
|
- ".rubocop.yml"
|
138
156
|
- ".rultor.yml"
|
139
157
|
- ".simplecov"
|
140
|
-
- ".travis.yml"
|
141
158
|
- Gemfile
|
142
159
|
- LICENSE.txt
|
143
160
|
- README.md
|
@@ -148,6 +165,7 @@ files:
|
|
148
165
|
- lib/glogin/codec.rb
|
149
166
|
- lib/glogin/cookie.rb
|
150
167
|
- lib/glogin/version.rb
|
168
|
+
- logo.svg
|
151
169
|
- test/glogin/test_auth.rb
|
152
170
|
- test/glogin/test_codec.rb
|
153
171
|
- test/glogin/test_cookie.rb
|
@@ -156,7 +174,8 @@ files:
|
|
156
174
|
homepage: http://github.com/yegor256/glogin
|
157
175
|
licenses:
|
158
176
|
- MIT
|
159
|
-
metadata:
|
177
|
+
metadata:
|
178
|
+
rubygems_mfa_required: 'true'
|
160
179
|
post_install_message:
|
161
180
|
rdoc_options:
|
162
181
|
- "--charset=UTF-8"
|
@@ -173,13 +192,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
192
|
- !ruby/object:Gem::Version
|
174
193
|
version: '0'
|
175
194
|
requirements: []
|
176
|
-
rubygems_version: 3.
|
195
|
+
rubygems_version: 3.1.2
|
177
196
|
signing_key:
|
178
|
-
specification_version:
|
197
|
+
specification_version: 4
|
179
198
|
summary: Login/logout via GitHub OAuth for your web app
|
180
|
-
test_files:
|
181
|
-
- test/glogin/test_auth.rb
|
182
|
-
- test/glogin/test_codec.rb
|
183
|
-
- test/glogin/test_cookie.rb
|
184
|
-
- test/test__helper.rb
|
185
|
-
- test/test_glogin.rb
|
199
|
+
test_files: []
|