omniauth-vis 0.1.1 → 0.1.3
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 +4 -4
- data/lib/vis/api.rb +3 -1
- data/omniauth-vis.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baf176a9f71adbad4ee8ea68b42155e5e05965285c940adca114d7427c051bc3
|
4
|
+
data.tar.gz: bbe246db116efa268440e8734c380e3105359f538f9089a2238465bea4340e96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a719d61d694628c41a12a4425a30fa8afac292d7036fffbe9daaed0757031d0fdada1f108247ac7bc9f75f821cdcaf5d0d6b7b365a7cb776a6d0b237461d81dd
|
7
|
+
data.tar.gz: e52f71aef29a2d9bf3b5a22aa918b81ffc8ba88f068bbf1ab627f30d2a6f78c9d69ab5fbb841456611faa4d99b00efa30ddbe3f4e5ee123d581d46135abb2d2c
|
data/lib/vis/api.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Vipassna Identity Server Service - for server to server Oauth 2 client_credentials grant flow
|
2
2
|
# gets tokens so we can use the VIS API
|
3
3
|
module Vis
|
4
|
+
class OauthError < StandardError; end
|
5
|
+
|
4
6
|
class Api
|
5
7
|
def initialize(server_url: "https://identity.dhamma.org", client_id:, client_secret:)
|
6
8
|
@client_id = client_id
|
@@ -24,7 +26,7 @@ module Vis
|
|
24
26
|
private def check_error!(response_code, response_body_hash)
|
25
27
|
return unless response_body_hash["error"].present? || !response_code.in?(["200", "202"]) # 201 ?
|
26
28
|
|
27
|
-
raise
|
29
|
+
raise Vis::OauthError,
|
28
30
|
"#{response_code} Error requesting token from Vipassana Identity Server. "\
|
29
31
|
"#{response_body_hash['error']} #{response_body_hash['error_description']}"
|
30
32
|
end
|
data/omniauth-vis.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'omniauth-vis'
|
5
|
-
gem.version = '0.1.
|
5
|
+
gem.version = '0.1.3'
|
6
6
|
# gem.license = 'MIT'
|
7
7
|
gem.summary = 'Helper to connect to Vipassna Identity Server'
|
8
8
|
gem.description = 'This allows you to connect to Vipassana identity server with your ruby app'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-vis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dhamma workers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|