* B #2575: encode the EGID in the authentication token when a user
authenticates with a scoped user token
* Update OpenNebulaCloudAuth.rb
* Update OpenNebulaCloudAuth.rb
Econe server fails with <NoMethodError: undefined method `split' for nil:NilClass>
when using some clients (ec2 Ansible modules for example). The problem
lies in parsing Authentication header format.
Euca sends:
Credential=tom/20160425/undefined-19606/ec2/aws4_request, SignedHeaders=accept;accept-encoding;connection;content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=fsomehash8cda2
Ansible EC2 module sends:
Credential=tom/20160425/servers/one/aws4_request,SignedHeaders=host;x-amz-date,Signature=6b2ccdsomehash39f2fc555
Previous implementation fails when fields are separated with ","
(without space). Documentation [1] for AWS API says "are separated by a
comma" so there should be just comma, but I'd prefer to maintain
compatibility with euca and convert headers (remove spaces after comma).
[1] http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html
The current with of the IP address column is too small: The IP address "192.168.1.64", for instance, is 12 characters long, and gets truncated to "192.168.1.". Reserving 15 should do:
irb(main):001:0> "XXX.XXX.XXX.XXX".length
=> 15
irb(main):002:0>
The current code in `ElasticIP::associate_address()` strips the leading `i-` prefix of VM instance IDs, if found, in order to convert EC2 instance IDs into OpenNebula VM IDs. Unfortunately that does not work for IDs greater than 7, since the stripped string is interpreted as an octal number due to the remaining leading 0's:
$ econe-allocate-address
$ econe-describe-addresses
publicIp instanceId
192.168.1.
$ econe-associate-address 192.168.1.1 i-00000106
$ econe-describe-addresses
publicIp instanceId
192.168.1. i-00000070
(Note that decimal 106 is octal 70)