Netflix / denominator

Portably control DNS clouds using java or bash
Apache License 2.0
580 stars 110 forks source link

Map Credentials does not work some times #281

Closed santhosh-tekuri closed 9 years ago

santhosh-tekuri commented 9 years ago

MapCredenitals are converted to List<Object> by providers using:

ListCredentials.asList(credentials)

current implementation of this method, simply takes returns new ArrayList<Object>(map.values())

note that, in map order of entries is not defined. so credential parameters might be in wrong order;

you can verify the same by following test:

        Map<String, String> map = new LinkedHashMap<String, String>();
        map.put("secretKey", "ZZZZZZZZZZZZZZ");
        map.put("accessKey", "AAAAAA");

        System.out.println(map.values());
        Credentials credentials = Credentials.MapCredentials.from(map);
        DNSApiManager manager = Denominator.create("route53", CredentialsConfiguration.credentials(credentials));
        ZoneApi zones = manager.api().zones();
        for(Zone zone: zones)
            System.out.println(zone);

the above code fails to list zones. but if accessKey is inserted before secretKey, then it works

I fixed the issue in my fork branch map-credentials: https://github.com/santhosh-tekuri/denominator/tree/map-credentials

please evaluate the fix and merge

cloudbees-pull-request-builder commented 9 years ago

denominator-pull-requests #385 SUCCESS This pull request looks good

cloudbees-pull-request-builder commented 9 years ago

NetflixOSS » denominator » denominator-pull-requests #10 SUCCESS This pull request looks good

codefromthecrypt commented 9 years ago

thanks for raising this! hadn't run into it, but I can see what's going on. I left comments on #280

codefromthecrypt commented 9 years ago

closed via e6dfb6c175385af900d3a4a012e342ab8030dc71