I hosted a workshop at API Days in Paris about increasing developer productivity by applying AI to API Testing.
I ran a workshop at API Days London showing how you can use API Testing to test for the OWASP top 10 API Security vulnerabilities.
Cloud functions offer an easy way to build functionality and only pay for the time they are actually running without having to worry about how it will be hosted - you just right the code, save it and it is ready to be invoked. The function can be invoked through an event trigger or as a REST API - in this case I’m going to show how you can trigger a function as part of your API Connect assembly flow - providing an easy way to manage and socialise the functionality you have built.
To call an IBM Cloud function you first need to exchange your IBM Cloud API Key for an IAM access key using the IAM Authentication API.
This is a case of setting up and sending a post request to IBM Cloud IAM, to do this I used a set-variable policy to configure the headers and body followed by an invoke to https://iam.cloud.ibm.com/identity/token. The set-variable looks like this:
- set-variable:
version: 2.0.0
title: setup iam request
actions:
- set: message.headers.content-type
value: application/x-www-form-urlencoded
type: string
- set: message.headers.accept
value: application/json
type: string
- set: message.body
type: string
value: >-
grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=$(iam-apikey)
Once you have this access key you can use this to call your function using the endpoint provided in the UI:
{
For the authentication to the function URL we need to set the Authorization header to Bearer {access_key}
where access_key is from the body of the previous request, so to obtain this we can use a Parse policy to parse the returned json, and then another set-variable policy to configure the headers for the Function invoke. This time the set-variable looks like this:
- set-variable:
version: 2.0.0
title: setup function call
actions:
- set: message.headers.authorization
value: Bearer $(iam.body.access_token)
type: string
- set: message.body
value: $(request.body)
type: any
- set: message.headers.accept
value: application/json
type: string
As you can see we’re setting the authorization and accept headers, and passing the original request body from the inbound request. We follow this with an invoke of the function URL and a map, because the JSON returned from the function API includes details on invocation as well as the defined response:
{
The end to end flow looks like this:
{
Here is the complete sample swagger file which can be used in any API Connect deployment, including our new API Connect service on AWS
For the third webinar in our series ‘API Design Master Class’ I showed how you can use CI/CD with API Connect to manage your API deployments.
Our summer family break in West Bay, Dorset
Hudson Yards - Sustainability Animation from Neoscape on Vimeo.
I then went up to The Edge where you get stunning views across the city.In the afternoon Laura and I did a ‘garden to glass’ experience at the Hotel, just the two of us, where Diego took us first around the gardens of the hotel to see their sustainability at work and the different plants they grow and how they can be used. We took a basket around with us and gathered lots of sprigs of herbs, flowers and even wild blackberries.
In the gardens we also met Floriana who oversees the gardens at the Belmar who we talked to about natural pest control and composting.
When we got back to the bar, we laid out all the ingredients on a table and Diego showed us how to make a coffee rum cocktail from rum which he’d left coffee beans soaking in earlier - very simple but delicious!
We then got to make our own cocktail from some of the items we’d gathered from the garden - first selecting the spirit and then crushing the leaves together with a caramelised orange segment. We then added these to a shaker with Guaro, syrup and ice and shook it. Diego smoked the glasses on a pine smoker, added ice and then we poured the cocktails in and garnished with more findings from the garden - in this case some flower petals and a carrot leaf.
For the last cocktail we learnt how to garnish the rim of the glass and then could sit back and watch the expert at work in making the cocktails for us with cucumber and basil from the garden.
After a delicious breakfast at Belmar, this time I had the breakfast sandwich of pesto, avocado, egg and roast peppers, we were picked up by the Selvatura transport to take us to the hanging bridges tour. We got there early and were assigned to a guide to take us around the park. He took us backwards around in order to avoid the other groups which seemed to work really well! We started the tour with a Coati coming across a mini bridge to us before admiring more of the beautiful cloud forest flora. Then we reached the first bridge of ?, each of which gave us a different view of the forest - some in the trees and some above the trees, all at different heights.
We saw lots more interesting plants and small birds that flew into sight briefly and then off again busy with whatever they were doing in the forest, but also, we saw some that stayed around for us to photograph - such as the Quetzal and Toucanet.
Seeing the forest canopy from above was amazing, so much variety in colours and shapes across the trees it was such a magical place.
After the tour finished, we had a quick look in the shop and lunch in the restaurant - I wouldn’t recommend these, just get the transport back.
on to Garden to glass