Skip to content

Instantly share code, notes, and snippets.

@n1zyy
Created January 4, 2012 21:39
Show Gist options
  • Save n1zyy/1562299 to your computer and use it in GitHub Desktop.
Save n1zyy/1562299 to your computer and use it in GitHub Desktop.
aeolus-image-rubygem with OAuth
# Install the RPM at http://people.redhat.com/mawagner/rpms/rubygem-aeolus-image-0.3.0-0.20120104161149gitc13b654.fc15.noarch.rpm
# It includes some debugging output you'll see in irb
#
# Then start irb (from anywhere)
require 'rubygems'
#=> false
require 'aeolus_image'
#=> true
# Set up :url, :consumer_key, and :consumer_secret as required
Aeolus::Image::Warehouse::WarehouseModel.config = {
:iwhd => {
:url => 'http://10.16.185.213:9090',
:oauth => {
:consumer_key => 'TZcSvuVe3CWb1KgSRSZZkB/rcThPbW20',
:consumer_secret => 'ebozxpnKjeJk4HzYckqkKVnO4wz6+ZsN'
}
}
}
# Then run something simple to generate a request
Aeolus::Image::Warehouse::Image.last
# You should see some output like ">>> using token", including a POST request
# I used Wireshark to verify the oauth_body_hash parameter
# The body was "op=parts", so the hash in https://www.aeolusproject.org/redmine/issues/2606 is actually accurate here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment