fix(session): real getMyProfiles shape {myprofiles:[...]} + active-profile detection [#767]

https://projects.knownelement.com/issues/767#note-4191
This commit is contained in:
2026-09-04 08:56:38 -05:00
parent 5da1eee08f
commit 9d71c690b3
7 changed files with 199 additions and 29 deletions
+6 -4
View File
@@ -1,8 +1,10 @@
# mglpi connection env file (copy to ~/.creds/mglpi.env and chmod 600)
# MGLPI_URL, MGLPI_APP_TOKEN and MGLPI_USER_TOKEN are required;
# MGLPI_PROFILE_ID is optional (agent mode: auto-switch to this GLPI
# profile id, e.g. 5 = Hotliner, after InitSession). The file must be
# 0600 or stricter — mglpi refuses looser files before reading them.
# MGLPI_URL is the FULL API base INCLUDING /apirest.php — e.g.
# https://cmdb.knownelement.com/apirest.php
# (not just the server host). MGLPI_APP_TOKEN and MGLPI_USER_TOKEN are
# required; MGLPI_PROFILE_ID is optional (agent mode: auto-switch to
# this GLPI profile id, e.g. 5 = Hotliner, after InitSession). The file
# must be 0600 or stricter — mglpi refuses looser files before reading.
MGLPI_URL=https://cmdb.knownelement.com/apirest.php
MGLPI_APP_TOKEN=your-glpi-app-token
MGLPI_USER_TOKEN=your-glpi-user-token