PolarisPrincipal missing user-defined attributes supplied during principal creation
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- java
- Domain
- authentication
Research direction
Locate where PolarisPrincipal is created from PrincipalEntity and inspect the attribute maps used there. Verify the behavior with a focused test or existing authentication flow, and consider the issue done when the resulting principal retains both internal and user-defined attributes.
Written by the indexing model from the issue text.
Description
Describe the bug
When an API request is authenticated using a user principal, the internally constructed PolarisPrincipal object contains only internal attributes (such as client_id) and does not include the user-defined attributes that were supplied during principal creation.
To Reproduce
- Create a principal using the API:
POST /api/management/v1/principals
Include user-defined attributes, for example:
region=northamerica
department=finance
-
Use the returned client-id and client-secret to obtain an OAuth token:
POST /api/catalog/v1/oauth/tokens -
Use the generated OAuth token to invoke an authenticated API (for example):
GET /api/management/v1/catalogs -
Inspect the server-side PolarisPrincipal object created during request processing.
Actual Behavior
The PolarisPrincipal object contains only internal attributes (for example, client_id) and does not include user-defined attributes that were supplied during principal creation.
Expected Behavior
The PolarisPrincipal object should include both:
- Internal attributes (such as client_id), and
- User-defined attributes supplied during principal creation.
Additional context
Based on initial debugging, it appears that when PolarisPrincipal is created from PrincipalEntity, the implementation uses:
principalEntity.getInternalPropertiesAsMap()
This retains internal attributes but excludes user-defined properties.
Using:
principalEntity.getPropertiesAsMap() along with principalEntity.getInternalPropertiesAsMap() will preserve both internal and user-defined attributes.
System information
No response
- Dominant language
- Java
- Stars
- 2.1k
- Forks
- 528
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 135
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/polaris
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug stale
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
enhancement stale
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100