Comments (3)
Had a little investigation here. Your body is as follows
Action=CreatePlatformApplication
&Name=myapp
&Platform=APNS_SANDBOX
&Attributes.PlatformCredential=<private key>
&Attributes.PlatformPrincipal=<ssl certificate>
&Version=2010-03-31
AWS is expecting it in the following form
Action=CreatePlatformApplication
&Name=myapp
&Platform=APNS_SANDBOX
&Attributes.entry.1.key=PlatformCredential
&Attributes.entry.1.value=<private key>
&Attributes.entry.2.key=PlatformPrincipal
&Attributes.entry.2.value=<ssl certificate>
&Version=2010-03-31
It appears to be serializeToFlatDictionary() that is returning the "malformed" dictionary.
from soto.
I fixed the code to output the correct dictionary format in JSONSerializer.serializeToFlatDictionary(). See code changes below
func serializeToFlatDictionary(_ data: Data) throws -> [String: Any] {
func flatten(dictionary: [String: Any]) -> [String: Any] {
var flatted: [String: Any] = [:]
func destructiveFlatten(dictionary: [String: Any]) {
for (key, value) in dictionary {
switch value {
case let value as [String: Any]:
for iterator in flatten(dictionary: value).enumerated() {
switch iterator.element.value {
case let value2 as [String: Any]:
destructiveFlatten(dictionary: value2)
case let values as [Any]: // TODO: values<Element> might be dictionary...
for iterator in values.enumerated() {
flatted["\(key).member.\(iterator.offset+1)"] = iterator.element
}
default:
flatted["\(key).entry.\(iterator.offset+1).key"] = iterator.element.key
flatted["\(key).entry.\(iterator.offset+1).value"] = iterator.element.value
}
}
case let values as [Any]: // TODO: values<Element> might be dictionary...
for iterator in values.enumerated() {
flatted["\(key).member.\(iterator.offset+1)"] = iterator.element
}
default:
flatted[key] = value
}
}
}
destructiveFlatten(dictionary: dictionary)
return flatted
}
CreatePlatformApplication is still failing though. It is now returning the error "PlatformPrincipal not valid". I have tested the certificate and key using the CLI and web interface and they both work fine.
from soto.
Closing this issue in favour of splitting it into two #106 and #107
from soto.
Related Issues (20)
- KMS throws fatal runtime error (Fatal error: Dictionary literal contains duplicate keys) HOT 1
- Add Cocoapods support HOT 5
- I use aws-cli get eks token like "aws eks get-token --cluster-name xxx", but i can't find it this, so i missed or not exist. HOT 7
- Multiplepart upload pause, resume and stop state manage HOT 4
- When I am trying to upload video using VPN HOT 5
- Textract.ValueType fails to parse HOT 9
- Can you consider to support cocoapods HOT 2
- Multiple fails uploads from Network lost issues causing CredentialProviderError.noProvider error to be thrown HOT 9
- EXC_BAD_ACCESS KERN_PROTECTION_FAILURE during s3FileTransferManager.copy HOT 4
- I am getting below error while uploading more then 8 images on same time. HOT 1
- How to Optimizing AWS S3 File Downloads for Multiple Objects in a Single Request HOT 1
- Issue with selectObjectContent SQL query HOT 2
- [7.x.x] watchOS : POSIXErrorCode(rawValue: 50): Network is down HOT 2
- Concurrently download multiple s3 "multipart" parts HOT 1
- Thread Performance Checker: Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. HOT 29
- Explicitly specify dependencies for each target/module HOT 3
- 7.x: Multipart upload progress is wrong when resuming a multipart upload
- PutObjectRequest API how to get progress HOT 1
- try to use SES in Soto SDK with Vapor 4 but I have some error HOT 2
- Devcontainer should install SwiftFormat HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soto.