Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: EcsCredentialsProvider constructor is internal only (#946 / 0.32.2-beta) #1048

Closed
cloudshiftchris opened this issue Sep 18, 2023 · 3 comments · Fixed by #1049
Closed
Assignees
Labels
bug This issue is a bug.

Comments

@cloudshiftchris
Copy link

Describe the bug

Using EcsCredentialsProvider as part of configuring SDK clients, something like:

    return listOfNotNull(
        sessionCredentials?.let {
            StaticCredentialsProvider(Credentials(it.accessKey, it.secretKey, it.sessionToken))
        },
        basicCredentials?.let {
            StaticCredentialsProvider(Credentials(it.accessKey, it.secretKey))
        },
        environmentVariables.takeIf { it }?.let { EnvironmentCredentialsProvider() },
        profile?.let { ProfileCredentialsProvider(profileName = it) },
        container.takeIf { it }?.let { EcsCredentialsProvider() },
        imds.takeIf { it }?.let { ImdsCredentialsProvider() }
    )

This worked up to (and including) 0.32.1-beta. As of 0.32.2 EcsCredentialsProvider() fails to compile, indicating that the constructor is internal. #946 removed public constructor() : this(PlatformProvider.System) but did not adjust the primary constructors visibility.

Expected behavior

EcsCredentialsProvider has an accessible constructor and can be external instantiated.

Current behavior

Unable to compile against 0.32.2-beta / use EcsCredentialsProvider

Steps to Reproduce

Using 0.32.2-beta create a new EcsCredentialsProvider() and observe the compilation failure.

Possible Solution

Make EcsCredentialsProvider constructor public for symmetry with other credentials providers. Consumers should be able to recreate (selectively / with adjustments) what DefaultChainCredentialsProvider does.

Context

No response

AWS Kotlin SDK version used

0.32.2-breta

Platform (JVM/JS/Native)

JVM

Operating System and version

MacOS

@cloudshiftchris cloudshiftchris added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 18, 2023
@ianbotsf
Copy link
Contributor

Thanks for the bug report @cloudshiftchris. I've reproduced this locally and will have a fix PRed shortly.

@ianbotsf ianbotsf self-assigned this Sep 18, 2023
@ianbotsf ianbotsf removed the needs-triage This issue or PR still needs to be triaged. label Sep 18, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@ianbotsf
Copy link
Contributor

The fix for this has been merged to main and will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants