-
Notifications
You must be signed in to change notification settings - Fork 221
API v2 endpoints for managing CoCalc as an admin #7665
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
Comments
Currently going through the API to see what we already have. Here's what I think is the current state (happy to have feedback from William or Harald on this in case I missed/misinterpreted something):
|
That would be very nice to have anyways. Of course, also add the ability to use an empty search (for admins), if it isn't there already.
What does this mean? You can update anything except email address through the user_query mechanism.
This is currently done via user_query and maintained on the client right now via a "changefeed" (LISTEN/NOTIFY) that was tricky to make fast. The main issue here is that some users can have 10K+ projects, so some care must be taken. The actual postgresql query is slightly tricky, because it's a join involving JSONB, and we don't want it to be slow or overload the database. But indeed a different version of this with paging would be more straightforward and good to add!
again, can do via user_query
I think we do, but it's maybe just via user_query. I.e., you can look in the frontend code that literally does add/remove etc. licenses and see what it does. Remember that any new endpoint you add has potentially a lot of subtle maintenance implications (and also abuse), e.g., when adding a license to a project, typically the project needs to be restarted. These should all be handled via the user_query codepath, so you MUST be aware of that if you add another endpoint (and make sure there is only one thing in the code doing the actual work).
It does exist, but maybe it is a v1 endpoint? Again, I would look at our frontend client code that does add/remove collaborators and see what's up with it. It could be you end up writing numerous endpoints that are just lightweight wrappers around user_query.
This could be nice to have through the UI. Right now we do this via some CLI scripts on the backend that directly edit the database. It would also be nice if the frontend UI told users if their project was blocked. We use this entirely for temporary subtle maintenance issues.
Again, it does, via user_query.
It does, via user_query. The user_query functionality is basically like a "GraphQL API" for cocalc. We now need a traditional HTTP style api... but I think the way to do that is in some cases to just proxy calls that go to user_query, instead of trying to do the same thing as user_query again, since the user_query code has various hooks builtin to deal with what constraints. |
Sounds like |
The bad news - it is basically the last thing still written in
coffeescript..:
…-- William Stein
On Mon, Jul 22, 2024 at 8:16 AM Jonathan Thompson ***@***.***> wrote:
Sounds like user_query is going to be my best friend for a few days. (:
—
Reply to this email directly, view it on GitHub
<#7665 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJXS5QJOSQYJBG3VE4Q6VDZNUO37AVCNFSM6AAAAABKMWNEPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBTGIYTEMJQGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Uh oh!
There was an error while loading. Please reload this page.
The following list of desired activities might already be implemented, in some way or another. The goal is to make it possible to do this via the API (v2). If applicable, I'm mentioning how to do this via the UI.
For a given
account_id
:For a given
project_id
:License management:
I don't know how much of this is implemented already. In the Admin panel, there is a way to create/edit/delete licenses. This is similar to accounts, in some sense.
The text was updated successfully, but these errors were encountered: