RESTful API Integration Demos, Part 4 – Static Bearer Token Authentication

Syndeia’s Generic RESTful API interface provides a powerful tool for adding new model repositories to a digital thread without customized coding by the vendor. With this post, we continue reviewing the RESTful API demo videos organized around each of five methods authenticating access to an external RESTful API-based repository: no authentication required, basic authentication and bearer, API key, and dynamic token-based authentication. Part 4 references the video Demo 29.5 – Integrating RESTful Repositories with a static bearer token (GitLab).

The video at the end of the blog follows a similar outline to the others in this series:

  1. Integrating a RESTful repository using a Static Bearer Token
  2. Adding and executing RESTful Requests
    1. Get namespaces in a repository
    2. Get all projects in a group
    3. Get all projects in my namespace

A special feature of this video is that it compares a full, “semantically-aware” integration and a generic RESTful integration to the same repository, GitLab. Figure 1 is a screenshot of the standard GitLab integration in the Syndeia Web Dashboard. This integration has been part of the standard Syndeia commercial release since 2021 (release 3.4)

In Figure 1, we can see that the elements of the GitLab repository (namespaces, projects, branches, etc.) are neatly laid out in a tree structure and can be expanded and collapsed interactively as desired. Similarly, we can link to, visualize, or view metadata for specific elements with simple actions. All this is available “out-of-the-box” with Syndeia without the user needing any knowledge of the GitLab API.

Standard GitLab Integration in Syndeia Web Dashboard

Figure 1 Standard GitLab Integration in Syndeia Web Dashboard

Figure 2 shows an alternate view of the same repository in the Syndeia Web Dashboard using the Generic RESTful API integration. As we have seen in Parts 1-3 of this blog series, this is organized as a series of Collections, Requests, and Responses. Each request makes a specific API call to the repository, using the API documentation provided by GitLab. The response is, in many cases, a large multi-level dataset rather than a single element name.

For simple manual browsing and linking of elements in the GitLab repository, the full integration in Figure 1 is clearly favored. In addition, calls to GitLab via the Syndeia Cloud REST API are fully documented, with Java and Python language clients, making it easy to generate custom scripts and dashboards. As the video states, GitLab was chosen as a convenient example of working with static bearer token-based authentication. However, it is worth bearing in mind that all the same data is available using either approach.

Generic REST API Integration to GitLab in Syndeia Web Dashboard

Figure 2 Generic REST API Integration to GitLab in Syndeia Web Dashboard

GitLab is a widely used configuration-managed software repository based on the Git version control system. It uses a static bearer token which can be generated by the GitLab repository and can be used by any user client as long as it remains valid.

As with the previous videos, the first task is to create or update a repository connection in Syndeia to GitLab. In the Syndeia Web Dashboard, the user clicks the plus icon next to GitLab (to create a new repository connection) or the gear icon (to update an existing connection) in the left column and completes the form (see Figure 3) with URL, name and description. Authentication type is set to Bearer using the pull-down menu and a new field labelled Token appears to hold the user’s individual GitLab token value.

This is very similar to creating a GitLab connection using the standard integration as discussed earlier, although the form for the Generic RESTful integration is slightly different.

Updating a GitLab repository connection in the Syndeia Web Dashboard

Figure 3 Updating a GitLab repository connection in the Syndeia Web Dashboard

The remainder of the video demonstrates several examples of creating and executing specific API requests. Figure 4 shows request creation to get all projects in a specific namespace, Intercax. While the video does not show it, the same approach can be used to drill down to GitLab artifacts such as branches, commits, and other lower level elements within a specific project.

Formulating and testing the “Get all Intercax projects” request

Figure 4 Formulating and testing the “Get all Intercax projects” request

The Generic RESTful API Integration introduced in Syndeia 3.5 enormously expanded the number of model and data repositories that could be added to the digital thread. The final part of this blog series will cover a demonstration video using dynamic token authentication with another RESTful API-based repository.

Demo 29.5 – Integrating RESTful Repositories with static Bearer Auth (GitLab)

Other parts in this series:

Dirk Zwemer

Dr. Dirk Zwemer (dirk.zwemer@intercax.com) is President of Intercax LLC (Atlanta, GA), a supplier of MBE engineering software platforms like Syndeia and ParaMagic. He is an active teacher and consultant in the field and holds Level 4 Model Builder-Advanced certification as an OMG System Modeling Professional.