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

Other services will need to create notifications on behalf of an application owner #466

Open
SandGrainOne opened this issue Mar 14, 2024 · 3 comments
Assignees
Labels
kind/feature-request New feature or request status/pending-feedback Awaiting clarification/input from stakeholders etc.

Comments

@SandGrainOne
Copy link
Member

SandGrainOne commented Mar 14, 2024

Description

There is a need for an "on behalf of" dimension to notification orders. The best example would be when "correspondence" includes the need for a notification. The application owner would order the creation of a correspondence using the correspondence API which in turn would send a request to notification. In order to track the notification back to the correct application owner we would need this as input from the corresponence application.

Additional Information

Separate specialiced endpoint with an admin scope that internal systems can use to order notifications on behalf of their users.

Refinement notes

  • We need to know what Notifications should keep track of and what Correspondence will keep track of.
    • Do we (Notifications) need to know both that the order was placed by system and who it was for: Correspondence for SSB.
@olebhansen
Copy link

Yes, we need to know both the client (i.e. internal service issuing the call as part of a bundeled service) and the actual service owner (the on-behalf-of part).

@olebhansen
Copy link

olebhansen commented Aug 5, 2024

@olebhansen : add contents from discussion on what stats to provide and if this can be extracted from existing API usage info.
Can be extracted from the Maskinporten-token (it will have claims set, that can be used for this purpose). Need to understand the process and if some explicit delegation is needed and/or if that will result in a too-convoluted process.

@olebhansen olebhansen added status/pending-feedback Awaiting clarification/input from stakeholders etc. status/blocked Further work depending on the completion of some other task/PoC/issue and removed status/blocked Further work depending on the completion of some other task/PoC/issue labels Aug 5, 2024
@olebhansen
Copy link

olebhansen commented Sep 27, 2024

Extracting some snippets that might inform the thinking or otherwise be relevant:

en utfordring er å propagere sluttbruker-konteksten fra f.eks. app A, som tar i mot trafikk fra en klient med JWT fra ID-Porten, til app B som kun kan nås over mTLS internt i clusteret. Authorizationpolicy kan styre hvilke verb og paths som app A kan bruke hos app B, men det blir opp til app A å styre hva en gitt bruker får lov til å gjøre av kall videre.

... har vi god nytte av OAuth2.0 Token Exchange (eller on-behalf of) for å sikre at brukerkontekst sendes med videre ned mot mikrotjenester.

Et alternativ man kan vurdere er å bare propagere tokenet fra ID-porten videre. Ulempen da er at man med ett token kan få tilgang til veldig mange tjenester, i og med at de alle validerer på samme audience. Hvis man har andre måter å identifisere og tilgangsstyre en konsument på så er det ikke sikkert at det er så farlig (typ SPIFFE e.l.)
Token exchange slik vi har implementert det løser dette ved å gi deg et nytt token med smalere audience, der hver enkelt tjeneste også kan definere hvilke konsumenter som får lov til å bytte inn tokens

Relevant links mentioned in the same context: https://docs.nais.io/auth/tokenx/index.html and https://github.com/nais/tokendings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request New feature or request status/pending-feedback Awaiting clarification/input from stakeholders etc.
Projects
None yet
Development

No branches or pull requests

2 participants