cloulu 0.1.5 → 0.1.6

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.
@@ -12,7 +12,7 @@ module CFoundry::V1
12
12
  # Create a new Client for interfacing with the given target.
13
13
  #
14
14
  # A token may also be provided to skip the login step.
15
- def initialize(target = "https://api.cloulu.com", token = nil)
15
+ def initialize(target = "http://api.cloudfoundry.com", token = nil)
16
16
  @base = Base.new(target, token)
17
17
  end
18
18
 
@@ -46,6 +46,26 @@ module CFoundry::V1
46
46
  @base.proxy = email
47
47
  end
48
48
 
49
+ # Current http proxy URI. Usually nil.
50
+ def http_proxy
51
+ @base.http_proxy
52
+ end
53
+
54
+ # Set the http proxy URI.
55
+ def http_proxy=(uri)
56
+ @base.http_proxy = uri
57
+ end
58
+
59
+ # Current https proxy URI. Usually nil.
60
+ def https_proxy
61
+ @base.https_proxy
62
+ end
63
+
64
+ # Set the https proxy URI.
65
+ def https_proxy=(uri)
66
+ @base.https_proxy = uri
67
+ end
68
+
49
69
  # Is the client tracing API requests?
50
70
  def trace
51
71
  @base.trace
data/lib/uaa/misc.rb CHANGED
@@ -51,7 +51,7 @@ class Misc
51
51
  # Gets basic information about the target server, including version number,
52
52
  # commit ID, and links to API endpoints.
53
53
  # @param [String] target The base URL of the server. For example the target could
54
- # be {https://login.cloulu.com}, {https://uaa.cloulu.com}, or
54
+ # be {https://login.cloudfoundry.com}, {https://uaa.cloudfoundry.com}, or
55
55
  # {http://localhost:8080/uaa}.
56
56
  # @return [Hash]
57
57
  def self.server(target)
@@ -63,7 +63,7 @@ class Misc
63
63
  # Gets a base url for the associated UAA from the target server by inspecting the
64
64
  # links returned from its info endpoint.
65
65
  # @param [String] target The base URL of the server. For example the target could
66
- # be {https://login.cloulu.com}, {https://uaa.cloulu.com}, or
66
+ # be {https://login.cloudfoundry.com}, {https://uaa.cloudfoundry.com}, or
67
67
  # {http://localhost:8080/uaa}.
68
68
  # @return [String] url of UAA (or the target itself if it didn't provide a response)
69
69
  def self.discover_uaa(target)
data/lib/uaa/scim.rb CHANGED
@@ -27,6 +27,7 @@ module CF::UAA
27
27
  # * +:group+ -- {http://www.simplecloud.info/specs/draft-scim-core-schema-01.html#group-resource}
28
28
  # or {http://www.simplecloud.info/specs/draft-scim-core-schema-01.html#anchor10}
29
29
  # * +:client+
30
+ # * +:user_id+ -- {https://github.com/cloudfoundry/uaa/blob/master/docs/UAA-APIs.rst#converting-userids-to-names}
30
31
  #
31
32
  # Naming attributes by type of object:
32
33
  # * +:user+ is "username"
@@ -256,6 +257,8 @@ class Scim
256
257
  # contain "password.write" scope and the correct +old_password+ must be given.
257
258
  # * For an admin to set a user's password, the token in @auth_header must
258
259
  # contain "uaa.admin" scope.
260
+ # @see https://github.com/cloudfoundry/uaa/blob/master/docs/UAA-APIs.rst#change-password-put-useridpassword
261
+ # @see https://github.com/cloudfoundry/uaa/blob/master/docs/UAA-Security.md#password-change
259
262
  # @param [String] user_id the {Scim} +id+ attribute of the user
260
263
  # @return [Hash] success message from server
261
264
  def change_password(user_id, new_password, old_password = nil)
@@ -271,6 +274,8 @@ class Scim
271
274
  # "client.secret" scope and the correct +old_secret+ must be given.
272
275
  # * For an admin to set a client secret, the token in @auth_header must contain
273
276
  # "uaa.admin" scope.
277
+ # @see https://github.com/cloudfoundry/uaa/blob/master/docs/UAA-APIs.rst#change-client-secret-put-oauthclientsclient_idsecret
278
+ # @see https://github.com/cloudfoundry/uaa/blob/master/docs/UAA-Security.md#client-secret-mangagement
274
279
  # @param [String] client_id the {Scim} +id+ attribute of the client
275
280
  # @return [Hash] success message from server
276
281
  def change_secret(client_id, new_secret, old_secret = nil)
@@ -93,6 +93,8 @@ class TokenIssuer
93
93
  public
94
94
 
95
95
  # @param [String] target The base URL of a UAA's oauth authorize endpoint.
96
+ # For example the target would be {https://login.cloudfoundry.com} if the
97
+ # endpoint is {https://login.cloudfoundry.com/oauth/authorize}.
96
98
  # The target would be {http://localhost:8080/uaa} if the endpoint
97
99
  # is {http://localhost:8080/uaa/oauth/authorize}.
98
100
  # @param [String] client_id The oauth2 client id, see
@@ -127,7 +129,7 @@ class TokenIssuer
127
129
  # @return [TokenInfo]
128
130
  def implicit_grant_with_creds(credentials, scope = nil)
129
131
  # this manufactured redirect_uri is a convention here, not part of OAuth2
130
- redir_uri = "https://uaa.cloulu.com/redirect/#{@client_id}"
132
+ redir_uri = "https://uaa.cloudfoundry.com/redirect/#{@client_id}"
131
133
  uri = authorize_path_args("token", redir_uri, scope, state = random_state)
132
134
 
133
135
  # the accept header is only here so the uaa will issue error replies in json to aid debugging
@@ -24,7 +24,7 @@ module VMC::App
24
24
  end
25
25
 
26
26
  desc "Set an environment variable"
27
- group :apps, :info
27
+ group :apps, :info, :hidden => true
28
28
  input :app, :desc => "Application to set the variable for",
29
29
  :argument => true, :from_given => by_name(:app)
30
30
  input :name, :desc => "Variable name", :argument => true
@@ -56,7 +56,7 @@ module VMC::App
56
56
 
57
57
 
58
58
  desc "Remove an environment variable"
59
- group :apps, :info
59
+ group :apps, :info, :hidden => true
60
60
  input :app, :desc => "Application to set the variable for",
61
61
  :argument => true, :from_given => by_name(:app)
62
62
  input :name, :desc => "Variable name", :argument => true
@@ -4,7 +4,7 @@ require "vmc/cli/app/base"
4
4
  module VMC::App
5
5
  class Files < Base
6
6
  desc "Print out an app's file contents"
7
- group :apps, :info
7
+ group :apps, :info, :hidden => true
8
8
  input :app, :desc => "Application to inspect the files of",
9
9
  :argument => true, :from_given => by_name(:app)
10
10
  input :path, :desc => "Path of file to read", :argument => :optional,
@@ -34,7 +34,7 @@ module VMC::App
34
34
  end
35
35
 
36
36
  desc "Examine an app's files"
37
- group :apps, :info
37
+ group :apps, :info, :hidden => true
38
38
  input :app, :desc => "Application to inspect the files of",
39
39
  :argument => true, :from_given => by_name(:app)
40
40
  input :path, :desc => "Path of directory to list", :argument => :optional,
@@ -62,7 +62,7 @@ module VMC::App
62
62
  end
63
63
 
64
64
  desc "Stream an app's file contents"
65
- group :apps, :info
65
+ group :apps, :info, :hidden => true
66
66
  input :app, :desc => "Application to inspect the files of",
67
67
  :argument => true, :from_given => by_name(:app)
68
68
  input :path, :desc => "Path of file to stream", :argument => :optional
@@ -33,7 +33,7 @@ module VMC::App
33
33
  end
34
34
 
35
35
  desc "Print out the logs for an app's crashed instances"
36
- group :apps, :info
36
+ group :apps, :info, :hidden => true
37
37
  input :app, :desc => "Application to get the logs of", :argument => true,
38
38
  :from_given => by_name(:app)
39
39
  def crashlogs
@@ -3,7 +3,7 @@ require "vmc/cli/app/base"
3
3
  module VMC::App
4
4
  class Rename < Base
5
5
  desc "Rename an application"
6
- group :apps, :manage
6
+ group :apps, :manage, :hidden => true
7
7
  input :app, :desc => "Application to rename", :argument => :optional,
8
8
  :from_given => by_name(:app)
9
9
  input :name, :desc => "New application name", :argument => :optional
data/lib/vmc/cli.rb CHANGED
@@ -26,12 +26,6 @@ module VMC
26
26
  option :help, :desc => "Show command usage", :alias => "-h",
27
27
  :default => false
28
28
 
29
- option :proxy, :desc => "Run this command as another user (admin)", :alias => "-u",
30
- :value => :email
31
-
32
- option :http_proxy, :desc => "Connect though an http proxy server", :alias => "--http-proxy",
33
- :value => :http_proxy
34
-
35
29
  option :version, :desc => "Print version number", :alias => "-v",
36
30
  :default => false
37
31
 
data/lib/vmc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module VMC
2
- VERSION = "0.1.5".freeze
2
+ VERSION = "0.1.6".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloulu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -92,54 +92,6 @@ dependencies:
92
92
  - - ~>
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0.0'
95
- - !ruby/object:Gem::Dependency
96
- name: rake
97
- requirement: !ruby/object:Gem::Requirement
98
- none: false
99
- requirements:
100
- - - ~>
101
- - !ruby/object:Gem::Version
102
- version: '0.9'
103
- type: :development
104
- prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
108
- - - ~>
109
- - !ruby/object:Gem::Version
110
- version: '0.9'
111
- - !ruby/object:Gem::Dependency
112
- name: rspec
113
- requirement: !ruby/object:Gem::Requirement
114
- none: false
115
- requirements:
116
- - - ~>
117
- - !ruby/object:Gem::Version
118
- version: '2.11'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
- requirements:
124
- - - ~>
125
- - !ruby/object:Gem::Version
126
- version: '2.11'
127
- - !ruby/object:Gem::Dependency
128
- name: webmock
129
- requirement: !ruby/object:Gem::Requirement
130
- none: false
131
- requirements:
132
- - - ~>
133
- - !ruby/object:Gem::Version
134
- version: '1.9'
135
- type: :development
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
- requirements:
140
- - - ~>
141
- - !ruby/object:Gem::Version
142
- version: '1.9'
143
95
  - !ruby/object:Gem::Dependency
144
96
  name: rr
145
97
  requirement: !ruby/object:Gem::Requirement