Permalink
Browse files

remove obsolete gem code

[fixes #43896637]
  • Loading branch information...
1 parent 45072bc commit eecfb7dd41e23bad42877ae0f3bc4a1bc6dd9842 @daleolds daleolds committed Feb 20, 2013
View
@@ -1,16 +0,0 @@
-# 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.
-#
-
-source "http://rubygems.org"
-
-# Specify your gem's dependencies in uaa.gemspec
-gemspec
View
@@ -1,62 +1,8 @@
CloudFoundry UAA Gem
====================
-*NOTE: This gem is deprecated. Please use cf-uaa-lib and cf-uaac gems instead.
+*NOTE: This gem has been replaced. Please use cf-uaa-lib and cf-uaac gems.
They are available from rubygems.org or
https://github.com/cloudfoundry/cf-uaa-lib and
https://github.com/cloudfoundry/cf-uaac*
-Client gem for interacting with the CloudFoundry UAA server.
-
-Set up a local ruby environment (so sudo not required):
-
- $ rvm use 1.9.2
-
-or
-
- $ rbenv global 1.9.2-p180
-
-see: https://rvm.io/ or http://rbenv.org/
-
-Build the gem
-
- $ bundle install
- $ gem build cf-uaa-client.gemspec
-
-Install it
-
- $ gem install cf-uaa-client*.gem
-
-Run it
-
- $ uaac help
- $ uaac target uaa.cloudfoundry.com
- $ uaac token get <your-cf-username>
- $ uaac token decode
-
-Use the gem:
-
- #!/usr/bin/env ruby
- require 'uaa'
- token_issuer = CF::UAA::TokenIssuer.new("https://uaa.cloudfoundry.com", "vmc")
- puts token_issuer.prompts.inspect
- token = token_issuer.implicit_grant_with_creds(username: "<your_username>", password: "<your_password>")
- token_info = TokenCoder.decode(token.info[:access_token], nil, nil, false) #token signature not verified
- puts token_info[:user_name]
-
-## Tests
-
-Run the tests with rake:
-
- $ bundle exec rake test
-
-Run the tests and see a fancy coverage report:
-
- $ bundle exec rake cov
-
-Run integration tests (on a server running on localhost:8080/uaa):
-
- $ export UAA_CLIENT_ID="admin"
- $ export UAA_CLIENT_SECRET="adminsecret"
- $ export UAA_CLIENT_TARGET="http://localhost:8080/uaa"
- $ bundle exec rspec spec/integration_spec.rb
View
@@ -1,50 +0,0 @@
-# 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 "rspec/core/rake_task"
-#require "bundler/gem_tasks" # only available in bundler >= 1.0.15
-#require "rdoc/task" # rdoc for current interfaces not written yet
-require "ci/reporter/rake/rspec"
-
-ENV['CI_REPORTS'] = File.expand_path("spec_reports")
-COV_REPORTS = File.expand_path("coverage")
-
-task :default => [:test]
-task :tests => [:test]
-task :spec => [:test]
-
-RSpec::Core::RakeTask.new("test") do |t|
- t.rspec_opts = ["--format", "documentation", "--colour"]
- t.pattern = "spec/**/*_spec.rb"
-end
-
-#RDoc::Task.new do |rd|
-# rd.rdoc_files.include("lib/**/*.rb")
-# rd.rdoc_dir = "doc"
-#end
-
-task :ci => [:pre_coverage, :rcov_reports, "ci:setup:rspec", :test]
-task :cov => [:pre_coverage, :test, :view_coverage]
-task :coverage => [:pre_coverage, :test]
-
-task :pre_coverage do
- rm_rf COV_REPORTS
- ENV['COVERAGE'] = "exclude-spec exclude-vendor"
-end
-
-task :rcov_reports do
- ENV['COVERAGE'] += " rcov"
-end
-
-task :view_coverage do
- `firefox #{File.join(COV_REPORTS, 'index.html')}`
-end
View
@@ -1,80 +0,0 @@
-#!/usr/bin/env ruby
-
-# given the indents, find sub-commands of a given command
-def find_sub_commands (lines, indents, i)
- result = Array.new
- x = i+1
- while x < lines.size && indents[x] > indents[i]
- if indents[x] - indents[i] == 1
- result.push(x)
- end
- x = x+1
- end
- result
-end
-
-def find_sub_command_index (lines, sub_command_indices, sub_command)
- sub_command_indices.each do |i|
- if lines[i] == sub_command
- return i
- end
- end
- -1
-end
-
-# traverse sub-command tree with the given list of args
-def traverse_command_tree(lines, sub_command_indices, args)
- #puts "traversing for #{args}"
- x = 0
- args.drop(1).each do |arg|
- next if arg.start_with? ("-")
- nx = find_sub_command_index(lines, sub_command_indices[x], arg)
- if nx != -1
- x = nx
- end
- end
- x
-end
-
-# use values in array1 as indices into array2 and find the subset from array2
-def find_subset(values, indices)
- result = Array.new
- indices.each do |i|
- result.push(values[i])
- end
- result.join(' ')
-end
-
-def get_cache_filename(cmd)
- curr_user = `whoami`.chomp
- home_dir = `echo ~#{curr_user}`.chomp
- "#{home_dir}/.#{cmd}-commands"
-end
-
-indent_char = "\t"
-command_file_name = get_cache_filename(ARGV[0])
-if !FileTest.exists?(command_file_name)
- `#{ARGV[0]} help commands > #{command_file_name}`
-end
-lines = File.readlines(command_file_name)
-children = Array.new
-indents = Array.new
-
-lines.each_with_index do |line, i|
- indents[i] = line.count(indent_char)
-end
-
-# now that we have computed the indent level for each line, remove new-lines and tabs
-lines.collect! { |line| line.gsub(/[#{indent_char}]/, '') }
-lines.collect! { |line| line.gsub(/[\n]/, '') }
-
-# pre-processing: find the sub-commands for command (using indent levels)
-lines.each_with_index do |line, i|
- children[i] = find_sub_commands(lines, indents, i)
-end
-
-# now that a sub-command tree is available, parse it using the input arguments to find the auto-completion options
-x = traverse_command_tree(lines, children, ARGV.drop(1))
-puts x == -1 ? "" : find_subset(lines, children[x])
-
-
View
@@ -1,5 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.unshift File.expand_path File.join __FILE__, '..', '..', 'lib'
-require 'cli'
-exit CF::UAA::Cli.configure("#{ENV['HOME']}/.uaac.yml").run ? 0 : 1
View
@@ -1,34 +0,0 @@
-#! /bin/bash
-GLOBAL_OPTS="--help --no-help -h --version --no-version -v --debug --no-debug -d --trace --no-trace -t --config"
-
-_debug() {
- if [[ $UAAC_DEBUG -eq 1 ]] ; then
- echo "$@;"
- fi
-}
-
-_add_completion_options() {
- local current="${COMP_WORDS[${COMP_CWORD}]}"
- COMPREPLY=( "${COMPREPLY[@]}" $(compgen -W "$1" -- $current) )
-}
-
-_uaac() {
- local current="${COMP_WORDS[${COMP_CWORD}]}"
- local helper_input=()
- if [[ "$current" == "" ]] || [[ "$current" == " " ]] || [[ $current == -* ]] ; then
- helper_input=( ${COMP_WORDS[@]} )
- else
- helper_input=( ${COMP_WORDS[@]/$current/} )
- fi
-
- local parent_command="${COMP_WORDS[0]}"
- local uaac_opts=$(completion-helper "${parent_command}" "${helper_input[@]}")
- local opts=$uaac_opts
- if [[ $current == -* ]] ; then
- opts="${GLOBAL_OPTS} ${uaac_opts}"
- fi
- _add_completion_options "${opts}"
-
-}
-
-complete -F _uaac uaac
View
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.unshift File.expand_path File.join __FILE__, '..', '..', 'lib'
-$:.unshift File.expand_path File.join __FILE__, '..', '..', 'spec'
-require 'stub_uaa'
-
-CF::UAA::Util.default_logger(:trace)
-CF::UAA::StubUAA.new.run('localhost', 8080)
View
@@ -1,48 +0,0 @@
-# -*- encoding: utf-8 -*-
-#
-# 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.
-#
-
-$:.push File.expand_path("../lib", __FILE__)
-require "uaa/version"
-
-Gem::Specification.new do |s|
- s.name = "cf-uaa-client"
- s.version = CF::UAA::VERSION
- s.authors = ["Dave Syer", "Dale Olds", "Joel D'sa", "Vidya Valmikinathan", "Luke Taylor"]
- s.email = ["dsyer@vmware.com", "olds@vmware.com", "jdsa@vmware.com", "vidya@vmware.com", "ltaylor@vmware.com"]
- s.homepage = "https://github.com/cloudfoundry/uaa/tree/master/gem"
- s.summary = %q{Deprecated client and resource library for CloudFoundry UAA. Please use cf-uaa-lib and cf-uaac instead.}
- s.description = %q{Deprecated client library and command line tools for interacting with the CloudFoundry User Account and Authorization (UAA) server. The UAA is an OAuth2 Authorization Server so it can be used by webapps and command line apps to obtain access tokens to act on behalf of users. The tokens can then be used to access protected resources in a Resource Server. This library can be used by clients (as a convenient wrapper for mainstream oauth gems) or by resource servers.}
-
- s.rubyforge_project = "cf-uaa-client"
-
- s.files = `git ls-files`.split("\n")
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
- s.require_paths = ["lib"]
-
- # dependencies
- s.add_development_dependency "bundler"
- s.add_development_dependency "rake"
- s.add_development_dependency "rspec"
- s.add_development_dependency "simplecov"
- s.add_development_dependency "simplecov-rcov"
- s.add_development_dependency "ci_reporter"
- s.add_runtime_dependency "highline"
- s.add_runtime_dependency "rest-client"
- s.add_runtime_dependency "yajl-ruby"
- s.add_runtime_dependency "eventmachine"
- s.add_runtime_dependency "launchy"
- s.add_runtime_dependency "em-http-request", ">= 1.0.0.beta.3"
-
-end
View
@@ -1,14 +0,0 @@
-#--
-# 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/runner"
Oops, something went wrong.

0 comments on commit eecfb7d

Please sign in to comment.