↓ Skip to main content
An isometric drawing of a large closed teal hall and a small orange cabin on the same stone platform. The front of the cabin is cut away and shows two rooms: one with a desk and a chair, and a smaller one with a round gauge on the wall. A short covered orange footbridge joins the cabin to the hall.

Anatomy of a MAS Companion App

A Maximo Mobile app and a MAF web app are published into Maximo Manage. A companion app is deployed beside it: a container of your own, in the namespace of the suite, behind the sign-in of the suite. We took one of ours apart on a running system.

MAS 9.2 series companion app

This is the third of three anatomy pages. Anatomy of a Maximo Mobile App and Anatomy of a MAF Web App are the other two. There Are Three Ways to Build for Maximo Application Suite says when to pick which.

We read the objects, certificates, policies and requests on this page from our test system, on the MAS 9.2 series. The rest stands on the pages we link. Treat the details as a snapshot of one install.

The specimen
#

The specimen is mas-tools.com Data Import, a product of ours. It imports Excel workbooks into Maximo Manage. It is a released app with a public installation guide, and that guide lists what gets installed. A Companion App Beside Manage describes the same app from the side of the product.

Two cut-outs of the same page of the app, one above the other. Both show the header “mas-tools.com Data Import”, the heading “Import a workbook”, two lines of text and a box “Drop a workbook here, or click to choose one”. The menu of the upper one reads Import, History, Help, Administration. The menu of the lower one reads Import, History, Help.
The same page for an administrator and for a planner

On our test system five such apps run side by side. Four of them are products, and one is an internal tool. Each has one pod.

One container beside the suite’s own apps
#

d2 diagram d2 diagram

One pod with two ports. The browser reaches the first one through the router, under a path of the suite’s own address with path routing. The second one is for the cluster.

On our test system the app has no host of its own. Its route sits on the host name of the suite, under the path /mas-tools-data-import. All five of our apps use path routing there, each under its own path. Under subdomain routing the app gets a host of its own, as the installation guide says.

Path routing reaches into the app. The pod has two settings for it: the routing mode path and the base path. The callback address of the sign-in lies under that path too.

The parts
#

ObjectWhat it is forWhat we read on the cluster
Deploymentthe pod and its settings1 replica, strategy Recreate, one container, ports 9443 and 9090
Servicea stable name for the podport 443 to 9443, port 9090 to 9090
Routethe way in from the browserthe suite’s host, the app’s path, TLS termination reencrypt
CertificateTLS between router and podissued by the internal issuer of the suite, valid for one year
NetworkPolicywho may talk to the podsee below
ServiceAccountthe identity of the pod on the clusterits own account, with one role binding
Secretsthe certificate, the sign-in client, the registry pullthree secrets from the installation
ConfigMapthe configuration fileone file, config.yaml
PersistentVolumeClaimthe data of the app20 GiB, bound
Jobregisters the app for sign-in, oncefinished, 1 of 1

Read on our test system, MAS 9.2 series. Sizes and counts belong to this app.

The Job has run once. It registers the app as a client of the suite’s identity provider, with the scope openid profile email general. The client id and its secret lie in one of the three secrets, and the pod mounts it read-only.

The pod has two writable mounts. The volume is mounted at /data, and an empty directory at /tmp. The certificate, the sign-in client and the configuration file are mounted read-only.

The container asks for a quarter of a CPU and 128 MiB of memory, and its limits are one CPU and 2 GiB. It runs under a numbered user id that the cluster assigns. The role binding of the service account is for the licence of the app, which lies in a secret that the app may read and write, as the installation guide lists.

Two certificates on one request
#

A browser that opens the suite’s address gets a certificate of a public authority. We asked the pod itself on port 9443: it presents a certificate with the name of its own service, issued by the internal authority of the suite.

Both are on the same request. The route has the termination reencrypt: the router ends the TLS connection of the browser and opens a new one to the pod. The route has a destination CA set.

The certificate of the pod is an object of its own on the cluster. Its secret holds three files: the certificate, its key and the certificate of the authority. The settings of the pod name the third one as an extra trusted authority.

The network policy
#

The namespace of the suite has a policy that selects every pod and has no rule for incoming and no rule for outgoing traffic.

The app brings a policy of its own. It selects the pod of the app and has three rules:

  • Port 9443 is open for incoming traffic.
  • Port 9090 is open for the monitoring namespaces of the cluster.
  • Outgoing traffic is open.

One request, end to end
#

We sent the requests of this section ourselves, first with no session and then signed in.

  1. The first request gets a redirect. A request for the app’s page with no session answers 302. The target is the authorize address of the suite, with the id of the app as the client, a callback address under the app’s own path, and a code challenge with the method S256.

  2. The app sets two cookies. One belongs to the sign-in that has just started. It lives ten minutes and is valid for the callback path only. The other is the session of the app, valid for the path of the app. Both are HttpOnly, Secure and SameSite=Lax. The flag HttpOnly keeps a cookie away from the scripts of a page.

  3. The user signs in at the address of the suite. With a session of the suite, we saw no form at all: the browser came back to the app signed in.

  4. The page arrives with a policy. The page answers 200 and carries a Content-Security-Policy. Scripts, styles and connections are allowed from the app’s own origin. The policy is strict enough to refuse a script that our test tool tried to inject.

  5. The page calls the app, and only the app. The page sent seven kinds of requests, all to addresses under the app’s own path. The policy of the page allows connections to its own origin only. The settings of the pod hold two addresses of Maximo Manage: the public one and one inside the cluster. Two of the seven requests are about the session. The app’s answer about its version carries the idle time of the session, 1,800 seconds, and a countdown of 30 seconds.

The API answers differently from a page. Without a session, an API address of the app answered 401 with a short JSON body, where a page address answered 302. A script gets an answer it can read, and a browser gets sent to the sign-in.

Who you are comes from the suite
#

The app showed no sign-in form of its own at any point. Its answer about the user names that user’s applications and options in Maximo Manage.

We opened the app as three users. The administrator and a technician got the menu with four entries. A planner got three: the entry Administration was missing, as the picture above shows. The answer of the app about the user has five fields. They are the user, a display name, the applications with their options, the object structures, and whether the user may use the app.

The rights themselves are records in Maximo Manage. The installation adds an application for the app there, with its options, two security groups and four automation scripts. Section 12 of the installation guide describes how people get into the groups. It Works as You describes how the app then writes each row as the signed-in user.

Probes and metrics stay inside
#

We asked the second port of the pod for three addresses. Inside the pod we got these answers:

AddressAnswer
/readyz200, with a check of the data volume and of the configuration
/healthz200, {"status":"ok"}
/metrics200, 22 families of metrics

The Deployment uses the first two as readiness and liveness probes. From outside, the same three paths under the app’s address answered 302 to the sign-in, like the page paths. The route points at the first port by name.

Where your changes go
#

You want to changeIt lives in
what the app does and how it looksyour code, built into the image of the container
a settingthe ConfigMap, or an environment setting of the Deployment
who may use the appsecurity groups in Maximo Manage
how the pod is reachedRoute, Service and NetworkPolicy

We update our companion app with a new image. Section 16 of the installation guide describes that. The Deployment has the strategy Recreate, and the data lies on the volume. A Maximo Mobile app gets a new revision in Application Configuration, as Hello World in Maximo Mobile shows.

The price is that we maintain the server, the user interface, the code of the sign-in client and every update of them.

What to read next#

There Are Three Ways to Build for Maximo Application Suite puts this page beside the other two ways. Anatomy of a MAF Web App is the nearest relative: it also runs in a browser, inside Maximo Manage. The installation guide of mas-tools.com Data Tools shows the same objects from the side of the administrator who installs them.