Sha256: 08e199ef858a3fffebd3da7b74470c1c06f4656c14ff18608048df65a57c8cc7

Contents?: true

Size: 1.81 KB

Versions: 6

Compression:

Stored size: 1.81 KB

Contents

#--
# Cloud Foundry 2012.02.03 Beta
# Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Apache License, Version 2.0 (the "License").
# You may not use this product except in compliance with the License.
#
# This product includes a number of subcomponents with
# separate copyright notices and license terms. Your use of these
# subcomponents is subject to the terms and conditions of the
# subcomponent's license, as noted in the LICENSE file.
#++

require 'cli/common'
require 'uaa'

module CF::UAA

class InfoCli < CommonCli

  topic "System Information", "sys", "info"

  def misc_request(&blk) Config.target ? handle_request(&blk) : gripe("target not set") end

  desc "info", "get information about current target" do
    pp misc_request { update_target_info(Misc.server(Config.target)) }
  end

  desc "me", "get authenticated user information" do
    pp misc_request { Misc.whoami Config.target, auth_header }
  end

  desc "prompts", "Show prompts for credentials required for implicit grant post" do
    pp misc_request { update_target_info(Misc.server(Config.target))['prompts'] }
  end

  desc "signing key", "get the UAA's token signing key(s)", :client, :secret do
    info = misc_request { Misc.validation_key(Config.target, 
        (clientname if opts.key?(:client)), (clientsecret if opts.key?(:client))) }
    if info && info['value']
      Config.target_opts(signing_alg: info['alg'], signing_key: info['value'])
    end
    pp info
  end

  desc "stats", "Show UAA's current usage statistics", :client, :secret do
    pp misc_request { Misc.varz(Config.target, clientname, clientsecret) }
  end

  desc "password strength [password]", "calculate strength score of a password" do |pwd|
    pp misc_request { Misc.password_strength(Config.target, userpwd(pwd)) }
  end

end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cf-uaac-1.3.9 lib/cli/info.rb
cf-uaac-1.3.8 lib/cli/info.rb
cf-uaac-1.3.6 lib/cli/info.rb
cf-uaac-1.3.4 lib/cli/info.rb
cf-uaac-1.3.3 lib/cli/info.rb
cf-uaac-1.3.1 lib/cli/info.rb