How to pass cognito ID into amazonEventbridge from Amazon location service in order to invoke Lambda with id as paramater - swift

I have a mobile app in swift. I am using AWS technologies. For all my users I have created only one tracker that is linked to several geofences. I want that when a certain user enters the geofence, a lambda function will be triggered, and as parameter of the lambda function I want to pass the cognitoID, how would I do that?
I want to invoke the lambda function not on my mobile app, however through amazon eventbridge and still pass the cognito Id
I am expecting the overall high level and if possible especifics and also where can I find the information for it.

Related

How to use Salesforce Field Service Mobile Flow in app AND lightning web

I am designing a Field Service Mobile Flow for a Salesforce instance (release Winter '23 Patch 17.7) using the Field Service Lightning package to manage technicians with service appointments in the field. The flow will be presented to technicians in the field in the Salesforce Field Service Mobile (FSM) app on iOS devices.
This flow will be added as quick action on a specific object, e.g. a ServiceAppointment object. Hence it will be presented in the app to the technician to execute the flow. Additionally, quick actions are also shown in the lightning web view of the object, enabling to execute the same flow, even though it is a Field Service Mobile Flow.
The challenge occurs, when trying to use the Id of the calling record (here the ServiceAppointment) as input.
The FSM app provides the Id of the calling object as variable Id, while a flow executed from the lightning web view passes the variabled recordId.
How can one handle this to use the same Field Service Mobile Flow in the FSM app AND in web lightning view.
I added a subflow to retrieve the origin of the call, differentiating between the two input variables, and setting an output variable current_record_id accordingly.
The condition checks, wether the input variable Id or the input variable recordId is set and assigns the output variable current_record_id accordingly.
You might already spot the actual challenge. The behaviour of not-provided variables is different in the FSM app, the web call and (to make it even worse) when debugging the flow.
The following table shows my checks for the different origins and the resulting outcome (which check proofs as true)
Path
Call flow from
outcome
1
FSM app (provides Id)
recordId is null
2
Lightning Web (provides recordId)
Id is empty
3
Flow designer debug (recordId provided)
Id is null
4
Flow designer debug (Id provided)
recordId is null
hence we have to explicitly check for null OR empty for the missing variable.
Now you can use four Field Service Mobile Flow via a quick action the Field Service Mobile App, in Salesforce Lightning and in the Flow Debugger successfully.

Securing google firebase cloud function with stripe integration

We are using google cloud platform to host our stripe payment gateway. The cloud function sends the payment intent to stripe and a callback that stripe calls with a session object.
Inside the google cloud platform, we are not sure what permission to set our cloud function. Right now, we allow all public access and we are fearing that a hacker can see our secret key from our index.js (where the cloud functions live), or has the ability to manipulated the code inside of the index.js.
With the function's purpose described above, what is the safest permission setting that does not allow any public users to read or manipulate our functions? All we want is to allow the users to invoke the function,
thank you
I've implemented Stripe for an app using a combination of the Golang SDK and JavaScript SDKs that I'm deploying as an app to Cloud Run. So my config is slightly different to yours.
You should be able to:
Provide some protection by keeping Stripe's API keys as environment variables so that the JavsScript only accesses these in-memory. You may want to consider using Secret Manager.
Differentiate between authenticated handlers that trigger the flow and restricted handlers that accept the callback from Stripe.
You can authenticate using Cloud IAP (Google auth requiring users be part of the project) or e.g. Cloud Endpoints and Firebase auth
You can restrict access to the callback to Stripe's endpoints
I'm not a security guy.
Your learnings would make an interesting customer story for Stripe and GCP.
check how these guys implement their stripe functions, they have a bunch of them https://functions.store

Azure Web Application Firewall API

We have a problem with certain form inputs being blocked by the Azure WAF managed rules because one of our internal systems allows certain values and is not filtered by the WAF (different host.)
I'd like to use the WAF API (which I can't find documentation on) to do things like validate form input field values from our non-Azure-hosted application to check that when they are used on our Azure-hosted apps they will be accepted. Is this possible?
Simple (obvious) use case:
User enters new password outside Azure
Non-Azure app calls WAF API to validate password
Validated password can be safely entered into Azure-hosted app

Facebook marketing API Does not select the correct pixel conversion event

I'v built an app that creates ads using the marketing API. When it creates the adset it sets a specific pixel and a page view event.
All our users get the correct pixel and the correct event except for one user.
Here is the object from the post request that is being sent to Facebook where we can see that they are equal
User one
"promoted_object":"{\"pixel_id\":xxxxxxxxxx63,\"custom_event_type\":\"CONTENT_VIEW\",\"pixel_rule\":\"{\\\"event\\\":{\\\"eq\\\":\\\"PageView\\\"}}\"
User two
"promoted_object":"{\"pixel_id\":xxxxxxxxxx63,\"custom_event_type\":\"CONTENT_VIEW\",\"pixel_rule\":\"{\\\"event\\\":{\\\"eq\\\":\\\"PageView\\\"}}\"
Both get the correct pixel with the correct id but one gets no conversion event, and say Missing conversion event.
Both ad accounts have full access to the pixel under the business settings in ads manager.
Here is an image that describes the issue.
Anyone have any ideas here?
make sure the conversion event is defined in that account.
The conversion event is usually set on Campaign Level and supplied when you create a campaign via API.
As you're trying to use a custom conversion it might be that you've created it for one account but didn't create it for another. That's why you don't see it in you campaign setup view. You can create it via API as described here:
Custom Conversion API
Or just do it via Business Manager and use it afterward when creating you campaigns via API or manually.
It's definitely not a request that fails in this case but a proper account configuration.

Is it possible to make two webhook calls at the same time?

I'd like to know if I can make 2 webhook calls at the same time.
I have two cloud functions: 1) Inserting a user 2) Capture user inputs
How can I go about that using webhooks on watson assistant?
(I've already posted this question on the IBM developer forum but didn't get an answer.https://developer.ibm.com/answers/questions/520504/is-it-possible-to-make-two-webhook-calls-at-the-sa.html)
Right now, there is only a form to add a single webhook to the dialog node. The reason is that each call returns values which then need to be processed by the node. Thus, you cannot make them in parallel.
If you want to make two calls for the same input data, you could do one of:
make a master webhook that then calls the other webhooks
define a sequence of actions to be processed and which is called from Watson Assistant
first call one webhook, then have a dependent node which is processed without user input, from that node perform the second webhook call
There are probably even more options, it depends on the call semantics and whether your webhooks are dependent on results / inputs or not.
One of my code samples uses a dispatch semantic to call other functions. It can be done within the same action as shown for simplicity, calling into other functions (using composer) or using REST calls into other webhooks.