Skip to content

Commit a657953

Browse files
apache#1326 update realm doc based on PR comments (apache#5)
1 parent ae4cca4 commit a657953

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

site/content/in-dev/unreleased/realm.md

+20-16
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,36 @@ This page explains what a realm is and what it is used for in Polaris.
2626

2727
### What is it?
2828

29-
A realm in software systems often refers to a security or authentication domain. It represents a boundary within which security policies and isolation mechanisms are applied and enforced. <br/>
30-
In the context of applications, a realm could define a scope for managing user identities, authentication, and authorization. <br/>
31-
To be more specific, a realm in Polaris represents an isolated "universe" within the system, such as different deployments, environments, regions or distinct accounts. <br/>
32-
Realms serve as a way to partition and manage data and services, ensuring that operations are performed within the correct logical context. <br/>
33-
Every REST request has a realm associated with it. If not specified the default realm is used (POLARIS). Refer to [Configuration]({{% ref "configuration" %}}) for more details.
29+
A realm in Polaris serves as logical partitioning mechanism within the catalog system. This isolation allows for multitenancy, enabling different teams, environment or organizations to operate independently within the same Polaris deployment.
3430

35-
### What problem does it solve?
31+
### Key Characteristics
3632

37-
**Security Management:** By defining a realm, systems can manage authentication and authorization in a modular and organized way. It allows for the separation of security concerns and the application of policies specific to different areas of an application. <br/>
33+
**Isolation:** Each realm encapsulates its own set of resources, ensuring that operations, security breaches or policies in one realm do not affect others.
3834

39-
**Scalability:** Realms help manage users and roles across different services or modules, providing flexibility and scalability. <br/>
35+
**Authentication Context:** When configuring Polaris, credentials are associated with a specific realm. This allows for the separation of security concerns across different realms.
4036

41-
**Isolation:** Realms can isolate different parts of a system, ensuring that security breaches or policies in one realm do not affect others.
37+
For example:
4238

43-
### How is it used in the system?
39+
`./gradlesw run -Dpolaris.bootstrap.credentials=POLARIS,root,secret
40+
`
41+
In this case POLARIS is the realm, root is the clientID and secret is the client secret.
4442

45-
**Authentication and Authorization:** For example, in `BasePolarisAuthenticator`, `RealmContext` is used to provide context about the current security domain, which can be crucial for authenticating users or services. <br/>
43+
**ConfigurationScope:** Realm identifiers are used in various configurations, such as database paths:
4644

47-
**Configuration:** Realms are configured to specify which users or services are allowed to access resources or perform certain actions. <br/>
45+
For example:
4846

49-
**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. <br/>
50-
An example of this is the way a realm name is used to create a database connection url so that you have one database instance per realm.
47+
`jdbc:h2:file:./build/test_data/polaris/{realm}/db
48+
`
49+
This ensures that each realm's data is stored separately.
5150

52-
**RealmContext:** It is a key concept used to identify and resolve the context in which operations are performed. For example, in `DefaultRealmContextResolver`, a realm is resolved from request headers, and operations are performed based on the resolved realm identifier. <br/>
51+
### How is it used in the system?
5352

54-
**MetaStore and Cache Management:** Realms are used to manage different instances or configurations of meta stores and caches. For instance, in `LocalPolarisMetaStoreManagerFactory`, realms help in segregating data per realm.
53+
**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
54+
authorization.
5555

56+
**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.
57+
An example of this is the way a realm name is used to create a database connection url so that you have one database instance per realm, or it can be more granular and applied at primary key level (within the same database instance).
5658

59+
**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.
5760

61+
**MetaStore and Cache Management:** Realms are used to manage different instances or configurations of metadata stores and caches. An example of this is `LocalPolarisMetaStoreManagerFactory`.

0 commit comments

Comments
 (0)