myinfo 0.1.0 → 0.2.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/myinfo.rb +7 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c42852df0d1859a05e3b6626cc2abb19945cc2072d5cf2313bacc09ce15eb0b
4
- data.tar.gz: 10b5b50b6882dad300511581299872d330df87b3d2df66734af3391406562ead
3
+ metadata.gz: e4f4d83acb9ce5afd75d888d6e555089ba29689b6fe844d32051be9ddba21fd1
4
+ data.tar.gz: 5e05d4a0d40c57fb39fcec4e07e4412c6d25158d440478e89827c5aef176327f
5
5
  SHA512:
6
- metadata.gz: dbee0afc819ced257f4392c0983c787e72347e9248cff74e3d1ff4885314005adc744fb4f14c04e5dff6e35da58aa80df7db74e440600636bc0b6cb727cfca80
7
- data.tar.gz: be29694339f25994661aafa7d2c581ee94a0179d3b66c4db123ccc71a3fc8b51a925dd21a662c3fd9bc44f12d62fea052c736d7c3c1957ff9dab06bbae7cd952
6
+ metadata.gz: 358d683837d81a175ab85f82a27d13789e2244587b711f6d3e3d370d0d7b3eca9780a5654a92d525f2838331da82a5505f2c4c58f00c931f79824967a59e3bac
7
+ data.tar.gz: cad0b5dfb3a0cfad6efc34269a7bce69572dec34dc44ab709203a88ac5c02d34490cb6609e2e60bc79f0a47f95f60bdc885a8e0e8dd954c11b0b8a80a3ae2d53
data/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  config.app_id = ''
16
16
  config.client_id = ''
17
17
  config.client_secret = ''
18
- config.base_url = 'test.api.myinfo.gov.sg' # don't set https://
18
+ config.base_url = 'test.api.myinfo.gov.sg'
19
19
  config.redirect_uri = 'https://localhost:3001/callback'
20
20
  config.public_facing = true
21
21
  config.private_key = File.read(Rails.root.join('private_key_location'))
@@ -55,7 +55,7 @@ result = MyInfo::V3::Person.call(access_token: response.data) if response.succes
55
55
  config.app_id = ''
56
56
  config.client_id = ''
57
57
  config.client_secret = ''
58
- config.base_url = 'test.api.myinfo.gov.sg' # don't set https://
58
+ config.base_url = 'test.api.myinfo.gov.sg'
59
59
  config.redirect_uri = 'https://localhost:3001/callback'
60
60
  config.singpass_eservice_id = 'MYINFO-CONSENTPLATFORM'
61
61
  config.private_key = File.read(Rails.root.join('private_key_location'))
@@ -29,9 +29,10 @@ module MyInfo
29
29
 
30
30
  # Configuration to set various properties needed to use MyInfo
31
31
  class Configuration
32
- attr_accessor :singpass_eservice_id, :app_id, :base_url, :client_id, :proxy,
33
- :private_key, :public_cert, :client_secret, :redirect_uri
32
+ attr_accessor :singpass_eservice_id, :app_id, :client_id, :proxy, :private_key, :public_cert, :client_secret,
33
+ :redirect_uri
34
34
 
35
+ attr_reader :base_url
35
36
  attr_writer :public_facing, :sandbox
36
37
 
37
38
  def initialize
@@ -40,6 +41,10 @@ module MyInfo
40
41
  @proxy = { address: nil, port: nil }
41
42
  end
42
43
 
44
+ def base_url=(url)
45
+ @base_url = url.sub('https://', '').split('/').first
46
+ end
47
+
43
48
  def base_url_with_protocol
44
49
  "https://#{base_url}"
45
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lim Yao Jie
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  requirements: []
175
- rubygems_version: 3.1.4
175
+ rubygems_version: 3.1.2
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: MyInfo gem