ocean-rails 3.5.3 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c814db3aeba4c0c87d38123131d8a4be8b53cdbd
4
- data.tar.gz: d2f2a95a83153e326922ce182286843de5f9d511
3
+ metadata.gz: ffd71974843be7814eb5525a922476eb6ef8fe0f
4
+ data.tar.gz: 2a7a085c80e739c5e6f086d8ecf1d16a665c11ba
5
5
  SHA512:
6
- metadata.gz: 774e7501fbbaaac2c4d08f26fecafdd6840215ed8382b72acf98e2568e555e128efcf33fea4f3f4277d4bdaf91306031ae2516a093673842331030367f2a3258
7
- data.tar.gz: 02fb03eb65c9738d0a1573e2912af9222db4f5d63d26fc177aa894691ee1c78db1fa370f5190635340594c96e1b0a200118b4964935f7c1175e76686587cde69
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
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "3.5.3"
2
+ VERSION = "3.6.0"
3
3
  end
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.5.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-09-28 00:00:00.000000000 Z
11
+ date: 2014-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus