Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti

### Changes

* The following APIs will now return the newly-created objects as part of the successful 201 response: createCatalog, createPrincipalRole, createCatalogRole.

### Deprecations

* The property `polaris.active-roles-provider.type` is deprecated and has no effect anymore.
Expand Down
4 changes: 2 additions & 2 deletions regtests/t_catalog_federation/src/catalog_federation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ NEW_CLIENT_SECRET=$(echo "$PRINCIPAL_RESPONSE" | jq -r '.credentials.clientSecre

# Step 2: Create local catalog
echo "Creating local catalog..."
RESPONSE_CODE=$(curl -s -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Content-Type: application/json' \
RESPONSE_CODE=$(curl -s -o /dev/null -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Content-Type: application/json' \
http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
-d '{
"type": "INTERNAL",
Expand Down Expand Up @@ -87,7 +87,7 @@ echo "Assign service_admin to new-user response code: $RESPONSE_CODE"

# Step 4: Create external catalog
echo "Creating external catalog (passthrough facade)..."
RESPONSE_CODE=$(curl -s -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Content-Type: application/json' \
RESPONSE_CODE=$(curl -s -o /dev/null -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Content-Type: application/json' \
http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
-d "{
\"type\": \"EXTERNAL\",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public Response createCatalog(
validateExternalCatalog(catalog);
Catalog newCatalog = CatalogEntity.of(adminService.createCatalog(request)).asCatalog();
LOGGER.info("Created new catalog {}", newCatalog);
return Response.status(Response.Status.CREATED).build();
return Response.status(Response.Status.CREATED).entity(newCatalog).build();
}

private void validateClientId(String clientId) {
Expand Down Expand Up @@ -338,7 +338,7 @@ public Response createPrincipalRole(
PrincipalRole newPrincipalRole =
new PrincipalRoleEntity(adminService.createPrincipalRole(entity)).asPrincipalRole();
LOGGER.info("Created new principalRole {}", newPrincipalRole);
return Response.status(Response.Status.CREATED).build();
return Response.status(Response.Status.CREATED).entity(newPrincipalRole).build();
}

/** From PolarisPrincipalRolesApiService */
Expand Down Expand Up @@ -394,7 +394,7 @@ public Response createCatalogRole(
CatalogRole newCatalogRole =
new CatalogRoleEntity(adminService.createCatalogRole(catalogName, entity)).asCatalogRole();
LOGGER.info("Created new catalogRole {}", newCatalogRole);
return Response.status(Response.Status.CREATED).build();
return Response.status(Response.Status.CREATED).entity(newCatalogRole).build();
}

/** From PolarisCatalogsApiService */
Expand Down
12 changes: 12 additions & 0 deletions spec/polaris-management-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ paths:
responses:
201:
description: "Successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/Catalog"
403:
description: "The caller does not have permission to create a catalog"
404:
Expand Down Expand Up @@ -400,6 +404,10 @@ paths:
responses:
201:
description: "Successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/PrincipalRole"
403:
description: "The caller does not have permission to add a principal role"

Expand Down Expand Up @@ -613,6 +621,10 @@ paths:
responses:
201:
description: "Successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/CatalogRole"
403:
description: "The principal is not authorized to create roles"
404:
Expand Down