Commit Graph
163 Commits
Author SHA1 Message Date
Michael Barz 22fb783724 test: extract go bin 2025-03-13 14:04:14 +01:00
Ralf Haferkamp 2678d0bb89 Bump mockery to 2.53.0
Should fix build on go1.24. Also fix ci-go-generate step in multiarch
Dockerfile.

Closes: #289
2025-03-03 16:02:59 +01:00
Ralf Haferkamp 6b08fa51ee fixup! Bump go-ldap to latest release 2025-02-20 09:24:03 +01:00
Ralf Haferkamp 0d03092669 Bump go-ldap to latest release
To be able to build with latest reva again
2025-02-20 09:06:07 +01:00
Ralf Haferkamp 734a1dc76b Adjust educational LDAP Attribute and Objectclasses
This is largely untested and might need further adjustments, but should
be "good enough" to not block us for now.
2025-01-29 11:59:06 +01:00
Ralf Haferkamp 1c96633985 Adjust LDAP base DN in tests to dc=example,dc=org 2025-01-29 11:59:06 +01:00
Ralf Haferkamp 0716b40fa0 Adjust LDAP Schema for new name 2025-01-29 11:58:57 +01:00
André Duffeck e8d35e1280 Use the opencloud reva from now on 2025-01-21 11:16:38 +01:00
Jörn Friedrich Dreyer b07b5a1149 use plain pkg module
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-13 16:42:19 +01:00
Jörn Friedrich Dreyer 8e028f17e9 change module name
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-13 09:58:18 +01:00
Ralf Haferkamp 82d2193ad6 fix(graph): Allow to combine $search and $filter in users query
This fixes the 'graph/v1.0/users' endpoint to allow a combination of a
memberOf filter in $filter with a search string in $search.

Allowing queries like:

$filter=(memberOf/any(m:m/id eq 509a9dcd-bb37-4f4f-a01a-19dca27d9cfa))&$search="example"
2024-12-02 17:15:21 +01:00
Jörn Friedrich Dreyer 404e3e5580 graph skip fetching members
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-12-02 10:37:07 +01:00
Ralf Haferkamp 6f90abd22d fix(ocm): Adjust for recend change for federated user IDs
The UserIds as returned by e.g. GetAcceptedUser do already contain
the provider domain in the IDP field now.

Also adjust the provider domain in the OCM config to be really a domain
without URI scheme and path.
2024-11-14 15:51:07 +01:00
Ralf Haferkamp ce663c3a3a fix(graph): treat LDAP attribute names case-insensitive everywhere
There were a couple of places where we were using the case-sensitive
GetAttributeValue method instead of the case-insensitive variant.

Fixes: #10200
2024-10-02 10:48:33 +02:00
Ralf Haferkamp 34cc7b2e56 feat(graph): Add $filter support for lastSuccessfulSignInDateTime
It is now possible to filter users based on the lastSuccessfulSignInDateTime attribute
using query filter like:
 '$filter=signInActivity/lastSuccessfulSignInDateTime le 2021-09-01T00:00:00Z'

Note: This does only work with LDAP servers actually supporting '<=' filters.
The built-in LDAP server (idm) does not support this feature.
2024-09-23 10:49:49 +02:00
Ralf Haferkamp 231128950f feat(graph): expose 'signinactivity' for users 2024-09-23 10:49:49 +02:00
Ralf Haferkamp 724755426e graph: remove some code duplication 2024-09-23 10:49:49 +02:00
Ralf Haferkamp 0bd4b90d7f fix: Make linter happy 2024-09-17 16:02:47 +02:00
Ralf Haferkamp 8e158d52bb graph(oidc): Consume UserSignedIn events in graph service
Pass them to the identity backend to update the last sign-in date of the user.
2024-09-17 16:02:47 +02:00
Jörn Friedrich Dreyer 5ab53b2474 bump reva to 9878984ce702
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-09-05 15:03:05 +02:00
Jörn Friedrich Dreyer a3c7bd3182 bump libre graph api
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-08-19 14:20:20 +02:00
Ralf Haferkamp 80e8a2ec1a (fix)graph: Always set UserType in /users responses
LDAP users without a UserType attribute get the UserType "Member"
by default. Federated users get the UserType "Federated".

Related #9702
2024-08-12 12:16:16 +02:00
Christian Richter b529eb8335 add missing errorcheck
Signed-off-by: Christian Richter <crichter@owncloud.com>
2024-06-24 12:07:26 +02:00
Jörn Friedrich Dreyer ab338884c6 rudimentary OCM support in graph
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-06-24 12:07:21 +02:00
Ralf Haferkamp eace09ca05 graph: Allow to set the identities property on users
Previously we only allowed setting the "identities" property on education users.
This changes move the related code to the main user object.
2024-05-13 17:22:37 +02:00
Jörn Friedrich Dreyer e41472234f log and trace fixes
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-04-26 17:03:49 +02:00
Thomas Müller 07f0cd5574 fix: typos, naming clashes, error messages and deprecations 2024-04-03 15:34:36 +02:00
Ralf Haferkamp 3d3f8949f5 Bump mockery to 2.40.2
to address issues when building with go1.22:
https://github.com/vektra/mockery/pull/753
2024-02-09 11:48:45 +01:00
Ralf Haferkamp 07860ef8e7 Fix some fallout of recent mockery changes (#8341)
* Fix mockery setup for graph service

Add missing interfaces to .mockery.yaml. Use existing mocks from protogen
where possible. Remove remaining //go:generate call.

* Add mockery config for settings service

* Add mockery config for proxy service
2024-02-01 21:09:01 +01:00
Jörn Friedrich Dreyer fad94d2038 bump mockery, add test stub for oidc_auth.go, align mock generation (#8321)
* bump mockery, add test stub for oidc_auth.go

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

* use .mockery.yaml for all mocks

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

* drop legacy go:generate mockery

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

* align mock placement

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

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-02-01 10:07:44 +01:00
Ralf Haferkamp a1ed2ce2e5 graph/groups: Handle quoted search terms in GetGroups
Fixes: #7990
2023-12-21 13:57:26 +01:00
Ralf Haferkamp 8489170715 graph/users: More test coverage for GetUsers search 2023-12-21 13:57:26 +01:00
Juan Pablo Villafáñez 1bcc559ed8 fix: adjust min search length if double quotes are used 2023-12-20 17:24:44 +01:00
Juan Pablo Villafáñez 34bb4f80ed fix: double quotes will be trimmed from the search token 2023-12-20 17:24:44 +01:00
Ralf Haferkamp 1ace257064 graph/groups: Allow unprivileged users to search for groups 2023-12-07 10:21:45 +01:00
Ralf Haferkamp 795989e0aa graph/users: Use a full substring filter of user search
Previously we only did a prefix match.
2023-12-07 10:21:45 +01:00
Florian Schade ad06a192d8 enhancement: add graph beta listPermissions endpoint (#7753)
* enhancement: add graph beta listPermissions endpoint

besides the new api endpoint it includes several utilities to simplify the graph api development.

* resolve drive and item id from the request path
* generic pointer and value utilities
* space root detection

* update GetDriveAndItemIDParam signature to return a error

* move errorcode package

* enhancement: add generic error code handling

* fix: rebase
2023-11-28 17:06:04 +01:00
Florian Schade 170021a38e chore: go version bump to 1.21 2023-11-23 14:52:01 +01:00
Ralf Haferkamp 6ac5ac534d Update wrapper and mocks for go-ldap 3.4.6 2023-11-22 15:12:39 +01:00
Ralf Haferkamp c9df9f5f31 graph: Make user and group lookup cache re-usable
drives.go implemented a local user/group cache (ttl based) to speed up repeated
user and group lookups. This commit moves the implementation to the 'identity' module
to make it usable outside of drives.go.
2023-11-08 14:45:44 +01:00
Ralf Haferkamp f2599dfa76 graph: Make createGroupModelFromCS3() function public
This is useful outside the identity module so make it available
2023-11-08 14:45:44 +01:00
Ralf Haferkamp 4465c9385d graph/education: Fix issues reported by sonarcloud 2023-09-27 15:39:00 +02:00
Ralf Haferkamp a34d467285 graph/education: slightly improve error handling and logging
- Use var for common errors
- Add the addition error message to the Error() output of errorcode.Error
- in PatchEducationSchool() use errorcode.RenderError() to turn the errorcode
  in to the right HTTP Status (instead of return 500 always)
2023-09-27 15:39:00 +02:00
Ralf Haferkamp 4f59de9c52 graph/education: Check school number for duplicates before adding a school 2023-09-27 15:39:00 +02:00
Ralf Haferkamp e2849bf19d graph/education: Add getSchoolByNumber helper
Sometimes we explicit need to lookup by number and not numberOrID
2023-09-27 15:39:00 +02:00
Ralf Haferkamp ce808eaa17 graph/education: Remove unreachable code
An LDAP Modify operation never returns LDAPResultEntryAlreadyExists errors.
That error can only happen for LDAPAdd or LDAPModifyDN.
2023-09-27 15:39:00 +02:00
Ralf Haferkamp 16debe6fa5 graph/education: Use helper for creating attribute list 2023-09-27 15:39:00 +02:00
Ralf Haferkamp 164edd16c0 graph/education: Don't leak LDAP errors into the graph error message 2023-09-27 15:39:00 +02:00
Jörn Friedrich Dreyer c083f598b7 fix group id claim (#7352)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-09-26 15:13:15 +02:00
Ralf Haferkamp ace1d70ba8 Fix wrong log-level for debug output 2023-09-06 08:32:34 +02:00