feat: add LDAP support and guest user functionality

- Introduced BaseDN configuration for LDAP in the config.
- Enhanced User model to include IsLDAP field.
- Updated database queries to handle LDAP users.
- Implemented GraphQL queries for LDAP browsing and user authentication type.
- Added ACL management for users and groups, including guest user permissions.
- Updated frontend to support LDAP login and guest user login.
- Improved error handling and user feedback in login and ACL management.
This commit is contained in:
2026-04-15 00:42:40 +02:00
parent 61f33d350a
commit d571f156a6
9 changed files with 710 additions and 93 deletions

View File

@@ -33,10 +33,16 @@ type Query {
images(slug: String!): [ImageFile!]!
# Browse LDAP tree (admin only)
ldapBrowse(url: String, adminUser: String, adminPass: String): LDAPTree!
ldapBrowse(url: String, baseDN: String, adminUser: String, adminPass: String): LDAPTree!
# Fetch permissions for a path
acl(path: String!): [ACLEntry!]!
# Returns all users and groups that can be assigned to ACL entries (admin only).
aclSubjects: ACLSubjects!
# Returns "local", "ldap", or "guest" for a given username.
userAuthType(username: String!): String!
}
type Mutation {
@@ -47,7 +53,7 @@ type Mutation {
testLdapConnection(url: String!, adminUser: String, adminPass: String): LDAPTestResult!
# Authenticate and receive a bearer token.
login(username: String!, password: String!): String!
login(username: String!, password: String!, ldapPassword: String): String!
# Invalidate the current session.
logout: Boolean!
@@ -101,6 +107,7 @@ type AppConfig {
type LDAPConfig {
url: String!
baseDN: String!
adminUser: String!
}
@@ -179,8 +186,20 @@ input SetupInput {
input LDAPInput {
url: String!
baseDN: String
adminUser: String!
adminPass: String!
adminPass: String
}
type ACLSubject {
id: Int!
name: String!
isLdap: Boolean!
}
type ACLSubjects {
users: [ACLSubject!]!
groups: [ACLSubject!]!
}
input ACLInput {