@@ -5,11 +5,13 @@ import (
5
5
"io"
6
6
"io/fs"
7
7
"net/http"
8
+ "net/url"
8
9
"time"
9
10
10
11
// Packages
11
12
pg "github.com/djthorpe/go-pg"
12
13
authschema "github.com/mutablelogic/go-server/pkg/auth/schema"
14
+ "github.com/mutablelogic/go-server/pkg/ldap/schema"
13
15
pgschema "github.com/mutablelogic/go-server/pkg/pgqueue/schema"
14
16
)
15
17
@@ -152,3 +154,36 @@ type Auth interface {
152
154
// to perform an action.
153
155
Authorize (context.Context , * authschema.User , ... string ) error
154
156
}
157
+
158
+ ///////////////////////////////////////////////////////////////////////////////
159
+ // LDAP
160
+
161
+ type LDAP interface {
162
+ // Objects
163
+ List (context.Context , schema.ObjectListRequest ) (* schema.ObjectList , error ) // List all objects in the directory
164
+ Get (context.Context , string , ... string ) (* schema.Object , error ) // Get an object with attributes
165
+ Delete (context.Context , string ) (* schema.Object , error ) // Delete an object
166
+ Create (context.Context , string , url.Values ) (* schema.Object , error ) // Create a new object with attributes
167
+ Update (context.Context , string , url.Values ) (* schema.Object , error ) // Update an object with attributes
168
+
169
+ // Introspection
170
+ ListObjectClasses (context.Context ) ([]* schema.ObjectClass , error ) // Return all classes
171
+ ListAttributeTypes (context.Context ) ([]* schema.AttributeType , error ) // Return all attributes
172
+
173
+ // Users
174
+ ListUsers (context.Context , schema.ObjectListRequest ) ([]* schema.ObjectList , error ) // List users
175
+ GetUser (context.Context , string , ... string ) (* schema.Object , error ) // Get a user with attributes
176
+ CreateUser (context.Context , string , url.Values ) (* schema.Object , error ) // Create a user with attributes
177
+ DeleteUser (context.Context , string ) (* schema.Object , error ) // Delete a user
178
+
179
+ // Groups
180
+ ListGroups (context.Context , schema.ObjectListRequest ) ([]* schema.ObjectList , error ) // List groups
181
+ GetGroup (context.Context , string , ... string ) (* schema.Object , error ) // Get a group with attributes
182
+ DeleteGroup (context.Context , string ) (* schema.Object , error ) // Delete a group
183
+ AddGroupUser (context.Context , string , string ) (* schema.Object , error ) // Add a user to a group
184
+ RemoveGroupUser (context.Context , string , string ) (* schema.Object , error ) // Remove a user from a group
185
+
186
+ // Auth
187
+ Bind (context.Context , string , string ) (* schema.Object , error ) // Check user and password
188
+ ChangePassword (context.Context , string , string , * string ) (* schema.Object , error ) // Change password for a user, and return the user object
189
+ }
0 commit comments