Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API for repositories #5486

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neo-garaix
Copy link
Contributor

  • New entrypoint api.php
  • REST API
  • GET list of repositories through api.php/admin/repositories
  • GET single repository through api.php/admin/repositories/KEY
  • draft of POST on api.php/admin/repositories/KEY to create a new repository of key KEY

Some commands :

curl http://localhost:8130/api.php/admin/repositories
{
  "error": "Unauthorized",
  "message": "You do not have the necessary credentials to access this resource."
}
curl http://localhost:8130/api.php/admin/repositories --user admin:admin
[
  {
    "key": "testsrepository",
    "label": "Tests repository",
    "path": "tests/"
  },
  {
    "key": "private",
    "label": "Private repository",
    "path": "CONFIDENTIAL/"
  },
  {
    "key": "badrepository",
    "label": "Repository with bad path",
    "path": "bad/"
  },
  {
    "key": "montpellier",
    "label": "Demo",
    "path": "demoqgis/"
  },
  {
    "key": "intranet",
    "label": "Demo - Intranet",
    "path": "demoqgis_intranet/"
  }
]
curl http://localhost:8130/api.php/admin/repositories/intranet --user admin:admin
{
  "key": "intranet",
  "label": "Demo - Intranet",
  "path": "demoqgis_intranet/",
  "allowUserDefinedThemes": "",
  "accessControlAllowOrigin": "",
  "rightsGroup": {
    "lizmap.tools.edition.use": [
      "admins",
      "Intranet demos group",
      "lizadmins"
    ],
    "lizmap.repositories.view": [
      "admins",
      "Intranet demos group",
      "lizadmins"
    ],
    "lizmap.tools.loginFilteredLayers.override": [
      "admins",
      "Intranet demos group",
      "lizadmins"
    ],
    "lizmap.tools.displayGetCapabilitiesLinks": [
      "admins",
      "Intranet demos group",
      "lizadmins"
    ],
    "lizmap.tools.layer.export": [
      "admins",
      "Intranet demos group",
      "lizadmins"
    ]
  }
}
curl -X POST http://localhost:8130/api.php/admin/repositories/intranet --user admin:admin

Funded by 3Liz

@github-actions github-actions bot added this to the 3.10.0 milestone Feb 28, 2025
@Gustry Gustry changed the title DRAFT of admin_api REST API for repositories Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant