You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
This simplifies the subject attribute mapping to only use a single
attribute, as multiple subject attributes are explicitly disallowed by
the PDP (eg. for system users). In fact, for external use, only a single
subject attribute is ever required (eg. sending the authlvl attribute is
not supported, as it is the PEPs responsibility to enforce any
obligations returned from the PDP).
In addition, support for allowing pure Maskinporten tokens (using only
consumer-claims) has been removed, as this is not officially supported
in the Altinn Authorization model; only userid/pid/systemuserid will
cause the PDP to resolve roles/access packages in order to match policy
rules, so the only way sending organization numbers as subject claims is
if the policy itself contains hard coded organization numbers, which is
discouraged (should access lists for that).
Note that urn:altinn:org (ie serviceowner acronym claim types) are left
out, as authenticated service owners should not use the end user APIs
(this would potentially leak information that we only want to make
available to the end users).
## Related Issue(s)
See previous PR (#1340) and [slack
thread](https://digdir.slack.com/archives/C079ZFUSFMW/p1729772275391209).
## Verification
- [x] **Your** code builds clean without any errors or warnings
- [x] Manual testing done (required)
- [x] Relevant automated test added (if you find this hard, leave it and
we'll help out)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Enhanced error handling with the introduction of an
`UnreachableException` for invalid user types.
- Streamlined attribute selection logic for improved performance.
- **Bug Fixes**
- Updated claims structure in tests to reflect recent changes, ensuring
accurate validation.
- **Tests**
- Added a new test for exception handling.
- Renamed and consolidated existing tests for clarity and
maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
"Unable to find a suitable subject attribute for the authorization request. Having a known user type should be enforced during authentication (see UserTypeValidationMiddleware)."),
0 commit comments