Skip to content

Support Dell ECS On-Premise S3 Object Store with STS support #2743

@rohangoli

Description

@rohangoli

Is your feature request related to a problem? Please describe.

Using Polaris with On-Premise S3 Storage like Dell ECS (in-built S3, IAM & STS services), code built on 1.2.0-incubating-SNAPSHOT fails at following:

org.apache.iceberg.exceptions.RESTException: Unable to process: Failed to get subscoped credentials: (Service: Sts, Status Code: 400, Request ID: null) (SDK Attempt Count: 1)
REQUEST:
POST https://ecs-prod.example.com:4443/sts?Action=AssumeRole&RoleSessionName=temp&RoleArn=urn:ecs:iam::s3:role/s3assumeRole&DurationSeconds=7200
Accept: */*
X-SDS-AUTH-TOKEN: <AUTH_TOKEN>

RESPONSE:
HTTP/1.1 200 OK
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:AssumeRoleResponse xmlns:ns2="none">
  <ResponseMetadata>
    <RequestId>0af7b369:171a31ad5b8:12e3a:b</RequestId>
  </ResponseMetadata>
  <AssumeRoleResult>
    <AssumedRoleUser>
      <Arn>urn:ecs:sts::s3:assumed-role/s3assumeRole/temp</Arn>
      <AssumedRoleId>AROA48AEC87ADCFF133F:temp</AssumedRoleId>
    </AssumedRoleUser>
    <Credentials>
      <AccessKeyId>ASIA48DB3A69C19CFE56</AccessKeyId>
      <Expiration>2020-04-23T19:45:46Z</Expiration>
      <SecretAccessKey>wDvqneW8lyJbu0VRAMU8xQHPKH1hIsYfTyozlVg5znM</SecretAccessKey>
      <SessionToken>CgJzMxIFdXNlcjEaFE0EyQ . . . mi5SBHRlbXBo2sSH9QU</SessionToken>
    </Credentials>
  </AssumeRoleResult>
</ns2:AssumeRoleResponse>
REQUEST:
POST https://192.168.0.0:4443/sts?Action=AssumeRole&RoleSessionName=temp&RoleArn=urn:ecs:iam::s3:role/s3assumeRole&DurationSeconds=7200
Accept: application/json
X-SDS-AUTH-TOKEN: <AUTH_TOKEN>

RESPONSE:
HTTP/1.1 200 OK
Content-Type: application/json
{
    "ResponseMetadata": {
        "RequestId": "0af9f5b8:171648dacb1:1bb9a:27"
    },
    "AssumedRoleUser": {
        "AssumedRoleId": "AROAB7DED71BF3317149:user1-105-temp",
        "Arn": "urn:ecs:sts::s3:assumed-role/s3assumeRole/user1-105-temp"
    },
    "Credentials": {
        "SecretAccessKey": "5KddtnuIyrfaCw7Yt1-s7_r24FU1VHl4Odyj7az_zzg",
        "SessionToken": "CgJzMxIFdXNlcjEaFEFS . . . T0EyQTdCRES10ZW1waKPGh_UF",
        "Expiration": "2020-04-24T02:49:07Z",
        "AccessKeyId": "ASIA57751957F480BE8E"
    }
}

Describe the solution you'd like

Working Code Changes are available here: https://github.com/rohangoli/polaris/tree/ecs-onpremise

  • AWS/ECS STS handling:
    • Add or extend parsing for ECS-style STS credential XML responses: org.apache.polaris.core.secrets.EcsXmlParser plus unit tests.
    • Add an interceptor to transform ECS namespace values: org.apache.polaris.core.storage.aws.EcsNamespaceTransformInterceptor.
    • Introduce/update STS client provider abstractions: org.apache.polaris.core.storage.aws.StsClientProvider and a runtime pool implementation org.apache.polaris.service.storage.aws.StsClientsPool.
    • AwsCredentialsStorageIntegration update to use the new parsing/fallbacks and namespace transform behavior: org.apache.polaris.core.storage.aws.AwsCredentialsStorageIntegration.
  • Configuration / model extensions:
    • AwsStorageConfigurationInfo gains fields/behaviors (endpointInternal, ignoreSSLVerification, pathStyleAccess, etc.) and serialization test coverage update: org.apache.polaris.core.storage.aws.AwsStorageConfigurationInfo and tests.
    • CatalogEntity.Builder.setStorageConfigurationInfo(...) mapping update to carry these new fields into internal configuration — see org.apache.polaris.core.entity.CatalogEntity.Builder.
    • Management API serialization tests update to expect the new JSON structure in catalog serialization: CatalogSerializationTest.
  • Runtime wiring:
    • New CDI/Jakarta producer or service registrations to expose StsClientsPool/StsClientProvider instances: org.apache.polaris.service.config.ServiceProducers.
    • DefaultFileIOFactory update to consider the Polaris storage access properties (endpoint / path-style / key/secret) and to merge properties and subscoped creds appropriately: org.apache.polaris.service.catalog.io.DefaultFileIOFactory.
  • Tests & tooling:
    • Tests add to validate ECS parsing fallback behavior and role ARN patterns.
    • STS raw request/response logging/capture tests add: see the two RawSts* tests.
    • MinIO testcontainer tooling update/add.

Describe alternatives you've considered

No response

Additional context

I've modified the code to fit the above purposes as describe in the solution - https://github.com/rohangoli/polaris/tree/ecs-onpremise

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions