PolarisPrincipal missing user-defined attributes supplied during principal creation

Open Beginner friendly
#4,291 6 comments 1 reaction 0 assignees View on GitHub

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

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

bug stale
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
  1. Create a principal using the API:
    POST /api/management/v1/principals

Include user-defined attributes, for example:
region=northamerica
department=finance

  1. Use the returned client-id and client-secret to obtain an OAuth token:
    POST /api/catalog/v1/oauth/tokens

  2. Use the generated OAuth token to invoke an authenticated API (for example):
    GET /api/management/v1/catalogs

  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/polaris

All issues in apache/polaris

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.