omniauth-vipps 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6807d81bc13f103ba6d3daa336f377e89a14b107cfad19bb33e4242f5658841c
4
- data.tar.gz: 6f8622804f9b97831356a85daf4a1ec3c5176d87905204550da5fb1290f43fcd
3
+ metadata.gz: 4e9e1bddbb16c68d1750bf462384f8db87c481b92c216fbe271efe66a9f68214
4
+ data.tar.gz: c46233d0c20f38769aefba986181dca5d10e05c9b7b24e2dfd106ac4998259a4
5
5
  SHA512:
6
- metadata.gz: 9bba529c9bd9a1d814dcb4ef82eaee101ccfb4b4bf1df85def7b7a7b469337fa23ee5803b8892cae753785c2bde9def881b466078d39acc49710b938d2a5dab3
7
- data.tar.gz: e70c114d9cfa25c62d8db5adea2601b043914b76474e6185ac81e7b398f2a5a8d64550373f4aef58fd66941fb5492003ff62a2a01cb93c9d25a462b94d81b020
6
+ metadata.gz: 9b7bf89d83669346efa0f2aacdcd146c5447572954a511abb1691c310af26b4885b12f84e346c1ef010b373c16524edf4ca8e348f236c2b3d02589d3b75e0c0c
7
+ data.tar.gz: f9bbe8eaf12fc8fd19dcaa183df744c893495a569cab609f45349c101d51d0ecc822719df9cda32123e20d06c5203c9475c7f061bd2ce248591af7da48dd8163
data/.gitignore CHANGED
@@ -7,7 +7,11 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
 
10
- omniauth-vipps-1.0.0.gem
10
+ *.gem
11
+ *.rbc
12
+ .config
13
+ Gemfile.lock
14
+ **/*/.DS_Store
11
15
 
12
16
  # rspec failure tracking
13
17
  .rspec_status
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ source "https://rubygems.org"
5
5
  gem "rake", "~> 13.0"
6
6
 
7
7
  group :test do
8
- gem "addressable", "~> 2.3.8"
8
+ gem "addressable", ">= 2.8.0"
9
9
  gem 'coveralls_reborn', '~> 0.19.0'
10
10
  gem "json"
11
11
  gem "mime-types", "~> 1.25"
data/README.md CHANGED
@@ -1,76 +1,79 @@
1
- # OmniAuth OAuth2
1
+ # OmniAuth Vipps
2
2
 
3
- [![Gem Version](http://img.shields.io/gem/v/omniauth-oauth2.svg)][gem]
4
- [![Code Climate](http://img.shields.io/codeclimate/maintainability/intridea/omniauth-oauth2.svg)][codeclimate]
5
- [![Coverage Status](http://img.shields.io/coveralls/intridea/omniauth-oauth2.svg)][coveralls]
6
- [![Security](https://hakiri.io/github/omniauth/omniauth-oauth2/master.svg)](https://hakiri.io/github/omniauth/omniauth-oauth2/master)
3
+ [![Gem Version](http://img.shields.io/gem/v/omniauth-vipps.svg)][gem]
4
+ [![Code Climate](http://img.shields.io/codeclimate/maintainability/maxig/omniauth-vipps.svg)][codeclimate]
5
+ [![Coverage Status](http://img.shields.io/coveralls/maxig/omniauth-vipps.svg)][coveralls]
6
+ [![Security](https://hakiri.io/github/omniauth/omniauth-vipps/master.svg)](https://hakiri.io/github/omniauth/omniauth-vipps/master)
7
7
 
8
- [gem]: https://rubygems.org/gems/omniauth-oauth2
9
- [codeclimate]: https://codeclimate.com/github/intridea/omniauth-oauth2
10
- [coveralls]: https://coveralls.io/r/intridea/omniauth-oauth2
8
+ [gem]: https://rubygems.org/gems/omniauth-vipps
9
+ [codeclimate]: https://codeclimate.com/github/maxig/omniauth-vipps
10
+ [coveralls]: https://coveralls.io/r/maxig/omniauth-vipps
11
11
 
12
- This gem contains a generic OAuth2 strategy for OmniAuth. It is meant to serve
13
- as a building block strategy for other strategies and not to be used
14
- independently (since it has no inherent way to gather uid and user info).
12
+ This gem contains a Oauth2 strategy for VIPPS. It is meant to serve
13
+ the login functionality to allow a secure authentication. To
14
+ use it, you'll need to sign up for an OAuth2 Client ID and Client Secret
15
+ on the [Vipps Development portal](https://portal.vipps.no).
15
16
 
16
- ## Creating an OAuth2 Strategy
17
+ ## Installation
17
18
 
18
- To create an OmniAuth OAuth2 strategy using this gem, you can simply subclass
19
- it and add a few extra methods like so:
19
+ ```ruby
20
+ gem 'omniauth-vipps', '~> 1.0.0'
21
+ ```
22
+
23
+ ## Basic Usage
24
+
25
+ ```ruby
26
+ use OmniAuth::Builder do
27
+ provider :vipps, ENV['VIPPS_CLEINT_ID'], ENV['VIPPS_CLIENT_SECRET']
28
+ end
29
+ ```
30
+
31
+ ## Basic Usage - Rails
32
+
33
+ In `config/initializers/vipps.rb`
34
+
35
+ ```ruby
36
+ Rails.application.config.middleware.use OmniAuth::Builder do
37
+ provider :vipps, ENV['VIPPS_CLEINT_ID'], ENV['VIPPS_CLIENT_SECRET']
38
+ end
39
+ ```
40
+
41
+ ## Basic Usage - Devise
42
+
43
+ NOTE: When using Devise, ignore Basic Usage altogether. Otherwise, you might run into problems of defining a strategy several times.
44
+ In `config/initializers/devise.rb`
20
45
 
21
46
  ```ruby
22
- require 'omniauth-oauth2'
23
-
24
- module OmniAuth
25
- module Strategies
26
- class SomeSite < OmniAuth::Strategies::OAuth2
27
- # Give your strategy a name.
28
- option :name, "some_site"
29
-
30
- # This is where you pass the options you would pass when
31
- # initializing your consumer from the OAuth gem.
32
- option :client_options, {:site => "https://api.somesite.com"}
33
-
34
- # You may specify that your strategy should use PKCE by setting
35
- # the pkce option to true: https://tools.ietf.org/html/rfc7636
36
- option :pkce, true
37
-
38
- # These are called after authentication has succeeded. If
39
- # possible, you should try to set the UID without making
40
- # additional calls (if the user id is returned with the token
41
- # or as a URI parameter). This may not be possible with all
42
- # providers.
43
- uid{ raw_info['id'] }
44
-
45
- info do
46
- {
47
- :name => raw_info['name'],
48
- :email => raw_info['email']
49
- }
50
- end
51
-
52
- extra do
53
- {
54
- 'raw_info' => raw_info
55
- }
56
- end
57
-
58
- def raw_info
59
- @raw_info ||= access_token.get('/me').parsed
60
- end
61
- end
47
+ Devise.setup do |config|
48
+ ...
49
+ config.omniauth :vipps, ENV['VIPPS_CLEINT_ID'], ENV['VIPPS_CLIENT_SECRET']
50
+ ...
62
51
  end
52
+ ```
53
+
54
+ ## Scopes
55
+
56
+ Vipps Login API lets you set scopes to provide granular access to different types of data:
57
+
58
+ ```ruby
59
+ use OmniAuth::Builder do
60
+ provider :vipps, ENV['VIPPS_CLEINT_ID'], ENV['VIPPS_CLIENT_SECRET'], scope: "openid email"
63
61
  end
64
62
  ```
65
63
 
66
- That's pretty much it!
64
+ More info on [Scopes](https://developer.vippsmobilepay.com/docs/APIs/login-api/api-guide/core-concepts/#scopes).
65
+
66
+
67
+ ## Semver
68
+ This project adheres to Semantic Versioning 2.0.0. Any violations of this scheme are considered to be bugs.
69
+ All changes will be tracked [here](https://github.com/omniauth/omniauth-github/releases).
67
70
 
68
- ## OmniAuth-OAuth2 for Enterprise
71
+ ## License
69
72
 
70
- Available as part of the Tidelift Subscription.
73
+ Copyright (c) 2011 Max Gordienok and Goscore AS.
71
74
 
72
- The maintainers of OmniAuth-OAuth2 and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/rubygems-omniauth-oauth2?utm_source=undefined&utm_medium=referral&utm_campaign=enterprise)
75
+ 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:
73
76
 
74
- ## Supported Ruby Versions
77
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
75
78
 
76
- OmniAuth is tested under 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, truffleruby, and JRuby.
79
+ 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.
@@ -6,7 +6,7 @@ module OmniAuth
6
6
  # Main class for Vipps OAuth2 strategy.
7
7
  class Vipps < OmniAuth::Strategies::OAuth2
8
8
  DEFAULT_SCOPE = 'openid name phoneNumber address birthDate email'
9
- BASE_URL = 'https://apitest.vipps.no'
9
+ BASE_URL = 'https://api.vipps.no'
10
10
  USER_INFO_URL = '/vipps-userinfo-api/userinfo/'
11
11
 
12
12
  option :name, 'vipps'
@@ -3,8 +3,10 @@
3
3
  module OmniAuth
4
4
  module Strategies
5
5
  # Main class for Vipps OAuth2 strategy.
6
- class VippsTest < Vipps
6
+ class VippsTest < OmniAuth::Strategies::Vipps
7
7
  BASE_URL = 'https://apitest.vipps.no'
8
+
9
+ option :name, 'vipps_test'
8
10
  end
9
11
  end
10
12
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Omniauth
4
4
  module Vipps
5
- VERSION = "1.0.0"
5
+ VERSION = "1.0.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-vipps
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maksim Hardziyenak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-22 00:00:00.000000000 Z
11
+ date: 2024-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -55,9 +55,7 @@ dependencies:
55
55
  description: Vipps Mobilepay OmniAuth Strategy for Login
56
56
  email:
57
57
  - aikismax@gmail.com
58
- executables:
59
- - console
60
- - setup
58
+ executables: []
61
59
  extensions: []
62
60
  extra_rdoc_files: []
63
61
  files:
@@ -68,14 +66,10 @@ files:
68
66
  - CHANGELOG.md
69
67
  - CODE_OF_CONDUCT.md
70
68
  - Gemfile
71
- - Gemfile.lock
72
69
  - LICENSE.txt
73
70
  - README.md
74
71
  - Rakefile
75
- - bin/console
76
- - bin/setup
77
72
  - lib/omniauth-vipps.rb
78
- - lib/omniauth-vipps/.DS_Store
79
73
  - lib/omniauth-vipps/version.rb
80
74
  - lib/omniauth/strategies/vipps.rb
81
75
  - lib/omniauth/strategies/vipps_test.rb
data/Gemfile.lock DELETED
@@ -1,146 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- omniauth-vipps (1.0.0)
5
- omniauth-oauth2 (~> 1.8)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- addressable (2.3.8)
11
- ast (2.4.2)
12
- base64 (0.2.0)
13
- bigdecimal (3.1.7)
14
- coveralls_reborn (0.19.0)
15
- simplecov (>= 0.18.1, < 0.21.0)
16
- term-ansicolor (~> 1.6)
17
- thor (>= 0.20.3, < 2.0)
18
- tins (~> 1.16)
19
- crack (1.0.0)
20
- bigdecimal
21
- rexml
22
- diff-lcs (1.5.1)
23
- docile (1.4.0)
24
- domain_name (0.6.20240107)
25
- faraday (2.9.0)
26
- faraday-net_http (>= 2.0, < 3.2)
27
- faraday-net_http (3.1.0)
28
- net-http
29
- hashdiff (1.1.0)
30
- hashie (5.0.0)
31
- http-cookie (1.0.5)
32
- domain_name (~> 0.5)
33
- json (2.7.1)
34
- jwt (2.8.1)
35
- base64
36
- language_server-protocol (3.17.0.3)
37
- mime-types (1.25.1)
38
- multi_xml (0.6.0)
39
- net-http (0.4.1)
40
- uri
41
- netrc (0.11.0)
42
- oauth2 (2.0.9)
43
- faraday (>= 0.17.3, < 3.0)
44
- jwt (>= 1.0, < 3.0)
45
- multi_xml (~> 0.5)
46
- rack (>= 1.2, < 4)
47
- snaky_hash (~> 2.0)
48
- version_gem (~> 1.1)
49
- omniauth (2.1.2)
50
- hashie (>= 3.4.6)
51
- rack (>= 2.2.3)
52
- rack-protection
53
- omniauth-oauth2 (1.8.0)
54
- oauth2 (>= 1.4, < 3)
55
- omniauth (~> 2.0)
56
- parallel (1.24.0)
57
- parser (3.3.0.5)
58
- ast (~> 2.4.1)
59
- racc
60
- racc (1.7.3)
61
- rack (3.0.10)
62
- rack-protection (4.0.0)
63
- base64 (>= 0.1.0)
64
- rack (>= 3.0.0, < 4)
65
- rack-test (2.1.0)
66
- rack (>= 1.3)
67
- rainbow (3.1.1)
68
- rake (13.1.0)
69
- regexp_parser (2.9.0)
70
- rest-client (1.8.0)
71
- http-cookie (>= 1.0.2, < 2.0)
72
- mime-types (>= 1.16, < 3.0)
73
- netrc (~> 0.7)
74
- rexml (3.2.6)
75
- rspec (3.13.0)
76
- rspec-core (~> 3.13.0)
77
- rspec-expectations (~> 3.13.0)
78
- rspec-mocks (~> 3.13.0)
79
- rspec-core (3.13.0)
80
- rspec-support (~> 3.13.0)
81
- rspec-expectations (3.13.0)
82
- diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.13.0)
84
- rspec-mocks (3.13.0)
85
- diff-lcs (>= 1.2.0, < 2.0)
86
- rspec-support (~> 3.13.0)
87
- rspec-support (3.13.1)
88
- rubocop (1.62.1)
89
- json (~> 2.3)
90
- language_server-protocol (>= 3.17.0)
91
- parallel (~> 1.10)
92
- parser (>= 3.3.0.2)
93
- rainbow (>= 2.2.2, < 4.0)
94
- regexp_parser (>= 1.8, < 3.0)
95
- rexml (>= 3.2.5, < 4.0)
96
- rubocop-ast (>= 1.31.1, < 2.0)
97
- ruby-progressbar (~> 1.7)
98
- unicode-display_width (>= 2.4.0, < 3.0)
99
- rubocop-ast (1.31.2)
100
- parser (>= 3.3.0.4)
101
- ruby-progressbar (1.13.0)
102
- simplecov (0.20.0)
103
- docile (~> 1.1)
104
- simplecov-html (~> 0.11)
105
- simplecov_json_formatter (~> 0.1)
106
- simplecov-html (0.12.3)
107
- simplecov-lcov (0.8.0)
108
- simplecov_json_formatter (0.1.4)
109
- snaky_hash (2.0.1)
110
- hashie
111
- version_gem (~> 1.1, >= 1.1.1)
112
- sync (0.5.0)
113
- term-ansicolor (1.7.2)
114
- tins (~> 1.0)
115
- thor (1.3.1)
116
- tins (1.32.1)
117
- sync
118
- unicode-display_width (2.5.0)
119
- uri (0.13.0)
120
- version_gem (1.1.4)
121
- webmock (3.13.0)
122
- addressable (>= 2.3.6)
123
- crack (>= 0.3.2)
124
- hashdiff (>= 0.4.0, < 2.0.0)
125
-
126
- PLATFORMS
127
- ruby
128
- x86_64-darwin-23
129
-
130
- DEPENDENCIES
131
- addressable (~> 2.3.8)
132
- coveralls_reborn (~> 0.19.0)
133
- json
134
- mime-types (~> 1.25)
135
- omniauth-vipps!
136
- rack-test
137
- rake (~> 13.0)
138
- rest-client (~> 1.8.0)
139
- rspec (~> 3.2)
140
- rubocop (~> 1.21)
141
- simplecov-lcov
142
- tins (~> 1.13)
143
- webmock (~> 3.0)
144
-
145
- BUNDLED WITH
146
- 2.5.3
data/bin/console DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require "bundler/setup"
5
- require "omniauth-vipps"
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
- require "irb"
11
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
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
Binary file