Skip to content

Commit

Permalink
mark cf-uaa-client gem as deprecated.
Browse files Browse the repository at this point in the history
Change-Id: I03a93930cd817f45344616272abcad78bd12822f
  • Loading branch information
daleolds committed Dec 12, 2012
1 parent bed7dcf commit 11c4b2f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
49 changes: 27 additions & 22 deletions gem/README.md
@@ -1,57 +1,62 @@
CloudFoundry UAA Gem CloudFoundry UAA Gem
==================== ====================


*NOTE: This gem is deprecated. Please use cf-uaa-lib and cf-uaac gems instead.
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. Client gem for interacting with the CloudFoundry UAA server.


Set up a local ruby environment (so sudo not required): Set up a local ruby environment (so sudo not required):


$ rvm use 1.9.2 $ rvm use 1.9.2


or or


$ rbenv global 1.9.2-p180 $ rbenv global 1.9.2-p180


see: https://rvm.io/ or http://rbenv.org/ see: https://rvm.io/ or http://rbenv.org/


Build the gem Build the gem


$ bundle install $ bundle install
$ gem build cf-uaa-client.gemspec $ gem build cf-uaa-client.gemspec


Install it Install it


$ gem install cf-uaa-client*.gem $ gem install cf-uaa-client*.gem


Run it Run it


$ uaac help $ uaac help
$ uaac target uaa.cloudfoundry.com $ uaac target uaa.cloudfoundry.com
$ uaac token get <your-cf-username> $ uaac token get <your-cf-username>
$ uaac token decode $ uaac token decode


Use the gem: Use the gem:


#!/usr/bin/env ruby #!/usr/bin/env ruby
require 'uaa' require 'uaa'
token_issuer = CF::UAA::TokenIssuer.new("https://uaa.cloudfoundry.com", "vmc") token_issuer = CF::UAA::TokenIssuer.new("https://uaa.cloudfoundry.com", "vmc")
puts token_issuer.prompts.inspect puts token_issuer.prompts.inspect
token = token_issuer.implicit_grant_with_creds(username: "<your_username>", password: "<your_password>") 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 token_info = TokenCoder.decode(token.info[:access_token], nil, nil, false) #token signature not verified
puts token_info[:user_name] puts token_info[:user_name]


## Tests ## Tests


Run the tests with rake: Run the tests with rake:


$ bundle exec rake test $ bundle exec rake test


Run the tests and see a fancy coverage report: Run the tests and see a fancy coverage report:


$ bundle exec rake cov $ bundle exec rake cov


Run integration tests (on a server running on localhost:8080/uaa): Run integration tests (on a server running on localhost:8080/uaa):


$ export UAA_CLIENT_ID="admin" $ export UAA_CLIENT_ID="admin"
$ export UAA_CLIENT_SECRET="adminsecret" $ export UAA_CLIENT_SECRET="adminsecret"
$ export UAA_CLIENT_TARGET="http://localhost:8080/uaa" $ export UAA_CLIENT_TARGET="http://localhost:8080/uaa"
$ bundle exec rspec spec/integration_spec.rb $ bundle exec rspec spec/integration_spec.rb
4 changes: 2 additions & 2 deletions gem/cf-uaa-client.gemspec
Expand Up @@ -21,8 +21,8 @@ Gem::Specification.new do |s|
s.authors = ["Dave Syer", "Dale Olds", "Joel D'sa", "Vidya Valmikinathan", "Luke Taylor"] 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.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.homepage = "https://github.com/cloudfoundry/uaa/tree/master/gem"
s.summary = %q{Client and resource library for CloudFoundry UAA} s.summary = %q{Deprecated client and resource library for CloudFoundry UAA. Please use cf-uaa-lib and cf-uaac instead.}
s.description = %q{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.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.rubyforge_project = "cf-uaa-client"


Expand Down
1 change: 1 addition & 0 deletions gem/lib/uaa/version.rb
Expand Up @@ -13,6 +13,7 @@


module CF module CF
module UAA module UAA
warn "The cf-uaa-client gem is deprecated. Please use cf-uaa-lib and cf-uaac instead"
VERSION = "1.3.0" VERSION = "1.3.0"
end end
end end

0 comments on commit 11c4b2f

Please sign in to comment.