Skip to content

Commit 473f379

Browse files
Doc: Document the Concept of realm (#1478)
1 parent 3614be5 commit 473f379

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
#
20+
Title: Realm
21+
type: docs
22+
weight: 350
23+
---
24+
25+
This page explains what a realm is and what it is used for in Polaris.
26+
27+
### What is it?
28+
29+
A realm in Polaris serves as logical partitioning mechanism within the catalog system. This isolation allows for multitenancy, enabling different teams, environments or organizations to operate independently within the same Polaris deployment.
30+
31+
### Key Characteristics
32+
33+
**Isolation:** Each realm encapsulates its own set of resources, ensuring that operations, policies in one realm do not affect others.
34+
35+
**Authentication Context:** When configuring Polaris, principals credentials are associated with a specific realm. This allows for the separation of security concerns across different realms.
36+
37+
**Configuration Scope:** Realm identifiers are used in various configurations, such as connection strings feature configurations, etc.
38+
39+
An example of this is:
40+
41+
`jdbc:postgresql://localhost:5432/{realm}
42+
`
43+
This ensures that each realm's data is stored separately.
44+
45+
### How is it used in the system?
46+
47+
**RealmContext:** It is a key concept used to identify and resolve the context in which operations are performed. For example `DefaultRealmContextResolver`, a realm is resolved from request headers, and operations are performed based on the resolved realm identifier.
48+
49+
**Authentication and Authorization:** For example, in `BasePolarisAuthenticator`, `RealmContext` is used to provide context about the current security domain, which is used to retrieve the correct `PolarisMetastoreManager` that manages all Polaris entities and associated grant records metadata for
50+
authorization.
51+
52+
**Isolation:** In methods like `createEntityManagerFactory(@Nonnull RealmContext realmContext)` from `PolarisEclipseLinkPersistenceUnit` interface, the realm context influence how resources are created or managed based on the security policies of that realm.
53+
An example of this is the way a realm name can be used to create a database connection url so that you have one database instance per realm, when applicable. Or it can be more granular and applied at primary key level (within the same database instance).

0 commit comments

Comments
 (0)