ocean-rails 3.5.3 → 3.6.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.
- checksums.yaml +4 -4
- data/lib/ocean/api.rb +5 -1
- data/lib/ocean/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffd71974843be7814eb5525a922476eb6ef8fe0f
|
4
|
+
data.tar.gz: 2a7a085c80e739c5e6f086d8ecf1d16a665c11ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5fd03559ce4ae215d0a381da478cbdd1a5010439442013257b5c6283b16d0a581778a54470171a0144d0a3582ebc16aa5e526da77a03c3601d64630b83dfa62
|
7
|
+
data.tar.gz: c549619b11f6e6178d43fe01509f2b980dcb44437c8aa5893ad4c3c2a71c71ca7370f5859a50ce96a870313d77f6162423382c7af90822a75cc9a83552e4b46f
|
data/lib/ocean/api.rb
CHANGED
@@ -140,6 +140,7 @@ class Api
|
|
140
140
|
# +args+, if given, should be a hash of query arguments to add to the URL.
|
141
141
|
# +headers+, if given, is a hash of extra HTTP headers for the request.
|
142
142
|
# +body+, if given, is the body of the request (:post, :put) as a string.
|
143
|
+
# +credentials, if given, are the credentials to use when authenticating.
|
143
144
|
# +x_api_token+, if given, is a string which will be used as an X-API-Token header.
|
144
145
|
# +reauthentication+ (true by default), controls whether 400 and 419 will trigger reauth.
|
145
146
|
# +ssl_verifypeer+ (true by default), controls SSL peer verification.
|
@@ -417,7 +418,10 @@ class Api
|
|
417
418
|
# authentication. The encoding can be reversed and is intended only to lightly mask the
|
418
419
|
# credentials so that they're not immediately apparent when reading logs.
|
419
420
|
#
|
420
|
-
def self.encode_credentials(username, password)
|
421
|
+
def self.encode_credentials(username=nil, password=nil)
|
422
|
+
raise "Only specifying the username is not allowed" if username && !password
|
423
|
+
username ||= API_USER
|
424
|
+
password ||= API_PASSWORD
|
421
425
|
::Base64.strict_encode64 "#{username}:#{password}"
|
422
426
|
end
|
423
427
|
|
data/lib/ocean/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocean-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Bengtson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|