Metadata-Version: 2.4
Name: flex2rijk
Version: 0.1.0
Summary: Automatische login tool voor flex2rijk.nl Citrix werkplek
Author: Tijn Schouten
License: MIT License
        
        Copyright (c) 2026 Tijn Schouten
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Requires-Dist: keyring>=24.0.0
Requires-Dist: keyrings-alt>=5.0.2
Requires-Dist: playwright>=1.40
Provides-Extra: dev
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
Requires-Dist: pylint>=3.0.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.10.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# flex2rijk

[![PyPI version](https://badge.fury.io/py/flex2rijk.svg)](https://badge.fury.io/py/flex2rijk)
[![CI & Publish](https://github.com/tijnschouten/flex2rijk/actions/workflows/pypi-publish.yml/badge.svg)](https://github.com/tijnschouten/flex2rijk/actions/workflows/pypi-publish.yml)

Automatiseert de login op flex2rijk.nl:

- **Cross-platform:** Werkt op macOS, Windows en Linux.
- **Veilig:** Slaat credentials op in je systeem-keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service) via `keyring`.
- **Modern:** Volledig herschreven in moderne Python (Pathlib, Type Hinting).
- **Robuust:** Bevat unit tests en strikte linting (Ruff, MyPy, Pylint).

## Disclaimer

**Let op:** Deze tool is **geen** officieel product van flex2rijk of de betrokken overheidsinstanties. De auteur is op geen enkele wijze geassocieerd met flex2rijk.nl.

- **Geen Support:** Deze tool wordt geleverd "as-is" zonder enige vorm van garantie of support.
- **Eigen Risico:** Het gebruik van deze tool is volledig voor eigen risico. De auteur is niet verantwoordelijk voor eventuele schade, verlies van gegevens, of beveiligingsincidenten (zoals het verlies van wachtwoorden).
- **Doel:** Deze tool is uitsluitend bedoeld om de login-flow te automatiseren voor gebruikers die reeds rechtmatige toegang hebben tot de flex2rijk omgeving.

---

## Installatie

### 1. Installeer de tool (via uv)

De makkelijkste manier is via `uv`. Dit installeert de tool in een geïsoleerde omgeving:

```bash
uv tool install flex2rijk
```

### 2. Setup credentials (eenmalig)

Sla je gebruikersnaam en wachtwoord veilig op in je systeem-keychain:

```bash
flex2rijk --setup
```

---

## Gebruik

```bash
# Start login (browser op achtergrond)
# Bij de eerste keer wordt Chromium automatisch geïnstalleerd
flex2rijk

# Debug modus (browser zichtbaar)
flex2rijk --no-headless

# OneSpan token direct meegeven
flex2rijk 123456
```

---

## Ontwikkeling

### Installeren vanaf source
Als je de tool wilt aanpassen of testen vanaf de broncode:

```bash
git clone https://github.com/tijnschouten/flex2rijk.git
cd flex2rijk
uv tool install .
```

### Development omgeving setup
```bash
uv sync --all-groups
uv run pre-commit install
```

### Tests & Checks draaien
```bash
# Draai alle unit tests
uv run pytest

# Draai alle linters en formatters
uv run pre-commit run --all-files
```

---

## CI/CD & Publicatie

Dit project gebruikt GitHub Actions voor automatische tests en publicatie naar PyPI.

### Automatische Publicatie (Trusted Publishing)
Om automatisch te publiceren naar PyPI wanneer je een nieuwe tag aanmaakt (bijv. `v0.1.0`):

1. Ga naar je [PyPI account settings](https://pypi.org/manage/account/publishing/).
2. Voeg een **GitHub Publisher** toe voor dit repository:
   - **GitHub Repository Owner**: Je username.
   - **Repository Name**: `flex2rijk`.
   - **Workflow Name**: `pypi-publish.yml`.
   - **Environment Name**: `release`.
3. Wanneer je een tag pusht, zal de GitHub Action de tool automatisch builden en uploaden naar PyPI.

---

## Troubleshooting

- **"os.startfile niet beschikbaar":** Gebeurt alleen als je op een niet-Windows systeem probeert de Windows flow te forceren.
- **Loginformulier niet herkend:** Run met `--no-headless` om te zien waar Playwright blijft hangen.
- **ICA opent niet op Linux:** Zorg dat `xdg-open` correct geconfigureerd is voor `.ica` bestanden.
