Skip to content

Commit 44233fa

Browse files
authored
OpenAPI: Standardize credentials in loadTable/loadView responses (#10722)
1 parent 8a931e8 commit 44233fa

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

open-api/rest-catalog-open-api.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,14 @@ class AssertViewUUID(BaseModel):
467467
uuid: str
468468

469469

470+
class StorageCredential(BaseModel):
471+
prefix: str = Field(
472+
...,
473+
description='Indicates a storage location prefix where the credential is relevant. Clients should choose the most specific prefix (by selecting the longest prefix) if several credentials of the same type are available.',
474+
)
475+
config: Dict[str, str]
476+
477+
470478
class PlanStatus(BaseModel):
471479
__root__: Literal['completed', 'submitted', 'cancelled', 'failed'] = Field(
472480
..., description='Status of a server-side planning operation'
@@ -1195,6 +1203,11 @@ class LoadTableResult(BaseModel):
11951203
- `s3.session-token`: if present, this value should be used for as the session token
11961204
- `s3.remote-signing-enabled`: if `true` remote signing should be performed as described in the `s3-signer-open-api.yaml` specification
11971205
1206+
## Storage Credentials
1207+
1208+
Credentials for ADLS / GCS / S3 / ... are provided through the `storage-credentials` field.
1209+
Clients must first check whether the respective credentials exist in the `storage-credentials` field before checking the `config` for credentials.
1210+
11981211
"""
11991212

12001213
metadata_location: Optional[str] = Field(
@@ -1204,6 +1217,9 @@ class LoadTableResult(BaseModel):
12041217
)
12051218
metadata: TableMetadata
12061219
config: Optional[Dict[str, str]] = None
1220+
storage_credentials: Optional[List[StorageCredential]] = Field(
1221+
None, alias='storage-credentials'
1222+
)
12071223

12081224

12091225
class ScanTasks(BaseModel):
@@ -1311,11 +1327,19 @@ class LoadViewResult(BaseModel):
13111327
13121328
- `token`: Authorization bearer token to use for view requests if OAuth2 security is enabled
13131329
1330+
## Storage Credentials
1331+
1332+
Credentials for ADLS / GCS / S3 / ... are provided through the `storage-credentials` field.
1333+
Clients must first check whether the respective credentials exist in the `storage-credentials` field before checking the `config` for credentials.
1334+
13141335
"""
13151336

13161337
metadata_location: str = Field(..., alias='metadata-location')
13171338
metadata: ViewMetadata
13181339
config: Optional[Dict[str, str]] = None
1340+
storage_credentials: Optional[List[StorageCredential]] = Field(
1341+
None, alias='storage-credentials'
1342+
)
13191343

13201344

13211345
class ReportMetricsRequest(BaseModel):

open-api/rest-catalog-open-api.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3103,6 +3103,21 @@ components:
31033103
uuid:
31043104
type: string
31053105

3106+
StorageCredential:
3107+
type: object
3108+
required:
3109+
- prefix
3110+
- config
3111+
properties:
3112+
prefix:
3113+
type: string
3114+
description: Indicates a storage location prefix where the credential is relevant. Clients should choose the most
3115+
specific prefix (by selecting the longest prefix) if several credentials of the same type are available.
3116+
config:
3117+
type: object
3118+
additionalProperties:
3119+
type: string
3120+
31063121
LoadTableResult:
31073122
description: |
31083123
Result used when a table is successfully loaded.
@@ -3129,6 +3144,11 @@ components:
31293144
- `s3.secret-access-key`: secret for credentials that provide access to data in S3
31303145
- `s3.session-token`: if present, this value should be used for as the session token
31313146
- `s3.remote-signing-enabled`: if `true` remote signing should be performed as described in the `s3-signer-open-api.yaml` specification
3147+
3148+
## Storage Credentials
3149+
3150+
Credentials for ADLS / GCS / S3 / ... are provided through the `storage-credentials` field.
3151+
Clients must first check whether the respective credentials exist in the `storage-credentials` field before checking the `config` for credentials.
31323152
type: object
31333153
required:
31343154
- metadata
@@ -3142,6 +3162,10 @@ components:
31423162
type: object
31433163
additionalProperties:
31443164
type: string
3165+
storage-credentials:
3166+
type: array
3167+
items:
3168+
$ref: '#/components/schemas/StorageCredential'
31453169

31463170
ScanTasks:
31473171
type: object
@@ -3395,6 +3419,10 @@ components:
33953419
33963420
- `token`: Authorization bearer token to use for view requests if OAuth2 security is enabled
33973421
3422+
## Storage Credentials
3423+
3424+
Credentials for ADLS / GCS / S3 / ... are provided through the `storage-credentials` field.
3425+
Clients must first check whether the respective credentials exist in the `storage-credentials` field before checking the `config` for credentials.
33983426
type: object
33993427
required:
34003428
- metadata-location
@@ -3408,6 +3436,10 @@ components:
34083436
type: object
34093437
additionalProperties:
34103438
type: string
3439+
storage-credentials:
3440+
type: array
3441+
items:
3442+
$ref: '#/components/schemas/StorageCredential'
34113443

34123444
TokenType:
34133445
type: string

0 commit comments

Comments
 (0)