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

403 STS #768

Open
jeronimonunes opened this issue Nov 12, 2023 · 1 comment
Open

403 STS #768

jeronimonunes opened this issue Nov 12, 2023 · 1 comment
Labels
feature request help wanted Extra attention is needed

Comments

@jeronimonunes
Copy link

Bug Description

Using STS library all requests turns out as 403

Steps To Reproduce

  1. Create a project using this library
  2. Implement a basic put request
  3. Place the STS library into you classpath or pom.xml
  4. Deploy the application in an environment that provide the STS authentication

Expected Behavior

Requests are successfully authenticated

Environment

  • s3fs-nio version:
  • OS: ubuntu
  • JDK: 17
@jeronimonunes jeronimonunes added bug Something isn't working needs triage The issue needs to be triaged, before work can commence labels Nov 12, 2023
@steve-todorov
Copy link
Collaborator

steve-todorov commented Nov 29, 2023

Hey,

Apologies for the delayed reply, but we've been busy the past weeks.

It sounds to me like you have not properly configured the environment for the new filesystem:

import static org.carlspring.cloud.storage.s3fs.S3Factory.ACCESS_KEY;
import static org.carlspring.cloud.storage.s3fs.S3Factory.SECRET_KEY;

Map<String, ?> env = ImmutableMap.<String, Object> builder().put(ACCESS_KEY, "access key")
                                                            .put(SECRET_KEY, "secret key")
                                                            .build();

FileSystems.newFileSystem(URI.create("s3:///"), env, Thread.currentThread().getContextClassLoader());

We currently do not support picking up the AWS environment variables so if you've deployed this in an EC2 instance with STS then that would not work out of the box unfortunately. You could probably use this:

Map<String, ?> env = ImmutableMap.<String, Object> builder().put(ACCESS_KEY, System.getEnv('AWS_ACCESS_KEY_ID'))
                                                            .put(SECRET_KEY, System.getEnv('AWS_SECRET_ACCESS_KEY'))
                                                            .build();

It is in our TODO list to have this automatically picked up, but we simply don't have that much time to dig into it right now.
We are open for PRs if you are interested in working on this feature. :)

@steve-todorov steve-todorov added help wanted Extra attention is needed feature request and removed bug Something isn't working needs triage The issue needs to be triaged, before work can commence labels Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants