shilpa20 1.1.6 → 1.1.7

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: 52cc89d7f8c70db39933a56a2d4881314dc60e98301691b874552ae21f2910c6
4
- data.tar.gz: 1d079a77aaad308889c94a65335ea109d6c254a97b36740c64103f01ec1df43f
3
+ metadata.gz: c395570d5288acf49fc11fa38ff6bea7df9d8cb2085903dc316527a8e02166ef
4
+ data.tar.gz: 887f49fc14714bd88a158003ad210afeffcca489c804ab46c7baefca97071740
5
5
  SHA512:
6
- metadata.gz: babc8dc984c0787cb6860bc28ccd46768fda64d81c9e0b83098f7e2df25fc3801b44a72e2e19330a482550afc81bb7042a7c790bce732db305b9f2550f88f274
7
- data.tar.gz: 196d4d84c35829cffc8d88219ab4df1bdfe38f2f21e869a6bad6d4b47e7bc9510941897214f1ddb43cc8b1dc017c3a95e0f216ef49cddee2ba2b1300655cdd8a
6
+ metadata.gz: 4bd429d56f91ab3a51f8a9a9728fd3e5f63016aecf86ffa6110af9413e25eee598b00cd443952098cf3f46a053b27225fe15f4e3edd18acb9652af2d0871579e
7
+ data.tar.gz: c631a75acbd57014b6d468abb3926b8f43179ed843c1e42d5f7ea9f64f1d5fe592ef8553cdefe5e22d6251b8139e5318a73b1fc3a0e0d7624feb181112b8ea61
@@ -0,0 +1,18 @@
1
+ class ApplicationConfig
2
+ @@client_id
3
+ @@client_secret
4
+
5
+ def self.set_config(client_id, client_secret)
6
+ @@client_id = client_id
7
+ @@client_secret = client_secret
8
+ end
9
+
10
+ def self.get_client_id
11
+ return @@client_id
12
+ end
13
+
14
+ def self.get_client_secret
15
+ return @@client_secret
16
+ end
17
+
18
+ end
@@ -1,11 +1,14 @@
1
1
  require 'rest-client'
2
2
  require 'json'
3
3
  require_relative '../domain/authentication.rb'
4
+ require_relative '../domain/application_config.rb'
4
5
 
5
6
  class AuthenticationService
6
7
  @@authentication_url = 'https://showoff-rails-react-production.herokuapp.com/oauth/token'
7
8
 
8
9
  def self.create_authentication(auth_data)
10
+ auth_data.client_id =ApplicationConfig.get_client_id
11
+ auth_data.client_secret =ApplicationConfig.get_client_secret
9
12
  auth_payload = Authentication.get_payload(auth_data)
10
13
  return RestClient::Request.execute(method: :post, url: @@authentication_url,
11
14
  payload: auth_payload, headers: {'Content-Type': 'application/json'})
@@ -15,8 +18,8 @@ class AuthenticationService
15
18
  def self.create_auth_data
16
19
  auth = Authentication.new
17
20
  auth.grant_type = "password"
18
- auth.client_id = "277ef29692f9a70d511415dc60592daf4cf2c6f6552d3e1b769924b2f2e2e6fe"
19
- auth.client_secret = "d6106f26e8ff5b749a606a1fba557f44eb3dca8f48596847770beb9b643ea352"
21
+ # auth.client_id = "277ef29692f9a70d511415dc60592daf4cf2c6f6552d3e1b769924b2f2e2e6fe"
22
+ #auth.client_secret = "d6106f26e8ff5b749a606a1fba557f44eb3dca8f48596847770beb9b643ea352"
20
23
  auth.username = "sachinmurthy93@gmail.com"
21
24
  auth.password = "password"
22
25
  return auth
data/lib/shilpa20.rb CHANGED
@@ -6,16 +6,11 @@ require 'rest-client'
6
6
  require File.dirname(__FILE__) + '/shilpa20/authentication_service'
7
7
  require File.dirname(__FILE__) + '/shilpa20/user_service'
8
8
  require File.dirname(__FILE__) + '/shilpa20/user_widget_service'
9
+ require File.dirname(__FILE__) + '/domain/application_config'
9
10
 
10
11
  class Shilpa20
11
- @@client_id
12
- @@client_secret
13
-
14
- def self.set_config(client_id, client_secret)
15
- @@client_id = client_id
16
- @@client_secret = client_secret
17
- end
18
-
12
+
13
+ ApplicationConfig.set_config("277ef29692f9a70d511415dc60592daf4cf2c6f6552d3e1b769924b2f2e2e6fe", "d6106f26e8ff5b749a606a1fba557f44eb3dca8f48596847770beb9b643ea352")
19
14
  #Create authentication token
20
15
  def self.create_authentication_token(auth_data)
21
16
  return AuthenticationService.create_authentication(auth_data)
@@ -108,7 +103,7 @@ class Shilpa20
108
103
  end
109
104
 
110
105
  #puts " Inside shilpa 20"
111
- #puts Shilpa20.create_authentication_token(AuthenticationService.create_auth_data)
106
+ puts Shilpa20.create_authentication_token(AuthenticationService.create_auth_data)
112
107
  #Shilpa20.set_config("cid1","csecret1")
113
108
  #Shilpa20.getConfig
114
109
  #puts "Hi"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shilpa20
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sachin Murthy
@@ -32,6 +32,7 @@ extra_rdoc_files: []
32
32
  files:
33
33
  - Gemfile
34
34
  - Rakefile
35
+ - lib/domain/application_config.rb
35
36
  - lib/domain/authentication.rb
36
37
  - lib/domain/client_info_base.rb
37
38
  - lib/domain/user.rb