-
-
Notifications
You must be signed in to change notification settings - Fork 147
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 : GET for repositories & projects #5486
Conversation
93ce7b5
to
f5ce8e1
Compare
f5ce8e1
to
19d508c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A first review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second review
lizmap/modules/admin_api/controllers/repository_rest.classic.php
Outdated
Show resolved
Hide resolved
37760b7
to
9098b8b
Compare
@neo-garaix can you add an OpenAPI description ? Here is a first version: openapi: 3.0.4
info:
title: Lizmap Admin API
version: 3.8.0
components:
schemas:
ErrorResponse:
type: object
properties:
code:
type: string
description: The HTTP response code message
example: Not Found
status:
type: integer
format: int32
description: the HTTP response code status
example: 404
message:
type: string
description: Message describing the error
example: Resource not found. Please provide a valid entry.
RepositoryMainData:
type: object
properties:
key:
type: string
label:
type: string
path:
type: string
RepositoryRightsGroup:
type: object
properties:
lizmap.tools.edition.use:
type: array
items:
type: string
lizmap.repositories.view:
type: array
items:
type: string
lizmap.tools.loginFilteredLayers.override:
type: array
items:
type: string
lizmap.tools.displayGetCapabilitiesLinks:
type: array
items:
type: string
lizmap.tools.layer.export:
type: array
items:
type: string
Repository:
type: object
properties:
key:
type: string
label:
type: string
path:
type: string
allowUserDefinedThemes:
type: boolean
accessControlAllowOrigin:
type: string
rightsGroup:
$ref: '#/components/schemas/RepositoryRightsGroup'
securitySchemes:
basicAuth:
type: http
scheme: basic
security:
- basicAuth: []
paths:
/admin/repositories:
get:
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RepositoryMainData'
401:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- basicAuth: []
/admin/repositories/{repository_key}:
get:
parameters:
- name: repository_key
in: path
description: The repository key to get repository data.
required: true
schema:
type: string
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Repository'
401:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
404:
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- basicAuth: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition.
Can you add some tests ?
You can have a look to tests/end2end/playwright/requests-metadata.spec.js
to have different examples.
Can you check also relevant docstrings within this PR ?
So later, it will be for the request ID 268 ?
Ofc, next thing to do !
Sorry but, I think I don't really understand what you mean by "relevant" :')
Yes ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Becoming good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments, LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1st review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is the last review
Working on cleaning commit history |
c3b2739
to
b24b17f
Compare
b24b17f
to
babe13d
Compare
Fixed openai description where a |
Back to SQL, easier than using jAcl2DbAdminUIManager We can get all rights without depending on a group
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some rephrasing that I'm gonna commits now
The backport to
stderr
stdout
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release_3_8 release_3_8
# Navigate to the new working tree
cd .worktrees/backport-release_3_8
# Create a new branch
git switch --create backport-5486-to-release_3_8
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick dec52b6f37f088faab00da492de51bc447f3a133,304ef9d7ceca2bbcf72dac97f5fe9f46591dd4b0,2776959fab93dc0bbff826eec43d2145ad0a9345,54848fac0cc5a347c39b1e54dd4fad8929bedfb0,1eb6e01a90e3f0276f57e7e1794b8b9ff8f07e6b,babe13d30d4b95d6d3e9453822148e146d209453,3dd517daf66013d17f85d345a0af8cf0c332dc98,92d95113c90f51fad052f8429f9b297fefa105eb
# Push it to GitHub
git push --set-upstream origin backport-5486-to-release_3_8
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release_3_8 Then, create a pull request where the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should declare the new api.php entrypoint here Like here
https://github.com/3liz/lizmap-gobsapi-module/blob/bf1c91fad9e7aa493af08449f95b0c6ab23a91cd/gobsapi/install/configure.php#L34
cc @rldhont @laurentj
api.php
http://localhost:8133
CORS
in nginx conf has been updated so we can test the API from the SwaggerSwagger
Some commands :
Funded by 3Liz