cloulu 0.1.2 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cfoundry/baseclient.rb +1 -1
- data/lib/cfoundry/uaaclient.rb +1 -1
- data/lib/cfoundry/v2/client.rb +1 -1
- data/lib/uaa/misc.rb +2 -2
- data/lib/uaa/scim.rb +0 -5
- data/lib/uaa/token_issuer.rb +1 -3
- data/lib/vmc/cli.rb +6 -0
- data/lib/vmc/cli/app/env.rb +2 -2
- data/lib/vmc/cli/app/files.rb +3 -3
- data/lib/vmc/cli/app/logs.rb +1 -1
- data/lib/vmc/cli/app/rename.rb +1 -1
- data/lib/vmc/version.rb +1 -1
- metadata +2 -2
data/lib/cfoundry/baseclient.rb
CHANGED
@@ -15,7 +15,7 @@ module CFoundry
|
|
15
15
|
:proxy, :proxy=, :trace, :backtrace, :backtrace=,
|
16
16
|
:log, :log=
|
17
17
|
|
18
|
-
def initialize(target = "https://api.
|
18
|
+
def initialize(target = "https://api.cloulu.com", token = nil)
|
19
19
|
@rest_client = CFoundry::RestClient.new(target, token)
|
20
20
|
self.trace = false
|
21
21
|
self.backtrace = false
|
data/lib/cfoundry/uaaclient.rb
CHANGED
@@ -5,7 +5,7 @@ module CFoundry
|
|
5
5
|
class UAAClient
|
6
6
|
attr_accessor :target, :client_id, :token, :trace
|
7
7
|
|
8
|
-
def initialize(target = "https://uaa.
|
8
|
+
def initialize(target = "https://uaa.cloulu.com", client_id = "vmc")
|
9
9
|
@target = target
|
10
10
|
@client_id = client_id
|
11
11
|
CF::UAA::Misc.symbolize_keys = true
|
data/lib/cfoundry/v2/client.rb
CHANGED
@@ -20,7 +20,7 @@ module CFoundry::V2
|
|
20
20
|
# Create a new Client for interfacing with the given target.
|
21
21
|
#
|
22
22
|
# A token may also be provided to skip the login step.
|
23
|
-
def initialize(target = "http://api.
|
23
|
+
def initialize(target = "http://api.cloulu.com", token = nil)
|
24
24
|
@base = Base.new(target, token)
|
25
25
|
end
|
26
26
|
|
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.
|
54
|
+
# be {https://login.cloulu.com}, {https://uaa.cloulu.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.
|
66
|
+
# be {https://login.cloulu.com}, {https://uaa.cloulu.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,7 +27,6 @@ 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}
|
31
30
|
#
|
32
31
|
# Naming attributes by type of object:
|
33
32
|
# * +:user+ is "username"
|
@@ -257,8 +256,6 @@ class Scim
|
|
257
256
|
# contain "password.write" scope and the correct +old_password+ must be given.
|
258
257
|
# * For an admin to set a user's password, the token in @auth_header must
|
259
258
|
# 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
|
262
259
|
# @param [String] user_id the {Scim} +id+ attribute of the user
|
263
260
|
# @return [Hash] success message from server
|
264
261
|
def change_password(user_id, new_password, old_password = nil)
|
@@ -274,8 +271,6 @@ class Scim
|
|
274
271
|
# "client.secret" scope and the correct +old_secret+ must be given.
|
275
272
|
# * For an admin to set a client secret, the token in @auth_header must contain
|
276
273
|
# "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
|
279
274
|
# @param [String] client_id the {Scim} +id+ attribute of the client
|
280
275
|
# @return [Hash] success message from server
|
281
276
|
def change_secret(client_id, new_secret, old_secret = nil)
|
data/lib/uaa/token_issuer.rb
CHANGED
@@ -93,8 +93,6 @@ 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}.
|
98
96
|
# The target would be {http://localhost:8080/uaa} if the endpoint
|
99
97
|
# is {http://localhost:8080/uaa/oauth/authorize}.
|
100
98
|
# @param [String] client_id The oauth2 client id, see
|
@@ -129,7 +127,7 @@ class TokenIssuer
|
|
129
127
|
# @return [TokenInfo]
|
130
128
|
def implicit_grant_with_creds(credentials, scope = nil)
|
131
129
|
# this manufactured redirect_uri is a convention here, not part of OAuth2
|
132
|
-
redir_uri = "https://uaa.
|
130
|
+
redir_uri = "https://uaa.cloulu.com/redirect/#{@client_id}"
|
133
131
|
uri = authorize_path_args("token", redir_uri, scope, state = random_state)
|
134
132
|
|
135
133
|
# the accept header is only here so the uaa will issue error replies in json to aid debugging
|
data/lib/vmc/cli.rb
CHANGED
@@ -26,6 +26,12 @@ 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
|
+
|
29
35
|
option :version, :desc => "Print version number", :alias => "-v",
|
30
36
|
:default => false
|
31
37
|
|
data/lib/vmc/cli/app/env.rb
CHANGED
@@ -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
|
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
|
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
|
data/lib/vmc/cli/app/files.rb
CHANGED
@@ -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
|
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
|
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
|
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
|
data/lib/vmc/cli/app/logs.rb
CHANGED
@@ -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
|
37
37
|
input :app, :desc => "Application to get the logs of", :argument => true,
|
38
38
|
:from_given => by_name(:app)
|
39
39
|
def crashlogs
|
data/lib/vmc/cli/app/rename.rb
CHANGED
@@ -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
|
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/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -158,7 +158,7 @@ dependencies:
|
|
158
158
|
version: '1.0'
|
159
159
|
description: test
|
160
160
|
email:
|
161
|
-
-
|
161
|
+
- cloulu@sk.com
|
162
162
|
executables:
|
163
163
|
- cl
|
164
164
|
extensions: []
|