-
-
Notifications
You must be signed in to change notification settings - Fork 35
[FEAT] Add (limited) API endpoint #237
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
base: main
Are you sure you want to change the base?
Conversation
…dpoint documentation
tchapi
left a comment
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.
Hi @unkn0wnAPI 👋🏼
First of all, thanks for your interest and the work you put in adding this feature.
I need to get my head around it and I lack some time right now, but I'll probably be able to dedicate more focus in the coming week. Still, I've added a few comments on the code so we can move forward.
Apart from them, an important point would be on the API authentication. I'd rather use a standard Symfony protocol than custom checks in the controller (maybe JSON-login, tied to the admin user or to each user, or a custom authenticator that indeed uses an API-key header).
Happy to discuss, and thanks again!
|
Hi, I will try my best to go over the code in the next few days (midterms are approaching, which limits my free time). In the meantime, I attempted to address most of the code review questions. Regarding API authentication, I would need to explore the options available in Symfony, as I have not worked with Symfony Custom/JSON Auth before. However, I believe this functionality should be restricted to administrators, since most of the API functionality revolves around admin tasks (most users only interact with their CalDav-supporting application of choice). Both JSON Login and API Key authentication seem promising, depending on the implementation:
Do you have a preferred approach or any suggestions regarding API authentication? |
Absolutely no pressure. I myself have a tight planning.
Agreed
I guess an API key in the request (headers probably) — just like you initially envisioned — but embedded in a proper Symfony class / process should fit the use case quite well. BR |
|
Hi, As part of this change, I fixed and refactored the existing API endpoints. For example, calendar details now indicate whether a calendar supports tasks, notes, and events. I’ve also moved the API endpoints from Additionally, I added two new endpoints that allow admins to:
The API documentation has been updated accordingly. |
tchapi
left a comment
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.
Thanks again for your work; it's clear, well-documented and seems to fit the bill quite right. Two comments below that are of importance.
Last thing we need is some basic tests of the ApiController, if you don't mind (simple use cases should be enough).
|
Hi, |
Description
This PR adds an API endpoint that allows admins to perform the following user/calendar management tasks, which are normally only available via the admin dashboard:
Additionally, this PR would include:
Reasoning for this PR
I wanted to centralize and automate calendar management in my environment. Rather than emulating browser clicks, I created an API endpoint that allows admins to perform basic tasks via API requests.
The logic for specific endpoints is based on existing code in this project and was designed to mimic its output and functionality, with additional security checks. I made the API endpoint paths match the paths I found using
console debug:routerto make it easier to understand what each route does. Since I use Davis with OpenLDAP, I skipped the logic regarding user creation, removal, etc.Source / References
Logic found in
/src/Controller/*.phpfilesSymfony Command Creation