OpenConext / OpenConext/OpenConext-user-lifecycle

Type error when accessing the API

Open
#72 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
1
Forks
0
Avg merge
14d 19h
Merged PRs (30d)
1

Description

We have a TypeError when accessing the API from Profile

{"message":"Received information for user \"urn:collab:person:example.com:bart\" with the following data.","context":{"information_response":"[{\"name\":\"EngineBlock\",\"status\":\"OK\",\"data\":[{\"name\":\"user\",\"value\":{\"collab_person_id\":\"urn:collab:person:example.com:bart\",\"uuid\":\"053580cf-034d-46ca-8e5a-4711281918f3\"}},{\"name\":\"saml_persistent_id\",\"value\":[{\"persistent_id\":\"80afe35d357bcf3129fad50a9d3a945440026d52\",\"user_uuid\":\"053580cf-034d-46ca-8e5a-4711281918f3\",\"service_provider_entity_id\":\"https:\/\/spdashboard.test2.surfconext.nl\/saml\/metadata\"},{\"persistent_id\":\"90fff852a34b70947db973bb4e15db64d637ec9b\",\"user_uuid\":\"053580cf-034d-46ca-8e5a-4711281918f3\",\"service_provider_entity_id\":\"https:\/\/pdp.test2.surfconext.nl\/shibboleth\"},{\"persistent_id\":\"efddd8c15f83f13d4de10420d319fe89cb5f46c5\",\"user_uuid\":\"053580cf-034d-46ca-8e5a-4711281918f3\",\"service_provider_entity_id\":\"testbart\"},{\"persistent_id\":\"0d1f0fd7aa85cbc3bc26742aae0cd80dbf66bbfb\",\"user_uuid\":\"053580cf-034d-46ca-8e5a-4711281918f3\",\"service_provider_entity_id\":\"https:\/\/authz-playground.test2.surfconext.nl\"},{\"persistent_id\":\"44cdfb1426dfc18fadaddb42f75c63da3a999c0b\",\"user_uuid\":\"053580cf-034d-46ca-8e5a-4711281918f3\",\"service_provider_entity_id\":\"playground_client\"}]},{\"name\":\"consent\",\"value\":[{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/authz-playground.test2.surfconext.nl\",\"consent_given_on\":\"2019-02-21T14:44:55+01:00\",\"consent_type\":\"implicit\",\"attribute_hash\":\"f287355995f7a6d89317f463e9d78691fd02967b\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/dashboard.test2.surfconext.nl\/shibboleth\",\"consent_given_on\":\"2024-08-20T14:14:04+02:00\",\"consent_type\":\"explicit\",\"attribute_hash\":\"8977df08ee7ed4fc35595f07680535c33a7318b9\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/manage.test2.surfconext.nl\/shibboleth\",\"consent_given_on\":\"2024-08-21T13:50:27+02:00\",\"consent_type\":\"implicit\",\"attribute_hash\":\"8106e6834d9449888d51dcbaa03c43fbec24a6d5\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/mijn.test2.eduid.nl\/shibboleth\",\"consent_given_on\":\"2024-08-21T14:07:54+02:00\",\"consent_type\":\"implicit\",\"attribute_hash\":\"624fbf0d368a9d0b9d3b9018a266d459beb4bff8\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/oidctest.test2.surfconext.nl\",\"consent_given_on\":\"2018-09-13T11:42:22+02:00\",\"consent_type\":\"explicit\",\"attribute_hash\":\"bf85b266180199a1b72cbfe599df0d103bd908d4\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/pdp.test2.surfconext.nl\/shibboleth\",\"consent_given_on\":\"2021-05-04T16:26:19+02:00\",\"consent_type\":\"explicit\",\"attribute_hash\":\"3a363b81779ce880295fbbaba877831b43d02034\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/profile.test2.surfconext.nl\/authentication\/metadata\",\"consent_given_on\":\"2024-08-29T09:10:52+02:00\",\"consent_type\":\"explicit\",\"attribute_hash\":\"49af526a3e60dec85b4b6d4cc025e2b9f8423a92\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/sa.dev.surfconext.nl\/authentication\/metadata\",\"consent_given_on\":\"2019-01-21T15:53:07+01:00\",\"consent_type\":\"explicit\",\"attribute_hash\":\"15ecf7f13fa6f89b30e2152b599a8d4cea738fd2\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/sa.test2.surfconext.nl\/authentication\/metadata\",\"consent_given_on\":\"2024-01-10T16:13:09+01:00\",\"consent_type\":\"explicit\",\"attribute_hash\":\"3c3fadcf44136f5726013563dd25e7823e1eeb6d\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/spdashboard.test2.surfconext.nl\/saml\/metadata\",\"consent_given_on\":\"2024-08-21T15:46:06+02:00\",\"consent_type\":\"explicit\",\"attribute_hash\":\"64c05fb184cee8bef0873007c1680d9d84078559\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/stats.test2.surfconext.nl\",\"consent_given_on\":\"2020-05-12T09:09:10+02:00\",\"consent_type\":\"implicit\",\"attribute_hash\":\"15ecf7f13fa6f89b30e2152b599a8d4cea738fd2\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"https:\/\/teams.test2.surfconext.nl\/shibboleth\",\"consent_given_on\":\"2024-05-31T15:17:40+02:00\",\"consent_type\":\"explicit\",\"attribute_hash\":\"61df2e1e52bc6e10d1c81480578be200340898e5\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"monitoring.test2.surfconext.nl\",\"consent_given_on\":\"2023-12-13T15:15:41+01:00\",\"consent_type\":\"implicit\",\"attribute_hash\":\"ba54bba2b35272a93ef876b7d2ca6f3ea149c2ce\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"myconext.ala.eduid\",\"consent_given_on\":\"2021-05-03T20:33:35+02:00\",\"consent_type\":\"explicit\",\"attribute_hash\":\"0f70db26179ebb84b42aefacb7f5dd719f69cb02\"},{\"user_id\":\"urn:collab:person:example.com:bart\",\"service_provider_entity_id\":\"testbart\",\"consent_given_on\":\"2019-05-22T13:22:38+02:00\",\"consent_type\":\"explicit\",\"attribute_hash\":\"15ecf7f13fa6f89b30e2152b599a8d4cea738fd2\"}]}]},{\"name\":\"OpenConext-teams-server\",\"status\":\"OK\",\"data\":[{\"name\":\"email\",\"value\":\"bart@example.com\"},{\"name\":\"lastLoginDate\",\"value\":\"2024-07-11T07:49:59Z\"},{\"name\":\"membership\",\"value\":\"spd_bart_bart-1234\"},{\"name\":\"membership\",\"value\":\"spd__\"},{\"name\":\"membership\",\"value\":\"spd_baert-test-rds_barttest123\"},{\"name\":\"membership\",\"value\":\"spd_bart_bart_123_456\"},{\"name\":\"membership\",\"value\":\"Test_van_bart_change_intended_role\"},{\"name\":\"membership\",\"value\":\"spd_surf_spdashboard\"},{\"name\":\"name\",\"value\":\"Bart Doe\"},{\"name\":\"urn\",\"value\":\"urn:collab:person:example.com:bart\"}]},{\"name\":\"OpenConext-invite-server\",\"status\":\"OK\",\"data\":[]},{\"name\":\"OpenConext-attribute-aggregation-server\",\"status\":\"OK\",\"data\":[]}]"},"level":200,"level_name":"INFO","channel":"app","datetime":"2024-08-29T09:10:56.083134+02:00","extra":{}}
{"message":"Uncaught PHP Exception TypeError: \"OpenConext\UserLifecycle\Application\QueryHandler\FindUserInformationQueryHandler::handle(): Return value must be of type OpenConext\UserLifecycle\Domain\Client\InformationResponseInterface, OpenConext\UserLifecycle\Domain\Client\InformationResponseCollection returned\" at FindUserInformationQueryHandler.php line 37","context":{"exception":{"class":"TypeError","message":"OpenConext\UserLifecycle\Application\QueryHandler\FindUserInformationQueryHandler::handle(): Return value must be of type OpenConext\UserLifecycle\Domain\Client\InformationResponseInterface, OpenConext\UserLifecycle\Domain\Client\InformationResponseCollection returned","code":0,"file":"/var/www/html/src/OpenConext/UserLifecycle/Application/QueryHandler/FindUserInformationQueryHandler.php:37"}},"level":500,"level_name":"CRITICAL","channel":"request","datetime":"2024-08-29T09:10:56.083339+02:00","extra":{}}
172.18.0.29:80 145.100.191.124 - lifecycle [29/Aug/2024:09:10:56 +0200] "GET /api/deprovision/urn:collab:person:example.com:bart HTTP/1.1" 500 1502 "-" "Symfony HttpClient (Curl)"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/OpenConext/UserLifecycle/Application/QueryHandler/FindUserInformationQueryHandler.php:37 and trace the GET /api/deprovision/{user} entry point. Compare the handler's declared InformationResponseInterface return type with the returned InformationResponseCollection; done means the endpoint no longer raises this TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.