omniauth-vis 0.0.8 → 0.0.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fff8038574bf91729b2f16a86e8ab9715838465182ec84d53bb52e99358eebf5
4
- data.tar.gz: 0d594fa3bb66c5eef23860466287b70fad945689b1659091ce96d1dd9009b173
3
+ metadata.gz: b14af6f1e3470751c7d59576d8f4e36955bbac66993a428c4ad25cc7c0c55c93
4
+ data.tar.gz: 238c6eb40d541a52ed53c28dec01cffce45f3a96ed145b14cb44d34c943e71aa
5
5
  SHA512:
6
- metadata.gz: ea3a60610a40dcf505c9640d5e3c954fe74a90efe1e78c35fdb9d80cd072c611664302a065285d0e4b1eeec802cba0d020a32354be98d7535563840d94fb7267
7
- data.tar.gz: 6db202573cb2234b42d626230d798226ca2b4729d6fda9a54d35a57481e7be21c0e147f315d98e5db36eb542ea169b0c42e2385b2d9e0a837447cf14e0b0d76e
6
+ metadata.gz: '01120799fc73d04e6efec71f0110728862a4375d46d29a99946420337e8982f5165b95ab443a69ba5fbf3ad0901303afc5d26e2624d38e508afdb4108e77d4a2'
7
+ data.tar.gz: c07bbb587a80adf75747e9f526b1366c470a060365dd995590742b5955b7cf88fd9a02f0988c79f83f854f2f40dd8d5cdcf449377d24ffd6de7e1d8a41f5bf75
data/README.md CHANGED
@@ -53,17 +53,17 @@ end
53
53
 
54
54
  ```
55
55
  require "vis/api"
56
- @vis_api = Vis::Api.new
57
- @vis_service.get("api_path")
58
- @vis_service.post("api_path", data)
56
+ @vis_api = Vis::Api.new(client_id: "xx", client_secret: "xx", server_url: "https://identity.dhamma.org")
57
+ @vis_api.get("api_path")
58
+ @vis_api.post("api_path", data)
59
59
  ```
60
60
 
61
- Documentation about available api can be found at [https://identity.server.dhamma.org/doc](https://identity.server.dhamma.org/doc)
61
+ Documentation about available api can be found at [https://test.identity.dhamma.org/doc](https://test.identity.dhamma.org/doc)
62
62
 
63
63
  Example
64
64
 
65
65
  ```
66
- Vis::Api.new.post("/api/v1/users", {
66
+ @vis_api.post("/api/v1/users", {
67
67
  email: "email@test.com",
68
68
  username: "test",
69
69
  encrypted_password: "xxxxxxxxxx"
data/lib/vis/api.rb CHANGED
@@ -2,10 +2,10 @@
2
2
  # gets tokens so we can use the VIS API
3
3
  module Vis
4
4
  class Api
5
- def initialize
6
- @client_id = Rails.application.config.vis["app_id"]
7
- @client_secret = Rails.application.config.vis["app_secret"]
8
- @vis_app_url = Rails.application.config.vis["app_url"]
5
+ def initialize(server_url: "https://identity.dhamma.org", client_id:, client_secret:)
6
+ @client_id = client_id
7
+ @client_secret = client_secret
8
+ @vis_app_url = server_url
9
9
  @use_ssl = !Rails.env.development?
10
10
  end
11
11
 
@@ -30,10 +30,8 @@ module Vis
30
30
  end
31
31
 
32
32
  private def token_post
33
- # uri = URI.parse("#{@vis_app_url})
34
33
  http_client, uri = http_client_and_uri "/oauth/token"
35
34
  request = Net::HTTP::Post.new(uri.request_uri)
36
- # request.set_form_data({ "client_id" => @client_id, "client_secret" => @client_secret,
37
35
  request.set_form_data({ "client_id" => @client_id, "client_secret" => @client_secret,
38
36
  "grant_type" => "client_credentials" })
39
37
  http_client.request(request)
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.0.8'
5
+ gem.version = '0.0.9'
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.0.8
4
+ version: 0.0.9
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-07-04 00:00:00.000000000 Z
11
+ date: 2023-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2