identikey 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -0
- data/lib/identikey/administration/session.rb +2 -2
- data/lib/identikey/administration.rb +12 -0
- data/lib/identikey/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ee502eb590570b3a09edb58b436ebf72e86cdd22f6891e7f75563978d471ab4
|
4
|
+
data.tar.gz: cdd45005c57900fb13fbea2d7b40761b0dfb78a7d70aca8458569c823e6b0075
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc93b984114056589ceba043215c3845f95bf3604085c94b08e19e6f3131d53c083c10a3f3a2b806699d3e44b281b4317af3243cfe007adb947ae4f191c50957
|
7
|
+
data.tar.gz: 1bbe9da3e86ca3b108c73db040536b609090038fd36fe799680a9cb24690f1a1e9209d9829413c0f415551bcb26e82fd7527d144a678954e4c7525a28a80f7c0
|
data/README.md
CHANGED
@@ -156,6 +156,34 @@ d.unassign!
|
|
156
156
|
s.logoff
|
157
157
|
```
|
158
158
|
|
159
|
+
## Logging to separate files
|
160
|
+
|
161
|
+
You can and are encouraged to configure different logging destinations
|
162
|
+
for the different API endpoints, as follows:
|
163
|
+
|
164
|
+
```ruby
|
165
|
+
Identikey::Administration.configure do
|
166
|
+
logger Logger.new("log/#{Rails.env}.identikey.admin.log")
|
167
|
+
end
|
168
|
+
|
169
|
+
Identikey::Authentication.configure do
|
170
|
+
logger Logger.new("log/#{Rails.env}.identikey.admin.log")
|
171
|
+
end
|
172
|
+
```
|
173
|
+
|
174
|
+
However be aware of a caveat, as Identikey uses Savon that uses HTTPI
|
175
|
+
and the latter has a global logger, that Savon sets (and overwrites)
|
176
|
+
upon calls to `logger`.
|
177
|
+
|
178
|
+
In the above scenario, you can use a different logfile for HTTPI:
|
179
|
+
|
180
|
+
```ruby
|
181
|
+
HTTPI.logger = Logger.new("log/#{Rails.env}.identikey.httpi.log")
|
182
|
+
```
|
183
|
+
|
184
|
+
However please be aware of side-effects with other components of
|
185
|
+
your application.
|
186
|
+
|
159
187
|
## Development
|
160
188
|
|
161
189
|
After checking out the repo, run `bin/setup` to install dependencies. Then,
|
@@ -59,10 +59,10 @@ module Identikey
|
|
59
59
|
stat == 'STAT_SUCCESS'
|
60
60
|
end
|
61
61
|
|
62
|
-
def alive?
|
62
|
+
def alive?(log: true)
|
63
63
|
return false unless logged_on?
|
64
64
|
|
65
|
-
stat, _ = @client.
|
65
|
+
stat, _ = @client.ping session_id: @session_id, log: log
|
66
66
|
|
67
67
|
stat == 'STAT_SUCCESS'
|
68
68
|
end
|
@@ -57,6 +57,18 @@ module Identikey
|
|
57
57
|
parse_response resp, :sessionalive_response
|
58
58
|
end
|
59
59
|
|
60
|
+
# Like sessionalive, but allows to disable logging if the
|
61
|
+
# `log:` keyword is set to false.
|
62
|
+
#
|
63
|
+
def ping(session_id:, log:)
|
64
|
+
old_log = client.globals[:log]
|
65
|
+
client.globals[:log] = log
|
66
|
+
|
67
|
+
sessionalive(session_id: session_id)
|
68
|
+
ensure
|
69
|
+
client.globals[:log] = old_log
|
70
|
+
end
|
71
|
+
|
60
72
|
def admin_session_query(session_id:)
|
61
73
|
attributes = [ ]
|
62
74
|
|
data/lib/identikey/version.rb
CHANGED