Commit Graph

48 Commits

Author SHA1 Message Date
Ralf Haferkamp
6d5637ad79 graph: Move LDAP groups related code to a separate file 2023-01-12 17:37:10 +01:00
Daniël Franke
b0cd8779a7 Consistently add user attributes to AddRequest (#5392)
To make the `CreateUser` flow easier to test, the attributes of the
LDAP add request need to be added consistently. This way we can
expect that argument with the mock.

This PR does the following:

* Add a method `getUserAttrTypes` that returns a static list of attr names.
* Alter `userToAddRequest` to iterate over the static list, and add the attr
  if it exists in the `attrMap`.

Closes #5390
2023-01-12 17:25:43 +01:00
Daniël Franke
ddb0933033 Display surname and givenName attributes.
This PR makes it so that givenName and surname attributes are returned for users.

Fixes #5386
2023-01-12 15:01:14 +01:00
Daniël Franke
8055996874 Test CreateUser (#5382)
This tests the CreateUser functions.

Fixes #5375
2023-01-12 09:42:05 +01:00
Ralf Haferkamp
709ef1ffca graph:Add stubs for education/classes endpoints (#5360)
* Renamed files for consistency reasons

err_school.go implements the full education interface not just schools.
ldap_school.go renamed to ldap_education_school.go for making it
consistent with ldap_education_user.go

* graph: Add stubs for education/classes endpoints

The acutal backend implementations are still empty.
2023-01-11 20:38:18 +01:00
Daniël Franke
f7aff26636 Merge pull request #5370 from owncloud/ainmosni/issue/5210
Support givenName graph attribute.
2023-01-11 14:32:13 +01:00
Daniel Swärd
e1ad437d9e Fix problem with non-public error type because of forgotten rebase. 2023-01-11 12:14:54 +01:00
Daniel Swärd
e15b3cd8cc Adding so education PATCH updates school name or number. 2023-01-11 12:14:54 +01:00
Jörn Friedrich Dreyer
b9a4d0c8f7 Update services/graph/pkg/identity/ldap.go 2023-01-11 10:15:26 +01:00
Daniël Franke
5409a38549 Support givenName graph attribute.
This sets the LDAP `givenname` attribute when the libe-graph `givenName`
attribute exists.

Fixes #5210
2023-01-10 12:48:26 +01:00
Daniël Franke
aff568d0b8 Make identity errors public. (#5353)
This makes the identity errors public so other packages can match on them.

It also moves them to the same file as the interface, as that makes them more discoverable.
2023-01-06 12:04:38 +01:00
Daniel Swärd
a0e85386a4 Fixing linting error. 2023-01-05 11:42:39 +01:00
Daniel Swärd
80b8ce42f6 Update GetEducationSchoolUsers, AddUsersToEducationSchool, RemoveUserFromEducationSchool with schoolNumber. 2023-01-05 11:42:39 +01:00
Daniel Swärd
e0c6aa5c34 Modify DeleteEducationSchool for schoolNumber/id and remove old test 2023-01-05 11:42:39 +01:00
Daniel Swärd
3daf2c50b8 Modify GetEducationSchool to accept schoolNumber as well as id 2023-01-05 11:42:39 +01:00
Ralf Haferkamp
255d42eb05 Add support for listing users assigned to a school 2022-12-22 17:03:37 +01:00
Ralf Haferkamp
77ea95535e Add support for removing users from schools 2022-12-22 17:03:37 +01:00
Ralf Haferkamp
5095b35822 Fix naming of school membership endpoints
It's /education/school/{id}/users not members
2022-12-22 17:03:37 +01:00
Ralf Haferkamp
336f128e71 Add support for assigning education users to schools 2022-12-22 17:03:37 +01:00
Ralf Haferkamp
80a2c72491 graph: Initial LDAP support for /education/users
This implements GetEducationUser, GetEducationUsers, DeleteEducationUser and
CreateEducationUser methods for the LDAP backend. It's still very basic and
no fancy filtering or expanding is there yet.
2022-12-22 17:03:37 +01:00
Ralf Haferkamp
b42bf80d0e graph: Rename noop backend to ErrEducationBackend 2022-12-21 15:38:14 +01:00
Jörn Friedrich Dreyer
cd23d010a4 correct naming of education backend methods
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2022-12-21 15:38:14 +01:00
Jörn Friedrich Dreyer
5a1d3ebe82 config and logging fixes
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2022-12-21 15:38:14 +01:00
Jörn Friedrich Dreyer
57fd00d238 handle /education/user
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2022-12-21 15:38:14 +01:00
Ralf Haferkamp
962ae09bf1 LDAP support for GetSchools 2022-12-21 15:38:14 +01:00
Ralf Haferkamp
644d96e7ad LDAP support for GetSchool 2022-12-21 15:38:14 +01:00
Ralf Haferkamp
bc9f81cc23 LDAP Support for Delete School 2022-12-21 15:38:14 +01:00
Ralf Haferkamp
ad1355d032 Implement LDAP backend for CreateSchool 2022-12-21 15:38:14 +01:00
Ralf Haferkamp
b302af88f6 Add basic config setting for LDAP education backend
require LDAP support for Education resources to be explicitly enabled.
Default to a NOOP implementation if disabled.
2022-12-21 15:38:14 +01:00
Ralf Haferkamp
795bc70546 Add a more explict filter to DN based lookups
To make sure to read the right type of object
2022-12-21 15:38:14 +01:00
Jörn Friedrich Dreyer
9844f5f8ce initial schools API
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2022-12-21 15:38:14 +01:00
Jörn Friedrich Dreyer
d359a7c2cf [full-ci] standalone graph service with LDAP (#5199)
* standalone graph service with LDAP

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* no panic on PATCH and DELETE

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* fix apitoken yaml key

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* update user, fix response codes

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* fix group creation return code

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* remove unknown user property

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* fix create return code checks in graph feature context

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* updating uses 200 OK when returning a body

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* revert user statusCreated change for now

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* revert return code changes

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2022-12-12 12:46:10 +01:00
Andre Duffeck
7c2961e18a Graph test coverage (#5098)
* First iteration of a groups test

* Do not render a result in case of an error

* Generate mocks for identity.Backend

* Export listResponse (-> ListResponse)

* Add unit tests for GetGroups

* Finish GetGroups unit tests

* Increase test coverage

* Increase test coverage

* Increase test coverage

* Add missing mocks

* Fix return codes

* Fix error messages
2022-11-23 14:01:29 +01:00
Ralf Haferkamp
3d57f5cc21 Introduce TLS Settings for all reva grpc services and clients 2022-10-25 11:50:08 +02:00
Ralf Haferkamp
e373e48383 Get rid of duplicated Reva config struct
Consolidate all services to use the Reva config struct for the shared package.
This works because all services (except 'notifications', 'thumbnails' and
'webdav') where using the same config keys and environment variables for
setting the reva gateway.
2022-10-25 11:50:08 +02:00
Michael Barz
0b7297d1b4 harden drives api and improve logging 2022-10-16 00:38:44 +02:00
Ralf Haferkamp
23b9437c08 Avoid panics when LDAP users miss required attributes 2022-08-05 16:46:45 +02:00
Ralf Haferkamp
c7359a849f Avoid unneeded extra LDAP query per group
When expanding members of an LDAP group we did two group lookup per
Group. This can be avoided by expanding the members right from the
Group entry of the first query.

This also add some more unit test coverage, especially to the expand/select
group member test cases.
2022-08-05 16:46:45 +02:00
Ralf Haferkamp
8dde4e5b94 Add LDAP query details to debug log 2022-08-05 16:46:45 +02:00
Ralf Haferkamp
d867a8bc7c Don't panic on missing group attributes
Closes #4274
2022-08-05 16:46:45 +02:00
Ralf Haferkamp
53751339a6 Use existing mockery mock instead of manual ldap.Client mock 2022-08-02 16:14:39 +02:00
Ralf Haferkamp
fa36a73c54 Add missing new methods to fulfill ldap.Client interface 2022-08-02 15:34:59 +02:00
Christian Richter
1e21e23056 add drives output
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-07-29 14:39:19 +02:00
David Christofas
2707c2f4b4 escape DN attribute values 2022-07-06 15:16:43 +02:00
Ralf Haferkamp
2cabf5bf5d Use LDAP Modify Password ExtOp for updating passwords
By default the graph API will now use the LDAP Password Modify Extended
Operation for setting user passwords. By this we make sure that the
LDAP server can e.g. properly hash the password with and algorithm that
it supports.

This can be reverted to the old behaviour (using "normal" LDAP modify
requests) by setting GRAPH_LDAP_SERVER_USE_PASSWORD_MODIFY_EXOP=false

Fixes: #3778
2022-06-30 14:17:24 +02:00
Ralf Haferkamp
a464a86128 graph: Fix LDAP filter formatting for GetUsers and GetGroups
Closes: #4040
2022-06-28 13:16:40 +02:00
Christian Richter
f8f1320501 refactor extensions -> services
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-06-27 14:05:36 +02:00
Christian Richter
78064e6bab rename folder extensions -> services
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-06-27 14:05:36 +02:00