Saturday, 25 May 2019

Setting Authorization Headers in IBM API Connect Test and Monitor

I've recently started exploring the IBM API Connect Test and Monitor tool on IBM Cloud here: -

https://www.ibm.com/cloud/api-connect/api-test

and was having some fun n' games setting an HTTP Header, using either the basic HTTP Client or the more detailed Test Composer.

My API requires that one send an IAM token, rather than the more Basic Auth of user/password, which is nice :-)

This kept failing with HTTP403 Unauthorized.

Thankfully IBM have a nice active support community on Stack Overflow, so I posted a question here: -

Setting Authorization Headers in IBM API Connect Test and Monitor

and got some rapid feedback from the community.

In essence, I was doing it wrong ....

This is what I needed to do: -




In other words, for the Key/Value Pair (KVP) that comprises the HTTP Header field, I needed to specify Authorization as the key and Bearer XXXXXXXXXXXXXXX as the value ( with a space between the word Bearer and the actual IAM token itself.

So I was holding it wrong .... #Doofus

Apart from the basic HTTP Client, there's also a very spiffing Test Composer, that has the same requirement wrt Authorisation headers: -



For the record, there's also a GitHub project for a native client here: -

https://ibm-apiconnect.github.io/test-and-monitor/

with which I've played a wee bit .....

Wednesday, 15 May 2019

LinuxONE for Dummies


As more companies transform their infrastructures with hybrid cloud services, they require environments that protect the safety of their intellectual property, such as data and business rules.

LinuxONE is a hardware system designed to support and exploit the Linux operating system based on the value of its unique underlying architecture. In this book, you’ll learn how to

• Secure your data and spark innovation

• Leverage a large partner ecosystem

• Dynamically scale to meet your business needs

Download now to discover an enterprise-grade Linux server with a unique architecture.

LinuxONE for Dummies

Thursday, 9 May 2019

Postman on macOS - Where are my Windows ?

Having used Postman for the past few months, mainly to poke REST APIs, I hit an interesting issue last night, whereby the main Postman window refused to appear even though I'd left it open when I suspended my Mac ( closed the lid ) before leaving the office.

Now, for clarity, at work I use an external Lenovo monitor, attached via USB-C / HDMI ( using the Apple dongle ), which is positioned to the right of the MacBook Pro itself.

When I got home, I plugged in a different AOC monitor, again via USB-C / HDMI ( using a different non-Apple dongle ), again with the MBR on the left of the monitor ( "On your left" ).

Despite stopping/starting Postman multiple times, and fiddling around with the various options available on the View and Window menus, I couldn't get the main window to appear ....

Thankfully, the internet brought me to this ....

Postman opens off screen(s) when display monitors are changed #2833

which said, in part: -

...
For the moment, if you guys see this, you can reset the app's window settings manually. To do this, you'll need to delete the requester.json file from the app's data directory, this is located:

on macOS: ~/Library/Application\ Support/Postman
on Windows: C:\Users\AppData\Roaming\Postman
on Linux: ~/.config/Postman
...

and: -

...
In fact, you also need to delete the window file in the same directory.
...

Having quit Postman, I dived into Terminal ( because, Terminal ) and did this: -

rm ~/Library/Application\ Support/Postman/storage/requester.json 
rm ~/Library/Application\ Support/Postman/window 

and started Postman again .... c'est voila, here's a Postman window :-)

For the record, I'm using Postman 7.0.9, which is interesting 'cos that post is circa 2017 ....

Tuesday, 30 April 2019

Go and Glide - Problems with Update - Cannot detect VCS

I saw this today: -

glide update

which returns: -

[WARN] Unable to checkout crypto/tls
[ERROR] Error looking for crypto/tls: Cannot detect VCS

I'm using Glide 0.13.2, and Go versions 1.10.6 and 1.11.5.

Using the more detailed glide --debug update, I found a wee bit more detail: -

[DEBUG] ImportDir error on /Users/hayd/.glide/cache/src/https-crypto-tls: cannot find package "." in:
/Users/hayd/.glide/cache/src/https-crypto-tls

*BUT* this did lead me to look at my Git source folder -  $GOPATH/src - which, amongst other things had this: -

drwxr-xr-x   3 hayd  staff   96 29 Mar 19:31 crypto

which was a directory containing a sinmgle empty subdirectory: -

drwxr-xr-x  2 hayd  staff   64 29 Mar 19:33 tls

So this kinda tied up with the symptom shown up in the --debug trace i.e. cannot find package "." even though it was in a completely different place.

Once I did rm -Rf $GOPATH/src/crypto, the glide update worked a treat.

I'd previously gone down a rabbit hole with glide clear-cache and glide mirror, both of which were poisson rouge.

Hope this helps others in the same situation :-)

Friday, 26 April 2019

Input validation of REST requests using GoLang

This is an ongoing W-I-P, as I look at a set of RESTful services that I'm co-developing using Go ( aka GoLang ).

Two things that have been of immense use are: -

Validating Data Structures And Variables In Golang

Regular Expressions 101

the latter of which has been very useful in terms of creating/testing/validating Regular Expressions ( aka RegExp ).

For me, the key thing is to be able to create validation rules within the JSON data structures, and then use the Go-Validator GoLang module/plugin/add-on: -

https://github.com/go-validator/validator

Specifically, I'm using the latest version 9 ( v9 ): -

"gopkg.in/go-playground/validator.v9"

Loving my job :-)

Tuesday, 23 April 2019

The Modern Mainframe Developer Hands On Drop-In Centre - Thursday, May 2, 2019

Come along at any time, grab a machine and away you go. Refreshments and snacks will be provided. This first meetup is funded by IBM.

The following labs will be provided:

> Lab: IBM Eclipse Mainframe Development for z Systems
> Lab: REST APIs for Mainframe Applications Using z/OS Connect
> Lab: Git for Mainframe Applications
> Lab: Mainframe Code Analyzer Tools

The Modern Mainframe Developer Hands On Drop-In Centre

Sunday, 21 April 2019

MainframerZ meetup at Mediaocean, London - Thursday 20 June 2019


Come along to meet other Z professionals, and grow your network. Listen to a series of lightning talks from a range of people currently working in the Z space, and help shape the future of this group.

The lightning talks will be 10 minutes each covering a broad range of topics.

Tentative Agenda

6:15 - 6:45 Arrival and registration
7:00 - 7:10 Introductions
7:10 - 8:10 Lightning talks
8:10 - 8:45 Pizza and networking
8:45 - 9:20 Discussion
9:20 - 9:30 Wrap up

I'm honoured to be one of the speakers for the Lightning talks, so it'd be awesome to see you there, and meet IRL

MainframerZ meetup at Mediaocean

Note to self - Firefox and local connections

 Whilst trying to hit my NAS from Firefox on my Mac, I kept seeing errors such as:- Unable to connect Firefox can’t establish a connection t...