Directory
The Directory is the server-wide list of every user and group the server knows, across all metalakes. Each identity carries an origin recording how it got there. In the UI it is Configure → Directory.
| Origin | Where it comes from |
|---|---|
| Local | Created in the Directory, with a user name and password stored and managed by Datastrato |
| Provisioned | Sent by your identity provider through SCIM. The identity provider owns it, and the Directory does not add, delete, or change its password |
| JIT | Discovered from the token a user presents at sign-in, for users the identity provider has not provisioned. The identity provider owns it |
Local accounts sign in with a password and are the recovery path when the identity provider is unavailable.
A user name is unique only within its origin, so a local user and a provisioned user can share a name. Metalake membership is keyed on the metalake and the user name alone, so the two share one metalake user and every role granted to it.
A local group is meant to hold users of any origin, so an administrator can collect provisioned
and JIT users for role assignment when the identity provider's groups do not fit. In this release
it holds local users only: adding a provisioned or JIT user fails (over REST, with
IdP user not found), and the member pickers in the UI list local users only. That is a defect being
fixed, not a design limit.
Quick start
Creating a local user takes two things: the basic authenticator enabled on the server, and a
service administrator to create the account with.
-
Enable local sign-in. In
my-values.yaml, listbasicamong the authenticators and set the initial administrator account, then apply the values. The install in Install already does both.my-values.yamlgravitino:
authorization:
enable: true
serviceAdmins: admin
authenticators: "basic"
admin:
initPassword: "{admin_password}"The commands below read that password from the shell variable
ADMIN_PASSWORD.Where users also sign in through an identity provider, list both, with the provider first:
gravitino.authenticators: "oauth,basic".
- UI
- REST
-
Sign in as the administrator. Sign in to the UI as
adminwith that password. -
Create a local user. Open Configure → Directory, select Users, and click + Local user. Enter the Username and Password, optionally choose Local groups, and click Add local user.
-
Confirm the administrator works.
Check the server version as admincurl -s -u "admin:$ADMIN_PASSWORD" \
-H "Accept: application/vnd.gravitino.v1+json" \
https://{gravitino_host}/api/version | jq '.version.version' -
Create a local user.
Create a local usercurl -s -u "admin:$ADMIN_PASSWORD" -X POST \
-H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" \
-d '{"user":"{user}","password":"{user_password}"}' \
https://{gravitino_host}/api/idp/users
The new user can sign in immediately and reaches no metadata until granted a role in a metalake, which Grant access to metadata covers.
Directory and authorize
The Directory manages identities. Authorize manages what those identities can do in a metalake.
| Area | What it covers |
|---|---|
| Directory, for service administrators | Create, suspend, and delete local users and groups. List every identity with its origin. Show which metalakes each identity belongs to, read-only |
| Authorize, for metalake owners | Add a user to the metalake, grant roles to users and groups, and remove members. Authorize cannot create or delete identities |
In the UI, assigning a role to a directory user or group adds it to the metalake. Over REST, the user or group must be added to the metalake before a role can be granted to it there. See Authorize for roles, grants, and metalake membership.
Deleting a local user removes the account and its local group memberships. The user stays listed under Authorize → Users in each metalake it belonged to, with its roles, and a user created later under the same name inherits them. Until that defect is fixed, remove the user from each metalake under Authorize → Users before deleting it here. Deleting a local group likewise leaves the group under Authorize → Groups in each metalake.
Local users and groups
A local account holds its user name, password hash, and group membership in the server's own relational metadata store, alongside the rest of its metadata. Clients authenticate with HTTP Basic credentials, and nothing outside the server is required.
Local accounts authenticate callers to the server. They do not issue tokens or assertions that other services can consume, so they are not a single sign-on system and not a replacement for Okta, Microsoft Entra ID, or Keycloak. Use them for proofs of concept, isolated deployments, and as the way in when the identity provider is unavailable. For everything else, see Authentication.
Credentials travel in an HTTP header on every request, so run the server behind HTTPS wherever the network is not fully trusted.
The UI reads gravitino.authenticators from the server and presents a user name and password form
when basic is the authenticator in use.
Name and password rules
The rules below apply to creation and password changes alike.
| Rule | Value |
|---|---|
| User name | Required, at most 128 characters, no colon |
| Group name | Required, at most 128 characters |
| Group description | Optional, at most 1024 characters |
| Password length | 12 to 64 characters inclusive |
Manage users
- UI
- REST
All user tasks are on Configure → Directory, under Users.
-
Add a user. Click + Local user, fill in Username, Password, and optionally Local groups, and click Add local user.
-
Add users to groups. Select one or more local users, click + Local groups, choose the groups, and click Add local groups.
-
Delete a user. Click the trash icon on the user's row and confirm Delete this user?. A lock icon replaces the trash icon for users that cannot be deleted: provisioned and JIT users, service administrators, and yourself.
Management endpoints are served under https://{gravitino_host}/api/idp, a path that reflects the
plugin's original name rather than the feature's scope. Requests need a service administrator,
except that any user can read their own account and change their own password. Send an
Accept: application/vnd.gravitino.v1+json header and, where the request carries a body,
Content-Type: application/json.
| Operation | Method | Path | Body |
|---|---|---|---|
| Get a user | GET | /api/idp/users/{user} | None |
| Add a user | POST | /api/idp/users | {"user":"alice","password":"{password}","enabled":true} |
| Change a password | PUT | /api/idp/users/{user} | {"password":"{new_password}"} |
| Suspend or activate | PUT | /api/idp/users/{user} | {"enabled":false} |
| Remove a user | DELETE | /api/idp/users/{user} | None |
The add-user body uses the field name user rather than name. enabled is optional and defaults
to true. Service administrators and the caller cannot be removed.
curl -s -u "admin:$ADMIN_PASSWORD" -X POST \
-H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" \
-d '{"user":"{user}","password":"{user_password}"}' \
https://{gravitino_host}/api/idp/users
Change a password
- UI
- REST
-
Open your user. On Configure → Directory, under Users, click your user name. The Password tab appears for local users only.
-
Set the new password. On the Password tab, enter Current password, New password, and Confirm new password, and click Update password. Changing it signs out your other sessions.
The Password tab always asks for the current password, so the UI cannot reset another user's forgotten password. A service administrator resets one over REST.
A password change carries the new password only, with no current password. A user can change their own password, and a service administrator can reset anyone's.
curl -s -u "{user}:{user_password}" -X PUT \
-H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" \
-d '{"password":"{new_password}"}' \
https://{gravitino_host}/api/idp/users/{user}
Suspend and activate a user
A suspended user keeps their group memberships and roles but cannot authenticate: every request they
make is rejected with 401 and Account is suspended. Activating the user restores access at once.
Only local users can be suspended here, and service administrators and yourself cannot be. A
provisioned user is deactivated by the identity provider.
- UI
- REST
-
Select the users. On Configure → Directory, under Users, select one or more local users.
-
Suspend or activate them. Click Suspend and confirm. The confirmation reads "They keep their roles but cannot authenticate until reactivated." To restore access, select suspended users, click Activate, and confirm.
curl -s -u "admin:$ADMIN_PASSWORD" -X PUT \
-H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" \
-d '{"enabled":false}' \
https://{gravitino_host}/api/idp/users/{user}
Send {"enabled":true} to activate the user again. Only a service administrator can change
enabled.
Manage groups
- UI
- REST
All group tasks are on Configure → Directory, under Groups.
-
Add a group. Click + Local group, enter the Group name and an optional Description, choose Members, and click Add local group.
-
Add members. Click the group, open its Members tab, click + Add members, choose the users, and click Add members.
-
Remove a member. On the Members tab, click the trash icon on the member's row and confirm Remove member from group?.
-
Delete a group. On Groups, click the trash icon on the group's row and confirm Delete group?. Groups that are not local show a lock icon instead.
| Operation | Method | Path | Body |
|---|---|---|---|
| Get a group | GET | /api/idp/groups/{group} | None |
| Add a group | POST | /api/idp/groups | {"group":"engineering","comment":"{description}"} |
| Remove a group | DELETE | /api/idp/groups/{group}?force=true | None |
| Change group membership | PUT | /api/idp/groups/{group}/users | {"usersToAdd":["alice"],"usersToRemove":["carol"]} |
The add-group body uses the field name group rather than name, and comment is optional.
Removing a group that still has members fails unless force=true. A membership change requires at
least one of usersToAdd or usersToRemove, and accepts both in a single request.
curl -s -u "admin:$ADMIN_PASSWORD" -X PUT \
-H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" \
-d '{"usersToAdd":["alice","bob"],"usersToRemove":["carol"]}' \
https://{gravitino_host}/api/idp/groups/engineering/users
Provisioned and JIT users
Provisioned and JIT identities appear in the Directory on their own, one pushed by your identity provider and the other read from a verified token at sign-in. Both are owned by the identity provider, so add, change, and remove them there rather than in the Directory. See SCIM provisioning for provisioned identities and Authentication for the token claims a JIT user is built from.
Metalake membership is not owned by the identity provider. A provisioned or JIT user arrives with none, so adding them to a metalake is done under Authorize.
Grant access to metadata
A user can authenticate as soon as the Directory knows them, and reaches metadata only once they belong to a metalake and hold a role there, directly or through a group. The user name must match the name the user signs in as.
- UI
- REST
-
Open the roles. Select the metalake, then open Authorize → Roles.
-
Assign the role. Click + Role to create a role and choose its members there, or select an existing role and click + Members. Assigning a role adds the user or group to the metalake.
-
Add the user to the metalake.
Add the user to a metalakecurl -s -u "admin:$ADMIN_PASSWORD" -X POST \
-H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" \
-d '{"name":"{user}"}' \
https://{gravitino_host}/api/metalakes/{metalake}/users -
Grant the user a role.
Grant a role to the usercurl -s -u "admin:$ADMIN_PASSWORD" -X PUT \
-H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" \
-d '{"roleNames":["{role}"]}' \
https://{gravitino_host}/api/metalakes/{metalake}/permissions/users/{user}/grant
When gravitino.authorization.enable is set to true, only service administrators can create
metalakes. See Roles for creating roles, Privileges for roles,
privileges, and ownership, and Create a metalake for
metalake creation.
Connect engines
An engine reaches the server by one of two paths, and each takes its own Basic credentials.
Through the Gravitino connector
Configure the connector for each engine, then add the credentials below. See Spark authentication, Flink authentication, and Trino authentication for the rest of the connector setup.
spark.sql.gravitino.authType=basic
spark.sql.gravitino.basic.username={username}
spark.sql.gravitino.basic.password={password}
table.catalog-store.gravitino.gravitino.client.auth.type: basic
table.catalog-store.gravitino.gravitino.client.basic.username: {username}
table.catalog-store.gravitino.gravitino.client.basic.password: {password}
gravitino.client.authType=basic
gravitino.client.basic.username={username}
gravitino.client.basic.password={password}
Trino also needs catalog.management=dynamic in etc/config.properties and a restart before the
catalogs appear.
Through the Iceberg REST endpoint
Engines can connect straight to the Iceberg REST service at https://{iceberg_host}/iceberg with no
Gravitino connector plugin. See
Connect Spark via Iceberg REST,
Connect Flink via Iceberg REST, and
Connect Trino via Iceberg REST for the rest of the setup.
spark.sql.catalog.{catalog}.rest.auth.type=basic
spark.sql.catalog.{catalog}.rest.auth.basic.username={username}
spark.sql.catalog.{catalog}.rest.auth.basic.password={password}
'rest.auth.type' = 'basic',
'rest.auth.basic.username' = '{username}',
'rest.auth.basic.password' = '{password}'
Trino has no native Basic mode for Iceberg REST, so the header is set directly with
iceberg.rest-catalog.http-headers, which requires Trino 481 or later. Generate the encoded credentials with echo -n '{username}:{password}' | base64.
connector.name=iceberg
iceberg.catalog.type=rest
iceberg.rest-catalog.uri=https://{iceberg_host}/iceberg
iceberg.rest-catalog.http-headers=Authorization: Basic {base64_credentials}
Related
- Authorize, for adding identities to a metalake and granting them roles
- SCIM provisioning, for identities pushed by your identity provider
- Authentication, for how a caller proves who they are
- OpenAPI definition, for full request and response schemas of the local account endpoints
- HTTPS, for protecting credentials in transit
- Privileges, for what an authenticated user is allowed to do