AvrijAnalyticsUtility 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: 5ea7a04a55f4cc2f53f9c19ec852e0ae84c1ad08
4
- data.tar.gz: cfcef712320e9fe051fc13a64efc183934998263
3
+ metadata.gz: 10fb4e052483911211df56fee1d5bc5ebac63f25
4
+ data.tar.gz: 7c9abd29d5399c233b4a64ead8e96ed091c8af3e
5
5
  SHA512:
6
- metadata.gz: 2c33c6ca019c08f04c35325e1ec1567b1e808f40cef96b55178e2c3d4b9c2032b06053780e362e704b38378b2ac461a233c0bc282acc03b21ad8cf33585f79e8
7
- data.tar.gz: 42d7929bb5e7a7e588ac557c4a977117506e0cddca39acb602f1c02dd5b01bb3e54f78ee2107dc6eb15f3502095a19cb3ff308d754f5ac2d6e3f22606f9e95a7
6
+ metadata.gz: dd7bee0f8795748b0c4ef5184d347341c9733bca8e78e27f558d9afe8b17df0e9f6384b2c272517f4c79e88c49bfb1ca4f4cb90122a19d0ceafd54de1aa70d4c
7
+ data.tar.gz: 99480ea5c5bc92929ca82ce9e68ed612eda3fbb01967bcb282fb55905e2a52e751983f09757ec128305c177181eba8934fb84e78e029e605ac14871b117849a6
@@ -6,10 +6,10 @@ module AvrijAnalyticsUtility
6
6
  class APIConnector
7
7
 
8
8
  #Constructor
9
- def initialize(base_uri,username,password)
9
+ def initialize(base_uri)
10
10
  @base_uri = base_uri
11
- @username = username
12
- @password = password
11
+ @username = nil
12
+ @password = nil
13
13
  @auth_token = nil
14
14
  @auth_value = nil
15
15
  @header_hash = nil
@@ -100,14 +100,31 @@ module AvrijAnalyticsUtility
100
100
  #
101
101
  # ==== Attributes
102
102
  # * +authentication_endpoint+ - API authentication end point
103
- # * +username+ - username
104
- # * +password+ - password
105
103
  # ==== Examples
106
104
  # * [authentication_endpoint]
107
105
  # - given the complete uri : https://www.company.com/auth
108
106
  # - the base uri is : https://www.company.com
109
107
  # - the authentication endpoint is : auth
110
- def authenticate(authentication_endpoint, username, password)
108
+ #
109
+ # ==== Steps for Authentication
110
+ #
111
+ # myConnector = APIConnector.new(base_uri)
112
+ # auth_Header = {
113
+ # "Authorization" => "Bearer undefined"
114
+ # }
115
+ #
116
+ # auth_body = {
117
+ # "username" => "myusername",
118
+ # "password" => "mypassword"
119
+ # }
120
+ #
121
+ # myConnector.setHeader(auth_Header)
122
+ # myConnector.setBody(auth_body)
123
+ # if myConnector.authenticate(auth_endpoint)
124
+ # <todo>
125
+ # end
126
+
127
+ def authenticate(authentication_endpoint)
111
128
  authentication_uri = @base_uri + "/" + authentication_endpoint
112
129
  authentication_options = {headers: @header_hash, body: @body_hash}
113
130
  authentication_result = HTTParty.post(authentication_uri, authentication_options)
@@ -1,3 +1,3 @@
1
1
  module AvrijAnalyticsUtility
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: AvrijAnalyticsUtility
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Dalisay