[GH-ISSUE #10] Administration interface #4

Closed
opened 2026-02-27 08:14:33 +03:00 by kerem · 7 comments
Owner

Originally created by @nitnelave on GitHub (Jun 24, 2021).
Original GitHub issue: https://github.com/lldap/lldap/issues/10

All about user management.

  • Users
    • List users
    • User details page
      • Editable (?)
      • View group memberships
    • Create user
    • Delete user
  • Groups
    • Create group
    • List groups
    • Add user to groups
    • Add groups to user
    • Delete group
    • List group's users
    • Rename group

If people want to help with this, it's fairly easy to add methods in the relevant handlers by copying similar ones. The places to add code:

  • Request/response: add new types in model/src/lib.rs for the request and response. Example: CreateUserRequest.
  • Server logic implementation: in src/domain/handler.rs and the corresponding sql_handler.rs. Example: list_users
  • Routing layer: add a route in src/infra/tcp_api.rs and a handler, calling the method above. Example: user_list_handler
  • Client-side: add a method in app/src/api.rs to call the server, and a component to send the request and display the result. Example: app/src/user_table.rs

(Note: specific files listed here are likely to move around a bit)

Originally created by @nitnelave on GitHub (Jun 24, 2021). Original GitHub issue: https://github.com/lldap/lldap/issues/10 All about user management. - [x] Users - [X] List users - [x] User details page - [x] Editable (?) - [x] View group memberships - [X] Create user - [x] Delete user - [x] Groups - [x] Create group - [x] List groups - [x] Add user to groups - [x] Add groups to user - [x] Delete group - [x] List group's users - [ ] Rename group If people want to help with this, it's fairly easy to add methods in the relevant handlers by copying similar ones. The places to add code: - Request/response: add new types in `model/src/lib.rs` for the request and response. Example: `CreateUserRequest`. - Server logic implementation: in `src/domain/handler.rs` and the corresponding `sql_handler.rs`. Example: `list_users` - Routing layer: add a route in `src/infra/tcp_api.rs` and a handler, calling the method above. Example: `user_list_handler` - Client-side: add a method in `app/src/api.rs` to call the server, and a component to send the request and display the result. Example: `app/src/user_table.rs` (Note: specific files listed here are likely to move around a bit)
Author
Owner

@nikhil96widhani commented on GitHub (Sep 22, 2021):

Can i create groups by passing environment variable for now or running a command. Is any way possible? i just need to create 2 groups

<!-- gh-comment-id:925049235 --> @nikhil96widhani commented on GitHub (Sep 22, 2021): Can i create groups by passing environment variable for now or running a command. Is any way possible? i just need to create 2 groups
Author
Owner

@nikhil96widhani commented on GitHub (Sep 22, 2021):

I could work on a Django Web app for this project if i can get documentation on how we can add data to the database. Any api or anything.

<!-- gh-comment-id:925051164 --> @nikhil96widhani commented on GitHub (Sep 22, 2021): I could work on a Django Web app for this project if i can get documentation on how we can add data to the database. Any api or anything.
Author
Owner

@nitnelave commented on GitHub (Sep 22, 2021):

If you need a quick hack around, editing the SQLite database is the easiest path forward. It has very few tables (users, groups, memberships) with straightforward definitions.

If you want to build a django web app, it will be a bit more involved: the API part is easy, it's GraphQL, with the schema described in schema.graphql. However, logging in requires an OPAQUE client, I'm not sure what python has to go for that. Maybe https://github.com/GeorgeLyon/Opaque ? The parameters for OPAQUE (algorithms, hasher, rounds and so on) are found here: https://github.com/nitnelave/lldap/blob/main/auth/src/opaque.rs#L18-L55

<!-- gh-comment-id:925058040 --> @nitnelave commented on GitHub (Sep 22, 2021): If you need a quick hack around, editing the SQLite database is the easiest path forward. It has very few tables (users, groups, memberships) with straightforward definitions. If you want to build a django web app, it will be a bit more involved: the API part is easy, it's GraphQL, with the schema described in `schema.graphql`. However, logging in requires an OPAQUE client, I'm not sure what python has to go for that. Maybe https://github.com/GeorgeLyon/Opaque ? The parameters for OPAQUE (algorithms, hasher, rounds and so on) are found here: https://github.com/nitnelave/lldap/blob/main/auth/src/opaque.rs#L18-L55
Author
Owner

@nikhil96widhani commented on GitHub (Sep 23, 2021):

did some research about this and found out that Django supports password hashing by default to a user model. sqlite database is also supported by it but ldap functionality will need to be implemented with the framework.

<!-- gh-comment-id:926125850 --> @nikhil96widhani commented on GitHub (Sep 23, 2021): did some research about this and found out that Django supports password hashing by default to a user model. sqlite database is also supported by it but ldap functionality will need to be implemented with the framework.
Author
Owner

@nitnelave commented on GitHub (Sep 24, 2021):

I'm not sure we're on the same page about the project's architecture. I invite you to reread the readme, but in a few words: the project has a backend listening on two ports, one for LDAP (works as an LDAP server, not client), and one for http. The port for http serves 3 things:

  • the authentication API that returns the JWT necessary for taking to the GraphQL API. Note that it's more than just password hashing: the client never send the password to the server, but proves that it knows the right password.
  • the GraphQL API that implements the backend functions needed for the web frontend
  • the static files for the web frontend.
    The web frontend is also written in Rust, compiled to WebAssembly.

If you want to write another frontend in addition to the one in development, you'll just have to talk to the authentication and GraphQL APIs. If you're talking to SQLite or do anything related to LDAP, then you're not doing the frontend but the backend. In that case, you don't need my project at all but you're reimplementing everything in python!

The fastest way forward is just to keep working on the existing Rust frontend. If you have web design skills, that is my weakest part so I welcome help in this domain :)

<!-- gh-comment-id:926380660 --> @nitnelave commented on GitHub (Sep 24, 2021): I'm not sure we're on the same page about the project's architecture. I invite you to reread the readme, but in a few words: the project has a backend listening on two ports, one for LDAP (works as an LDAP server, not client), and one for http. The port for http serves 3 things: - the authentication API that returns the JWT necessary for taking to the GraphQL API. Note that it's more than just password hashing: the client never send the password to the server, but proves that it knows the right password. - the GraphQL API that implements the backend functions needed for the web frontend - the static files for the web frontend. The web frontend is also written in Rust, compiled to WebAssembly. If you want to write another frontend in addition to the one in development, you'll just have to talk to the authentication and GraphQL APIs. If you're talking to SQLite or do anything related to LDAP, then you're not doing the frontend but the backend. In that case, you don't need my project at all but you're reimplementing everything in python! The fastest way forward is just to keep working on the _existing_ Rust frontend. If you have web design skills, that is my weakest part so I welcome help in this domain :)
Author
Owner

@nitnelave commented on GitHub (Sep 28, 2021):

All the GraphQL methods are in place, I just need to write the front-end components to list/create/delete/modify groups. Probably something quite similar to the users.

<!-- gh-comment-id:929123406 --> @nitnelave commented on GitHub (Sep 28, 2021): All the GraphQL methods are in place, I just need to write the front-end components to list/create/delete/modify groups. Probably something quite similar to the users.
Author
Owner

@nitnelave commented on GitHub (Oct 15, 2021):

Fixed with #53

<!-- gh-comment-id:944031561 --> @nitnelave commented on GitHub (Oct 15, 2021): Fixed with #53
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lldap-lldap#4
No description provided.