conjur-api 2.1.3 → 2.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Conjur
2
2
  class API
3
- VERSION = "2.1.3"
3
+ VERSION = "2.1.4"
4
4
  end
5
5
  end
@@ -25,7 +25,7 @@ module Conjur
25
25
  if Conjur.log
26
26
  Conjur.log << "Authenticating #{username}\n"
27
27
  end
28
- JSON::parse(RestClient::Resource.new(Conjur::Authn::API.host)["users/#{path_escape username}/authenticate"].post password, content_type: 'text/plain')
28
+ JSON::parse(RestClient::Resource.new(Conjur::Authn::API.host)["users/#{fully_escape username}/authenticate"].post password, content_type: 'text/plain')
29
29
  end
30
30
  end
31
31
 
@@ -1,6 +1,11 @@
1
1
  module Conjur
2
2
  module Escape
3
3
  module ClassMethods
4
+ def fully_escape(str)
5
+ require 'cgi'
6
+ CGI.escape(str.to_s)
7
+ end
8
+
4
9
  def path_escape(str)
5
10
  path_or_query_escape str
6
11
  end
@@ -22,6 +27,10 @@ module Conjur
22
27
  def self.included(base)
23
28
  base.extend ClassMethods
24
29
  end
30
+
31
+ def fully_escape(str)
32
+ self.class.fully_escape str
33
+ end
25
34
 
26
35
  def path_escape(str)
27
36
  self.class.path_escape str
@@ -6,6 +6,14 @@ module Conjur
6
6
  include HasAttributes
7
7
  include ActsAsUser
8
8
 
9
+ def login
10
+ [ 'host', id ].join('/')
11
+ end
12
+
13
+ def api_key
14
+ self.attributes['api_key']
15
+ end
16
+
9
17
  def enrollment_url
10
18
  log do |logger|
11
19
  logger << "Fetching enrollment_url for #{id}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjur-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-12 00:00:00.000000000 Z
13
+ date: 2013-04-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client
@@ -205,7 +205,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
205
205
  version: '0'
206
206
  segments:
207
207
  - 0
208
- hash: 357911271528207191
208
+ hash: 1925645782265443931
209
209
  required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  none: false
211
211
  requirements:
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  segments:
216
216
  - 0
217
- hash: 357911271528207191
217
+ hash: 1925645782265443931
218
218
  requirements: []
219
219
  rubyforge_project:
220
220
  rubygems_version: 1.8.24