FINOS Legend GitLab Integrator

  • FINOS
Channel Revision Published Runs on
latest/stable 35 14 Aug 2023
Ubuntu 20.04
latest/edge 35 08 Aug 2023
Ubuntu 20.04
juju deploy finos-legend-gitlab-integrator-k8s
Show information

Platform:

charms.finos_legend_gitlab_integrator_k8s.v0.legend_gitlab

Charm library formalizing FINOS GitLab relations.


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.