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

Support long-running background operations #638

Closed
nick3389 opened this issue Jul 13, 2020 · 12 comments
Closed

Support long-running background operations #638

nick3389 opened this issue Jul 13, 2020 · 12 comments
Labels
connectivity Problems related to network connectivity feature-request Request a new feature storage Issues related to the Storage category

Comments

@nick3389
Copy link

nick3389 commented Jul 13, 2020

Hello,

I want to migrate the old aws-ios-sdk to the Amplify SDK, as the former has been declared as legacy code despite the updates and bug fixes. Therefore, I would like to ask if static credentials are supported in this sdk to upload files to S3. in my current implementation I use static credentials along with Transfer utility as follows:

`let staticCredentialsProvider = AWSStaticCredentialsProvider(accessKey: accessKey, secretKey: secretKey)
let s3Utility = AWSS3TransferUtilityConfiguration()
s3Utility.timeoutIntervalForResource = 50 * 60 * 24 * 7

let wifiTU = AWSS3TransferUtility.s3TransferUtility(forKey: "custom_key")
let wifiConfiguration = AWSServiceConfiguration(region: region, credentialsProvider: staticCredentialsProvider)
wifiConfiguration?.allowsCellularAccess = false

AWSS3TransferUtility.register(with: wifiConfiguration!, transferUtilityConfiguration: s3Utility, forKey: "custom_key")`

Will I be able to have a similar setup with Amplify?

Thanks.

@lawmicha lawmicha added pending-triage Issue is pending triage storage Issues related to the Storage category question General question labels Jul 13, 2020
@wooj2
Copy link
Contributor

wooj2 commented Jul 14, 2020

Using AWSStaticCredentialsProvider w/ passing in an access key and secret key in your application is not recommended. These credentials can easily be extracted from your application by extracting the binary and running a simple strings command against the compiled binary. I believe it was only added for test purposes, so just to be super clear: we highly recommend you avoid using this for production use cases.

Could you tell us a little bit more about your use case? We may be able to recommend an approach with using the Amplify Libraries?

@nick3389
Copy link
Author

nick3389 commented Jul 15, 2020

@wooj2 Actually the case is that regularly we upload files to S3. The example that I gave you in my initial post is the actual implementation I use, so there is nothing more to say here. The most important note here is that we depend on uploading the files while the app is in the background. So, background task support is necessary for us. Please free to suggest any different approach.

@wooj2 wooj2 removed the pending-triage Issue is pending triage label Jul 17, 2020
@wooj2 wooj2 self-assigned this Jul 17, 2020
@wooj2 wooj2 added the feature-request Request a new feature label Jul 17, 2020
@wooj2
Copy link
Contributor

wooj2 commented Jul 17, 2020

HI @nick3389,

Unfortunately, a static credentials provider is not available for Amplify storage. But as you've noted, what's important is that we will need to add support for long standing uploads that happen while the app is in the background.

Thanks for calling this out, and I will be marking this as a feature request/enhancement.

@wooj2 wooj2 removed the question General question label Jul 17, 2020
@wooj2 wooj2 removed their assignment Jul 17, 2020
@nick3389
Copy link
Author

@wooj2 Are static credentials going to be supported in future releases of amplify?

@wooj2
Copy link
Contributor

wooj2 commented Aug 12, 2020

Hi @nick3389

I can not promise anything, but I believe that supporting long standing uploads that happen while the app is in the background is an important use case for our customers., Unfortunately, I'm unable to comment whether or not we would be using static credentials to support that. That being said, I would imagine that if there was another way to support long standing uploads while the app is in the background without static credentials, we would try going down that route, but I'm not aware of anyone on the team who has done this investigation.

@nick3389
Copy link
Author

nick3389 commented Aug 14, 2020

Hey @wooj2 !

I think setting up a AWSServiceConfiguration with a credentials provider that conforms to AWSCredentialsProvider as AWSStaticCredentialsProvider does in the aws-ios-sdk is irrelevant of whether a service like AWSS3TransferUtility supports uploads/downloads in the background. I am sorry if my question was misinterpreted, but I wanted to ask whether static credentials will be another way to setup a service configuration object or generally use it as a setup to be able to upload/download files to S3...

@drochetti drochetti added the follow up Requires follow up from maintainers label Oct 10, 2020
@palpatim
Copy link
Member

palpatim commented Nov 8, 2020

I'm changing the title of this issue so it more accurately reflects the use case we're trying to support with the feature request, and hopefully avoids an XY problem. Static credentials may be the only way to accomplish this, but what we really want to support is long-running background transfers.

@palpatim palpatim changed the title Static credentials for uploading to S3 Support long-running background operations Nov 8, 2020
@rromanchuk
Copy link

I want to migrate the old aws-ios-sdk to the Amplify SDK, as the former has been declared as legacy code despite the updates and bug fixes.

@nick3389 can you share with me where you read that? Or do you just mean it "feels" that way?

@nick3389
Copy link
Author

@rromanchuk Sorry for the delay. You can read it here at the bottom.

@brennanMKE
Copy link
Contributor

@nick3389 Would you like to file a feature request so we can collect the necessary details and close this issue?

@nick3389
Copy link
Author

nick3389 commented Dec 7, 2021

@brennanMKE Just submitted #1559

@brennanMKE
Copy link
Contributor

@nick3389 Thanks, I will raise the feature request with the team.

@brennanMKE brennanMKE removed the follow up Requires follow up from maintainers label Dec 8, 2021
@brennanMKE brennanMKE added the connectivity Problems related to network connectivity label Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connectivity Problems related to network connectivity feature-request Request a new feature storage Issues related to the Storage category
Projects
None yet
Development

No branches or pull requests

7 participants