---
title: Charmhub | Deploy FINOS Legend GitLab Integrator using Charmhub - The Open
  Operator Collection
description: Deploy the latest version of FINOS Legend GitLab Integrator as a Kubernetes
  Operator on any cloud.
url: https://charmhub.io/finos-legend-gitlab-integrator-k8s/libraries/legend_gitlab
---

# FINOS Legend GitLab Integrator

[FINOS](https://charmhub.io/publisher/finos-charmers "View all packages from FINOS")

* [FINOS](https://charmhub.io/publisher/finos-charmers "View all packages from FINOS")

Platform:

stable 35

```
juju deploy finos-legend-gitlab-integrator-k8s
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

[Toggle side navigation](https://charmhub.io/finos-legend-gitlab-integrator-k8s/libraries/legend_gitlab#drawer)

## charms.finos\_legend\_gitlab\_integrator\_k8s.v0.legend\_gitlab

* [*Docstrings*Docstrings](https://charmhub.io/finos-legend-gitlab-integrator-k8s/libraries/legend_gitlab)
  [*Code*Source code](https://charmhub.io/finos-legend-gitlab-integrator-k8s/libraries/legend_gitlab/source-code)
* + Download

    Fetch library

    ```
    charmcraft fetch-lib charms.finos_legend_gitlab_integrator_k8s.v0.legend_gitlab
    ```

    [Download legend\_gitlab.py](https://charmhub.io/finos-legend-gitlab-integrator-k8s/libraries/legend_gitlab/download)
  + *Last updated* 22 Oct 2021
  + *Revision* Library version 0.4

Charm library formalizing FINOS GitLab relations.

---

Index

* [def set\_legend\_gitlab\_creds\_in\_relation\_data(
  relation\_data,
  creds,
  validate\_creds
  )](https://charmhub.io/finos-legend-gitlab-integrator-k8s/libraries/legend_gitlab#set_legend_gitlab_creds_in_relation_data)
* [def set\_legend\_gitlab\_redirect\_uris\_in\_relation\_data(
  relation\_data,
  redirect\_uris
  )](https://charmhub.io/finos-legend-gitlab-integrator-k8s/libraries/legend_gitlab#set_legend_gitlab_redirect_uris_in_relation_data)
* [class LegendGitlabConsumer](https://charmhub.io/finos-legend-gitlab-integrator-k8s/libraries/legend_gitlab#legendgitlabconsumer)
* + [def \_\_init\_\_(
    self,
    charm,
    relation\_name)](https://charmhub.io/finos-legend-gitlab-integrator-k8s/libraries/legend_gitlab#legendgitlabconsumer-__init__)
* + [def get\_legend\_gitlab\_creds(
    self,
    relation\_id)](https://charmhub.io/finos-legend-gitlab-integrator-k8s/libraries/legend_gitlab#legendgitlabconsumer-get_legend_gitlab_creds)
* + [def get\_legend\_redirect\_uris(
    self,
    relation\_id)](https://charmhub.io/finos-legend-gitlab-integrator-k8s/libraries/legend_gitlab#legendgitlabconsumer-get_legend_redirect_uris)

#### def set\_legend\_gitlab\_creds\_in\_relation\_data(     relation\_data,     creds,     validate\_creds )

Set connection data for GitLab in the provided relation data.

Arguments

relation\_data

Data of the relation to set the info into.

validate\_creds

Whether or not to check the structure of the data.

Returns

True if the provided creds were successfully set.

#### def set\_legend\_gitlab\_redirect\_uris\_in\_relation\_data(     relation\_data,     redirect\_uris )

Set redirect URI list for OAuth redirects in the provided relation data.

Arguments

redirect\_uris

list of strings of redirect URLs for this service.

Returns

True if the provided creds are of a valid structure, else False.

#### class LegendGitlabConsumer

Description

Class facilitating and formalizing interactions with the GitLab integrator. None

Methods

LegendGitlabConsumer.
\_\_init\_\_(

*self*

,
charm

,
relation\_name
)

LegendGitlabConsumer.
get\_legend\_gitlab\_creds(

*self*

,
relation\_id
)

Get GitLab OAuth connection data from the provided relation.

Description

Args:
relation\_id: ID of the relation to fetch data from.

Returns:
Dictionary with the following structure:
{
"client\_id": "<client\_id>",
"client\_secret": "<client\_secret>"
"openid\_discovery\_url": "<URL>",
"gitlab\_host": "<GitLab hostname or IP>",
"gitlab\_port": <port>,
"gitlab\_scheme": "<http/https>",
"gitlab\_host\_cert\_b64": "<base64 DER certificate>"
}

Raises:
TooManyRelatedAppsError if relation id is not provided and
multiple relation of the same name are present.
ValueError: if the GitLab creds are misformatted.

LegendGitlabConsumer.
get\_legend\_redirect\_uris(

*self*

,
relation\_id
)

Get GitLab redirect URIs from the provided relation.

Description

Args:
relation\_id: ID of the relation to fetch data from.

Returns:
List of strings of redirect URIs.

Raises:
TooManyRelatedAppsError if relation id is not provided and
multiple relation of the same name are present.
ValueError: if the GitLab redirect URIs are misformatted.
