Fokko commented on code in PR #10722:
URL: https://github.com/apache/iceberg/pull/10722#discussion_r1684242591


##########
open-api/rest-catalog-open-api.py:
##########
@@ -441,6 +441,30 @@ class AssertViewUUID(BaseModel):
     uuid: str
 
 
+class AzureCredentials(BaseModel):
+    account_name: Optional[str] = Field(None, alias='account-name')
+    account_key: Optional[str] = Field(None, alias='account-key')
+    token: Optional[str] = None
+
+
+class AwsCredentials(BaseModel):
+    access_key_id: str = Field(..., alias='access-key-id')
+    secret_access_key: str = Field(..., alias='secret-access-key')
+    token: Optional[str] = None
+    expires_at_ms: Optional[int] = Field(None, alias='expires-at-ms')
+
+
+class GcsCredentials(BaseModel):
+    token: str
+    expires_at_ms: Optional[int] = Field(None, alias='expires-at-ms')
+

Review Comment:
   ```suggestion
       default_bucket_location: Optional[str] = Field(None, 
alias='default-bucket-location')
       endpoint: Optional[str] = None
   ```



##########
open-api/rest-catalog-open-api.py:
##########
@@ -441,6 +441,30 @@ class AssertViewUUID(BaseModel):
     uuid: str
 
 
+class AzureCredentials(BaseModel):
+    account_name: Optional[str] = Field(None, alias='account-name')
+    account_key: Optional[str] = Field(None, alias='account-key')
+    token: Optional[str] = None
+
+
+class AwsCredentials(BaseModel):
+    access_key_id: str = Field(..., alias='access-key-id')
+    secret_access_key: str = Field(..., alias='secret-access-key')
+    token: Optional[str] = None
+    expires_at_ms: Optional[int] = Field(None, alias='expires-at-ms')
+

Review Comment:
   ```suggestion
       region: Optional[str] = None
       endpoint: Optional[str] = None
   ```



##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -2747,6 +2747,54 @@ components:
         uuid:
           type: string
 
+    AzureCredentials:
+      type: object
+      properties:
+        account-name:
+          type: string
+        account-key:
+          type: string
+        token:
+          type: string
+
+    AwsCredentials:
+      type: object
+      required:
+        - access-key-id
+        - secret-access-key
+      properties:
+        access-key-id:
+          type: string
+        secret-access-key:
+          type: string
+        token:
+          type: string
+        expires-at-ms:
+          type: integer
+          format: int64
+
+    GcsCredentials:
+      type: object
+      required:
+        - token
+        - expires-at
+      properties:
+        token:
+          type: string
+        expires-at-ms:
+          type: integer
+          format: int64
+
+    Credentials:
+      type: object
+      properties:
+        aws:
+          $ref: '#/components/schemas/AwsCredentials'
+        azure:
+          $ref: '#/components/schemas/AzureCredentials'
+        gcs:
+          $ref: '#/components/schemas/GcsCredentials'

Review Comment:
   We might also add a type to it, this is a bit more flexible to extend I 
believe (you could add a custom credential in there that will be picked up by a 
custom FileIO):
   ```suggestion
       Credentials:
         discriminator:
           propertyName: type
           mapping:
             aws: '#/components/schemas/AwsCredentials'
             azure: '#/components/schemas/AzureCredentials'
             gcs: '#/components/schemas/GcsCredentials'
         type: object
         required:
           - type
         properties:
           type:
             type: string
   ```



##########
open-api/rest-catalog-open-api.py:
##########
@@ -441,6 +441,30 @@ class AssertViewUUID(BaseModel):
     uuid: str
 
 
+class AzureCredentials(BaseModel):
+    account_name: Optional[str] = Field(None, alias='account-name')
+    account_key: Optional[str] = Field(None, alias='account-key')
+    token: Optional[str] = None
+
+
+class AwsCredentials(BaseModel):
+    access_key_id: str = Field(..., alias='access-key-id')
+    secret_access_key: str = Field(..., alias='secret-access-key')
+    token: Optional[str] = None

Review Comment:
   ```suggestion
       session_token: Optional[str] = Field(..., alias='session-token')
   ```



##########
open-api/rest-catalog-open-api.py:
##########
@@ -441,6 +441,30 @@ class AssertViewUUID(BaseModel):
     uuid: str
 
 
+class AzureCredentials(BaseModel):
+    account_name: Optional[str] = Field(None, alias='account-name')
+    account_key: Optional[str] = Field(None, alias='account-key')
+    token: Optional[str] = None
+
+
+class AwsCredentials(BaseModel):

Review Comment:
   Do we want to call it AWS, or generalize it to S3? Same with Azure to ADLS.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to