Giter VIP home page Giter VIP logo

Comments (12)

bradley-curran avatar bradley-curran commented on September 24, 2024 1

Once the above PR is merged I'll create 1.4 so you can use the fixed version.

If you need this quickly you can checkout the PR and build from source.

If you decide to build from source let me know if you have any problems.

from aws-device-farm-gradle-plugin.

ollyjshaw avatar ollyjshaw commented on September 24, 2024 1

👍
Great to see this issue progressing. It will help us use it more idiomati Any ideas on a release?
Thanks.

from aws-device-farm-gradle-plugin.

bradley-curran avatar bradley-curran commented on September 24, 2024

Thanks for submitting this issue.

I'm looking into the bug now. Have you seen this issue in previous versions of the plugin? (v1.2 etc)

from aws-device-farm-gradle-plugin.

nmwilk avatar nmwilk commented on September 24, 2024

No, the plugin is new to me and 1.3 is the first one I've tried.

from aws-device-farm-gradle-plugin.

bradley-curran avatar bradley-curran commented on September 24, 2024

I've reproduced the issue locally on v1.3 using the following in my module build.gradle

devicefarm {
    projectName "Test"

    authentication {
        roleArn "arn:aws:iam::000000000000:role/MyRole"
    }
}

from aws-device-farm-gradle-plugin.

wturney avatar wturney commented on September 24, 2024

Any update on this issue? Appears to affect 1.2 as well.

from aws-device-farm-gradle-plugin.

wturney avatar wturney commented on September 24, 2024

I appreciate the response. Wound up forking it and adding a fallback to the default credential provider chain if no explicit overrides are provided via configuration.

    public AWSDeviceFarm initializeApiClient(final DeviceFarmExtension extension) {
        final AWSDeviceFarmClientBuilder clientBuilder = AWSDeviceFarmClientBuilder.standard();
        final Authentication authentication = extension.getAuthentication();
        final AWSCredentialsProvider credentialsProvider = getAwsCredentialsProvider(authentication);
        final ClientConfiguration clientConfiguration = new ClientConfiguration()
                .withUserAgentSuffix(String.format(extension.getUserAgent(), pluginVersion));
        return clientBuilder.withCredentials(credentialsProvider)
                .withClientConfiguration(clientConfiguration)
                .withRegion("us-west-2")
                .build();
    }

    private AWSCredentialsProvider getAwsCredentialsProvider(Authentication authentication) {
        AWSCredentialsProvider credentialsProvider;
        if (authentication != null && authentication.isValid()) {
            if (authentication.getRoleArn() != null) {
                credentialsProvider = new STSAssumeRoleSessionCredentialsProvider
                        .Builder(authentication.getRoleArn(), RandomStringUtils.randomAlphanumeric(8))
                        .build();
            } else {
                BasicAWSCredentials credentials = new BasicAWSCredentials(authentication.getAccessKey(), authentication.getSecretKey());
                credentialsProvider = new STSSessionCredentialsProvider(credentials);
            }
        } else {
            credentialsProvider = DefaultAWSCredentialsProviderChain.getInstance();
        }
        return credentialsProvider;
    }

from aws-device-farm-gradle-plugin.

bradley-curran avatar bradley-curran commented on September 24, 2024

That's definitely another way of resolving the issue.

As far as I can tell, the devicefarmUpload task will work even if you don't provide an authentication closure, correct?

from aws-device-farm-gradle-plugin.

rivercartwright avatar rivercartwright commented on September 24, 2024

I would also like a release of 1.4 with the roleArn fix please. Any idea when?

from aws-device-farm-gradle-plugin.

anandkiran2007 avatar anandkiran2007 commented on September 24, 2024

Is this issue fixed ?

from aws-device-farm-gradle-plugin.

shariyatha avatar shariyatha commented on September 24, 2024

any update on this or workaround. ?

from aws-device-farm-gradle-plugin.

igor-brishkoski avatar igor-brishkoski commented on September 24, 2024

seeing this as well

from aws-device-farm-gradle-plugin.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.