Metadata-Version: 2.3
Name: felix-gitlab-oidc-application
Version: 0.2.1
Summary: Creates GitLab OIDC applications for use in dashboards like Grafana
Author: Felix Hummel
Author-email: Felix Hummel <felix-gitlab-oidc-application@felixhummel.de>
License: MIT
Requires-Dist: cyclopts>=4.6.0
Requires-Dist: libfelix>=1.4.0
Requires-Dist: python-gitlab>=8.1.0
Requires-Dist: responses>=0.26.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# felix-gitlab-oidc-application


## Usage
```bash
felix-gitlab-oidc-application -g git.example.com --redirect-url https://grafana.example.com/login/gitlab
```
creates an application on `git.example.com` (infers `grafana.example.com` as application name) and outputs both `GITLAB_OIDC_CLIENT_ID` and `GITLAB_OIDC_CLIENT_SECRET`

If you do use mise, you can output to `.config/mise.prod.toml` instead:
```
felix-gitlab-oidc-application --mise-file=.config/mise.prod.toml https://grafana.example.com/login/gitlab
```

## Installation
```bash
git clone https://codeberg.org/felixhummel/gitlab-oidc-application.git
cd gitlab-oidc-application
mise trust
mise i
uv sync
ln -s $(which felix-gitlab-oidc-application) ~/.local/bin/felix-gitlab-oidc-application
```


## Explanation
This replaces the following manual flow:

Create application
```bash
gitlab -ojson application create \
    --name grafana.example.com \
    --redirect-uri https://grafana.example.com/login/gitlab \
    --scopes 'openid profile email' \
    --confidential true
```

-->
```
{"id": 14, "application_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "application_name": "grafana.example.com", "callback_url": "https://grafana.example.com/login/gitlab", "confidential": true, "secret": "gloas-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
```

Somehow echo
```
GITLAB_OIDC_CLIENT_ID=...
GITLAB_OIDC_CLIENT_SECRET=...
```
