Skip to content

issue-1931 nameid lookup api#1959

Open
kayjoosten wants to merge 4 commits intomainfrom
feature/1931-nameid-lookup-api
Open

issue-1931 nameid lookup api#1959
kayjoosten wants to merge 4 commits intomainfrom
feature/1931-nameid-lookup-api

Conversation

@kayjoosten
Copy link
Copy Markdown
Contributor

No description provided.

Two new endpoints on the internal API:
- POST /info/users/nameid — forward lookup (sho + uid + sp_entityid → nameid)
- POST /info/users/id — reverse lookup (nameid → sho + uid + sp_entityid)

Both require ROLE_API_USER_NAMEID_LOOKUP and are feature-flag gated.
@kayjoosten kayjoosten force-pushed the feature/1931-nameid-lookup-api branch from 71be884 to 2ed58fd Compare March 31, 2026 06:34
@kayjoosten kayjoosten requested a review from johanib March 31, 2026 06:34
@kayjoosten kayjoosten linked an issue Mar 31, 2026 that may be closed by this pull request
@kayjoosten kayjoosten changed the title Feature/1931 nameid lookup api issue-1931 nameid lookup api Mar 31, 2026
@kayjoosten kayjoosten force-pushed the feature/1931-nameid-lookup-api branch from 2ed58fd to 6367c74 Compare March 31, 2026 08:41
Comment thread config/packages/ci/parameters.yml Outdated
Comment thread config/services/services.yml
Comment thread migrations/DoctrineMigrations/Version20260331000000.php
Comment thread src/OpenConext/EngineBlock/Service/NameIdLookupService.php Outdated
Comment thread src/OpenConext/EngineBlock/Service/NameIdLookupService.php
Comment thread src/OpenConext/EngineBlock/Service/NameIdLookupService.php Outdated
Comment thread src/OpenConext/EngineBlockBundle/Controller/Api/UserController.php
@kayjoosten kayjoosten force-pushed the feature/1931-nameid-lookup-api branch from 9b34a40 to c074c69 Compare April 9, 2026 10:01
@kayjoosten kayjoosten requested a review from johanib April 10, 2026 07:47
@kayjoosten kayjoosten force-pushed the feature/1931-nameid-lookup-api branch from d049fad to c16155e Compare April 14, 2026 11:31
return new NameIdResult($stored->persistentId, true);
}

return new NameIdResult(SamlPersistentId::generate($userUuid, $spUuid)->persistentId, false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

private function insertUserFixture(string $userUuid): void
{
$collabId = 'urn:collab:person:' . self::SHO . ':' . self::UID;
$this->connection()->executeStatement(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm triggered by the use of fixture methods inside the tests.

this is not reusable, and can get messy in the long run.

But, afaiks, there is no pre existing pattern that does it differently. And as long as the delete queries do not cause issues with other tests (which would indicate issues/tech dept at other places), this should not be a problem.

So, good enough to do it like this for now.

api.users.deprovision.username: lifecycle
api.users.deprovision.password: secret
api.users.nameIdLookup.username: nameid
api.users.nameIdLookup.password: secret
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every other parameter name is in lowercase. Probably better to remain consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add internal API to look up NameID for specific user/SP

2 participants