Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile - Implement support for system user #208

Open
2 tasks done
olebhansen opened this issue Oct 2, 2024 · 1 comment
Open
2 tasks done

Profile - Implement support for system user #208

olebhansen opened this issue Oct 2, 2024 · 1 comment
Assignees
Labels
kind/user-story Used for issues that describes functionality for our users.

Comments

@olebhansen
Copy link

olebhansen commented Oct 2, 2024

Blockers

Preview Give feedback
  1. kind/user-story
    TheTechArch

Description

First step to add support for system users in Profile is to update a few things in the application. The analysis revealed a few things that must be looked at.

System users doesn't have their own profile so the endpoint current will return 400.

Tasks

  • Implement a test of the UsersController.GetUserById method where the claims principal has a system user claim instead of a user id or org claim. Expect 200.
  • Implement a test of the UsersController.Get method where the claims principal has a system user claim instead of a user id or org claim. Expect 400.
  • Update TelemetryHelpers.EnrichFromRequest to support requests performed with a system user. (Logging of caller information.) Copy logic from Storage and the PEP package. Should be unnecessary to import the PEP package directly.

Acceptance criteria

  • A user with credentials that includes a user id will get the user profile of current user when asking the "current" endpoint
  • A user with credentials that includes a system user will get a 400 response when asking the "current" endpoint
  • A user with credentials that include a system user will get the user profile of any user when asking for profile based in a user id.
  • Repeat those above for other endpoints in the UserController.
@olebhansen olebhansen added the status/blocked Further work depending on the completion of some other task/PoC/issue label Oct 22, 2024
@SandGrainOne SandGrainOne added kind/user-story Used for issues that describes functionality for our users. and removed status/blocked Further work depending on the completion of some other task/PoC/issue labels Jan 24, 2025
@SandGrainOne SandGrainOne self-assigned this Jan 24, 2025
@Ahmed-Ghanam
Copy link
Contributor

Ahmed-Ghanam commented Feb 7, 2025

Friday, 07 February 2025:

  • When invoking the endpoint GET https://platform.at23.altinn.cloud/profile/api/v1/users/current, a 400 Bad Request response is returned with the message: "Invalid request context. UserId must be provided in claims."

  • When invoking the endpoint GET https://platform.at23.altinn.cloud/profile/api/v1/users/20020304, the corresponding user profile is successfully retrieved.

  • When invoking the endpoint GET https://platform.at23.altinn.cloud/profile/api/v1/users/byuuid/4a80af94-14be-4af5-9f95-a6a0824c5b55, the corresponding user profile is successfully retrieved.

  • When invoking the endpoint POST https://platform.at23.altinn.cloud/profile/api/v1/users, where the social security number is "18874198354" the corresponding user profile is successfully retrieved.

This task is tested and approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/user-story Used for issues that describes functionality for our users.
Projects
None yet
Development

No branches or pull requests

3 participants