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

Add support for accessing and updating FrameworkMetadata at runtime #878

Open
2 tasks
phantumcode opened this issue Feb 13, 2023 · 2 comments
Open
2 tasks
Labels
feature-request A feature should be added or improved. needs-investigation

Comments

@phantumcode
Copy link
Member

Describe the feature

Currently the Amplify Swift library uses the FrameworkMetadata to configure the framework name and version. This metadata is used to populate the UserAgent filed in the service client requests.

The FrameworkMetadata is configured at client configuration time, but is needed to be updatable at runtime.

Use Case

The Amplify Swift library has requirements to capture additional metatadata that are dynamic at runtime such as framework api signature and environment locale and region.

Proposed Solution

Change the FrameworkMetadata extra field to be accessible and editable at runtime per request

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@phantumcode phantumcode added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 13, 2023
@ganeshnj
Copy link
Contributor

we have a consistent way to extend user agent using https://github.com/awslabs/aws-sdk-swift/blob/main/Sources/Core/AWSClientRuntime/Http/ExecutionEnvMetadata.swift#LL23C65-L23C82 env var

I wonder what's the use case here. Adding anything extra to the env var will be get injected to user agent.

@phantumcode
Copy link
Member Author

phantumcode commented Feb 22, 2023

@ganeshnj Thanks for pointing out ExecutionEnvMetadata.

The use case fromthe Amplify Swift library is to be able to identify which of the Amplify api is being called from the customer.

For example, if a customer app is using Amplify library for the storage category and calls the api Amplify.Storage.uploadData(key:, data:, options:), we would like to include the api signature in the UserAgent for all api usages going through Amplify.

The UserAgent would look something like:
User-Agent: aws-sdk-swift/1.0 api/xx-xx-xx/1.0 os/iOS/16.2.0 lang/swift/5.7 lib/amplify-ios/2.2.0/amplify.storage.upload(key:, data:, options)

It doesn't look like ExecutionEnvMetadata would support this use case. We would need to this set this for each api execution at runtime.

@jbelkins jbelkins added needs-investigation and removed needs-triage This issue or PR still needs to be triaged. labels Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. needs-investigation
Projects
None yet
Development

No branches or pull requests

3 participants