How to sign AWS transcribestreaming request - amazon-web-services

Can you tell me is there any documentation about how a request signature should be generated, for the transcribestreaming service? Wondering specifically about how the payload body should be evaluated. Should it be based on the first frame of data?
Also can multiple requests/streams be transcribed over one HTTP2 connection?
ref: https://docs.aws.amazon.com/transcribe/latest/dg/API_streaming_StartStreamTranscription.html
I was trying to find the source code for this java class:
TranscribeStreamingAsyncClient
Is it available on github anywhere?

Related

Genexus - Mark unrecognized procedure parameters as ignorable in webservices

I have procedures that are exposed as Webservices (REST):
I need it to be able to parse the request body ignoring unrecognized fields (that are not specified
in "rules"). Right now, when procedures tries to parse something that is not defined within the parameters, they throw the following error:
Example:
Some procedure has the following definition:
parm(in:&parm1, in:&parm2, out:&someResponse);
Then we change to:
parm(in:&parm1, in:&parm2, in:&parm3, out:&someResponse);
The web service is updated on some distributions, but on some they're still on the old version with 2 in parameters.
The service that consumes these web services on different APP distributions are sending the body with the second (latest definition).
{
"parm1" : "somevalue",
"parm2" : "somevalue",
"parm3" : "somevalue"
}
Unfortunately we don't have control of the third party that is consuming our web services, so in that case, it would be a lot easier if unused parameters could be ignored...
USING GX 16 U11 - Java Generator
Unfortunately there is no way in GeneXus 16 to "catch" the request and do something previous to the object logic. In GeneXus 17 we have the new API object, there you can transform the parameters.
But, not everything is lost. Taking into account you're generating in Java, there is an "external way" to do it with Filters. I used them to log the client requests for debugging purposes.
If you don't want to mess with the code, there is also API Gateways you could put in front of your API services to redirect the requests to the right service. Bear in mind that I'm not a specialist in this topic, maybe a post in ServerFault would help.

Spring WS endpoint routing when whole body is encrypted

So I'm working with Spring Boot to implement a service API for interop with a third party. I'm using payload-based routing because they are not sending SOAPAction or any addressing information. However, when a request comes in, it's trying to map one of the incoming encryption-related elements and failing to map. I think the problem is that my friends at the third party are element-encrypting the operation element:
<n1:body>
<n2:SomeOperation> // This is
...some content... // all
</n3:SomeOperation> // encrypted
</n1:body>
From my reading, Spring attempts to map to an endpoint before encryption, so payload mapping will never work. I could use #Action or #SoapAction, but they are using Soap 1.2 (so no action header) and not using addressing. I have also verified that the Wss4SecurityInterceptor is being added, but is never called when a request is made.
Is my assessment/understanding of the situation correct? Can anyone think of any workarounds, because having the remote party change anything is nearly impossible.
A related question (hopefully asking one is not too unorthodox): I was trying to make my test client only encrypt the content of my operation element, but my setSecurementEncryptionParts() call is not playing nice. Here's the outgoing payload(from the console):
<ns2:EchoTestInput xmlns:ns2="http://xml.netbeans.org/schema/EchoTestSchema">
<ns2:valueIn>Quack</ns2:valueIn>
</ns2:EchoTestInput>
And here's the call to setSecurementEncryptionParts()
securityInterceptor.setSecurementEncryptionParts("{Content}{http://xml.netbeans.org/schema/EchoTestSchema}EchoTestInput");
I thought this should all be easy, but I guess not. Thanks a million in advance!

Access web within AWS Lambda

I'd like to define a lambda. When it receives a POST request, I'd like to make another POST request to an external uri (say, splunk or apigee or anything outside of AWS). Is this possible? Does Lambda allow the internet access? I googled but did not find a good answer for this one.
Yes, you can run pretty much any code that you would run on a normal EC2 instance. For instance, if you write your Lambda in node.js you can use the request library to make HTTP calls out to other webservices. The same is true of Java or Python as long as you include whatever library you want to use to make the call in your Lambda. Just make sure you set the Lambda timeout high enough to allow your call(s) enough time to complete.
I wrote a blog post that shows a simple example of a Lambda calling out to a weather API(HTTP GET) to get weather for a zip code and post it in Slack: http://www.ryanray.me/serverless-slack-integrations

How to get Address of elasticache nodes from Java API?

I am making a describeCacheClusters request as follows and get a valid response but the getCacheClusters() method returns null even though that cluster has available nodes. Is there another request I should be using or a missing parameter?
DescribeCacheClustersResult result = awsClient
.describeCacheClusters(new DescribeCacheClustersRequest()
.withCacheClusterId(ELASTICACHE_CLUSTER_ID));
You are missing a parameter indeed due to a somewhat confusing API design resp. documentation issue with Amazon ElastiCache:
You need to add setShowCacheNodeInfo() to your DescribeCacheClustersRequest and call getCacheNodes() for each CacheCluster retrieved via getCacheClusters() from the DescribeCacheClustersResult - see my answer to the semantic duplicate Finding AWS ElastiCache endpoints with Java for details and code samples.

Timestamp of server from a web service call

Is there a way that I can retrieve the timestamp of a web service call? I'm trying to get the time of the server hosting the web service.
Easiest thing to do is to just log them in the server implementation of your service contract, you can use PostSharp to make some attributes to take of this aspect.
For instance, you can write a Trace attribute which simply logs a debug message when a method is invoke. Here's one I wrote a while back which tracks how long a method takes and log a warning message if it takes longer than a set threshold:
http://theburningmonk.com/2010/03/aop-method-execution-time-watcher-with-postsharp/
I came across some 'trace' attribute example before, if you want I can look for it for ya.