feat(jans-cedarling): support custom tokens and automatically populate principal entity attrs with token entity refs #10592
Labels
comp-jans-cedarling
Touching folder /jans-cedarling
enhancement
kind-feature
Issue or PR is a new feature request
Milestone
Is your feature request related to a problem? Please describe.
When creating policies, users might need access to token entities. For instance, a token entity could be referenced in the attributes of a principal entity. Here's an example of how this might look in a schema:
To streamline this process, we aim to automate the creation of these token entities and ensure they are properly referenced within principal entities. However, this requires a mechanism to link token entities to their corresponding principals during entity creation.
Furthermore, we want this solution to support any custom tokens that the user might want.
Describe the solution you'd like
Supporting custom tokens
Currently, input tokens are passed into Cedarling using a map:
We know that the
access_token
,id_token
, anduserinfo_token
are token entities because of theCEDARLING_MAPPING_ID_TOKEN
,CEDARLING_MAPPING_ACCESS_TOKEN
,CEDARLING_MAPPING_USERINFO_TOKEN
bootstrap entities.To support custom tokens, we can replace the aforementioned bootstrap properties with a single bootstrap property called
CEDARLING_TOKEN_ENTITY_MAPPER
which is a map of token identifier -> fully qualified token entity name. for example:Automatically adding token entities to the principal entity's attributes
To automatically add token entities to the principal entity's attributes, we can employ the following approach:
In this approach utilize the already existing Cedar schema together with the
CEDARLING_TOKEN_ENTITY_MAPPER
bootstrap property to:Describe alternatives you've considered
An alternative solution is outlined in issue #10591. However, this is approach probably more straightforward since we refer to the cedar schema directly instead of having to implement the token-to-principal-entity mappings in the bootstrap property.
Additional context
This feature request is directly tied to and intended to close #10591
The text was updated successfully, but these errors were encountered: